The principle of legality, a fundamental concept in law, mandates that all government actions must be based on law.

This principle ensures that individuals are regulated and governed by laws, not by the arbitrary will or discretion of those in power. It requires that laws be clear, publicized, and stable, and that they apply equally to all members of society.

The principle of legality also encompasses the notion that an action or behavior cannot be considered a crime unless it has been previously defined as such in law, thereby protecting individuals from being charged with offenses that were not defined as criminal at the time of the act.

This principle is crucial for the protection of individual rights and the maintenance of a fair legal system.