This research aims to analyze the essence of the principle of legality and the recognition of living law in society after the reform of the Indonesian National Criminal Code (KUHP). The study employs normative or doctrinal juridical research, which relies on a legislative and conceptual approach. The principle of legality is a fundamental doctrine in criminal law, emphasizing that no individual may be punished without pre-existing legal provisions. This principle is crucial not only as an instrument to guarantee legal certainty but also as a safeguard of human rights against arbitrary and repressive actions of the state. Traditionally, the principle of legality contains several core elements, namely lex scripta (law must be written), lex certa (law must be clear), lex stricta (prohibition of analogy), and lex praevia (non-retroactivity of law). These elements ensure that criminal provisions are accessible, predictable, and prevent abuse of power. However, with the enactment of the new Criminal Code in 2023, the meaning and application of this principle have shifted. The reform introduces a transition from a strictly formal legality principle toward a material legality principle. This development is particularly reflected in Article 2, paragraph (1) of the new Criminal Code, which explicitly recognizes living law (hukum yang hidup dalam masyarakat) as a legitimate source of criminal law. The recognition of living law expands the scope of legality beyond statutory law to include unwritten norms that are deeply rooted in local communities and cultural traditions. On the one hand, this reform represents an effort to align national criminal law with Indonesia’s socio-cultural realities. On the other hand, it also raises critical debates regarding legal certainty, uniformity, and potential conflicts with universal human rights standards.