An ex post facto law retroactively changes the legal consequences of actions that were committed before the enactment of the law, often to the detriment of the affected individuals. Such laws are generally prohibited under many legal systems, including the U.S. Constitution, as they violate principles of fairness and legal predictability.