The phrase Nulla poena sine lege (Latin: "no penalty without a law") refers to the legal principle that one cannot be punished for doing something that is not prohibited by law. This principle is accepted as just and upheld by the penal codes of constitutional states, including virtually all modern democracies. It is related to the principle called "Nullum crimen, nulla poena sine praevia lege poenali", which means penal law cannot be enacted retroactively.
One complexity is the lawmaking power of judges under common law. Even in civil law systems that do not admit judge-made law, it is not always clear when the function of interpretation of the criminal law ends and judicial lawmaking begins.
The question of jurisdiction may sometimes come to contradict this principle. For example, customary international law allows the prosecution of pirates by any country (applying universal jurisdiction), even if they did not commit crimes at the area that falls under this country's law. A similar principle has appeared in the recent decades with regard to crimes of genocide (see genocide as a crime under domestic law); and UN Security Council Resolution 1674 "reaffirms the provisions of paragraphs 138 and 139 of the 2005 World Summit Outcome Document regarding the responsibility to protect populations from genocide, war crimes, ethnic cleansing and crimes against humanity even if the State in which the population is being assaulted does not recognise these assaults as a breach of domestic law. However, it seems that universal jurisdiction is not to be expanded substantially to other crimes, so as to satisfy Nulla poena sine lege.
The argument has been proposed that this exercise does not violate nulla poena sine lege, since these acts, even if not prohibited under the law of any country, are in violation of international law, which many legal theorists view as being equally law. However, this view depends on accepting as law mere intent, presumption and personal preference, rather than something that has been formally codified, which is a step many legal practicians are not quite prepared to make, all theories aside.
Natural law theorists or divine command theorists would further add that nulla poena sine lege is not violated if the punished act is against natural law or the law of God, respectively, even if it violates no positive law.