Legality can be defined as an act, agreement, or contract that is consistent to the law or state of being lawful or unlawful in a given jurisdiction.
According to merriam-webster dictionary definition of Legality is 1 : attachment to or observance of law. 2 : the quality or state of being legal  Businessdictionary.com and thelawdictionary.org definition explains concept of attachment to law as Implied warranty that an act, agreement, or contract strictly adheres to the statutes of a particular jurisdiction. For example, in insurance contracts it is assumed that all risks covered under the policy are legal ventures. The second definition cited by Businessdictionary.com Legal principle that an accused may not be prosecuted for an act that is not declared a crime in that jurisdiction. is actually about Principle of legality which is part of over all concept of legality.
Vicki Schultz states that we collectively have a shared knowledge about most concepts. How we interpret the reality of our actual understanding of a concept manifests itself through the different individual narratives that we tell about the origins and meanings of a particular concept. The difference in narratives, about the same set of facts, is what divides us. An individual has the ability to frame, or understand, something very differently than the next person. Evidence does not always lead to a clear attribution of the specific cause or meaning of an issue – meanings are derived through narratives. Reality, and the facts that surround it, are personally subjective and laden with assumptions based on clearly stated facts. Anna-Maria Marshall states, this shift in framing happens because our perceptions depend “on new information and experiences;” this very idea is the basis of Ewick and Sibley definition of legality – our everyday experiences shape our understanding of the law.
Ewik and Silbey define Legality more broadly as, those meanings, sources of authority, and cultural practices that are in some sense legal although not necessarily approved or acknowledged by official law. The concept of legality the opportunity to consider "how where and with what effect law is produced in and through commonplace social interactions....How do our roles and statuses our relationships, our obligations, prerogatives and responsibilities, our identities and our behavoiurs bear the imprint of law. 
In a paper on Normative Phenomena of Morality, Ethics and Legality', Legality is defined taking states role in to account as, The system of laws and regulations of right and wrong behavior that are enforceable by the state (federal, state, or local governmental body in the U.S.) through the exercise of its policing powers and judicial process, with the threat and use of penalties, including its monopoly on the right to use physical violence. 
Principle of legality
The principle of legality is the legal ideal that requires all law to be clear, ascertainable and non-retrospective. It requires decision makers to resolve disputes by applying legal rules that have been declared beforehand, and not to alter the legal situation retrospectively by discretionary departures from established law. It is closely related to legal formalism and the rule of law and can be traced from the writings of Feuerbach, Dicey and Montesquieu.
The principle has particular relevance in criminal and administrative law. In criminal law it can be seen in the general prohibition on the imposition of criminal sanctions for acts or omissions that were not criminal at the time of their commission or omission. The principle is also thought to be violated when the sanctions for a particular crime are increased with retrospective effect.
In administrative law it can be seen in the desire for state officials to be bound by and apply the law rather than acting upon whim. As such advocates of the principle are normally against discretionary powers.
The principle can be varyingly expressed in Latin phrases such as Nullum crimen, nulla poena sine praevia lege poenali (No crime can be committed, nor punishment imposed without a pre-existing penal law), nulla poena sine lege (no penalty without law) and nullum crimen sine lege (no crime without law). A law that violates the principle by retroactively making actions illegal that were committed before the enactment of the law is called an ex post facto law.
Rule of law provides for availability of rules, laws and legal mechanism to implement them. Principle of legality checks for availability and quality of the laws. Legality checks for if certain behaviour is according to law or not. concept of Legitimacy of law looks for fairness or acceptability of fairness of process of implementation of law.
quality of being legal and observance to the law may pertain to lawfullness, i.e. being consistent to the law or it may get discussed in principle of legality or may be discussed as legal legitimacy.
Legality of Purpose
In contract law, legality of purpose is required of every enforceable contract. One can not validate or enforce a contract to do activity with unlawful purpose.
The principle of legality can be affected in different ways by different constitutional models. In the United States, laws may not violate the stated provisions of the United States Constitution which includes a prohibition on retrospective laws. In Britain under the doctrine of Parliamentary sovereignty, the legislature can (in theory) pass such retrospective laws as it sees fit, though article 7 of the European convention on human rights, which has legal force in Britain, forbids conviction for a crime which was not illegal at the time it was committed. Article 7 has already had an effect in a number of cases in the British courts.
In contrast many written constitutions prohibit the creation of retroactive (normally criminal) laws. However the possibility of statutes being struck down creates its own problems. It is clearly more difficult to ascertain what is a valid statute when any number of statutes may have constitutional question marks hanging over them. When a statute is declared unconstitutional, the actions of public authorities and private individuals which were legal under the invalidated statute, are retrospectively tainted with illegality. Such a result could not occur under parliamentary sovereignty (or at least not before Factortame) as a statute was law and its validity could not be questioned in any court.
Legality, in its criminal aspect, is a principle of international human rights law, and is incorporated into the Universal Declaration of Human Rights, the International Covenant on Civil and Political Rights and the European Convention on Human Rights. However the imposition of penalties for offences illegal under international law or criminal according to "the general principles of law recognized by civilized nations" are normally excluded from its ambit. As such the trial and punishment for genocide, war crimes and crimes against humanity does not breach international law.
There is some debate about whether this is really a true exception or not. Some people would argue that it is a derogation or - perhaps somewhat more harshly - an infringement of the principle of legality. While others would argue that crimes such as genocide are contrary to natural law and as such are always illegal and always have been. Thus imposing punishment for them is always legitimate. The exception and the natural law justification for it can be seen as an attempt to justify the Nuremberg trials and the trial of Adolf Eichmann, both of which were criticized for applying retrospective criminal sanctions.
In criminal law, the principle of legality assures the primacy of law in all criminal proceedings.
- Kelsen, Hans. General Theory of Law and State (Cambridge, Mass. : Harvard University Press, c1945) (Cambridge, Mass. : Harvard University Press, 1949) (New York : Russell & Russell, 1961) (New Brunswick, New Jersey : Transaction Publishers, c2006).
- Kelsen, Hans. Principles of international law (New York : Rinehart, 1952) (New York : Holt, Rinehart & Winston, 1966) (Clark, New Jersey : Lawbook Exchange, 2003).
- Slaughter, Anne-Marie. A new world order (Princeton : Princeton University Press, c2004).
- Nye, Joseph S. Soft power (New York : Public Affairs, c2004).
- de Sousa Santos, Boaventura and César A. Rodríguez-Garavito, eds. Law and globalization from below : towards a cosmopolitan legality (Cambridge, UK : Cambridge University Press, 2005)
- Marsh, James L. Unjust legality : a critique of Habermas's philosophy of law (Lanham : Rowman & Littlefield Publishers, c2001).
- Sarat, Austin, et al., eds. The limits of law (Stanford : Stanford University Press, 2005).
- Milano, Enrico. Unlawful territorial situations in international law : reconciling effectiveness, legality and legitimacy (Leiden ; Boston : M. Nijhoff, c2006).
- Ackerman, Bruce, ed. Bush v. Gore : the question of legitimacy (New Haven : Yale University Press, c2002).
- Gabriel Hallevy A Modern Treatise on the Principle of Legality in Criminal Law (Heidelberg : Springer-Heidelberg, c2010).
- Analytical jurisprudence
- legal positivism
- Sources of law
- Nullum crimen, nulla poena sine praevia lege poenali
- Socialist Legality
- Agent of Record
|Look up legality in Wiktionary, the free dictionary.|
- Legality, generally:
- Legality in actual operation in International Law, examples:
- International Court of Justice
- International Criminal Court
- International Criminal Tribunal for the Former Yugoslavia
- International Criminal Tribunal for Rwanda
- International Tribunal for the Law of the Sea
- European Court of Human Rights
- Decisions of various international judicial and quasi-judicial bodies, including PCIJ, CACJ, CAT, CEDAW etc.
- Legality in actual operation in national Constitutional Law, examples:
- Ewik and Silbey as quoted in Global Legal Pluralism: A Jurisprudence of Law Beyond Borders By Paul Schiff Berman
- Erhard, Werner and Jensen, Michael C. and Zaffron, Steve, Integrity: A Positive Model that Incorporates the Normative Phenomena of Morality, Ethics and Legality (March 23, 2009). Harvard Business School NOM Working Paper No. 06-11; Barbados Group Working Paper No. 06-03; Simon School Working Paper No. FR 08-05. Available at SSRN: http://ssrn.com/abstract=920625. or http://dx.doi.org/10.2139/ssrn.920625