Law as Code
In the age of AI, the digital state needs a new foundation.
For state sovereignty. For the capacity to act.

00:00
WE ARE CREATING THE OPERATING SYSTEM OF THE DIGITAL STATE AND MAKING IT EFFICIENT AND AI-READY. LAW AS CODE: THE DIGITAL LEGAL INFRASTRUCTURE AS THE FOUNDATION FOR THE APPLICATION OF LAW.
AI CAN RUN THE STATE
If not today, then tomorrow. And dramatically faster and more efficiently than humans. This presents a historic opportunity to modernize the state. But also a considerable challenge to safeguarding the rule of law and the state’s capacity to act. Harnessing this technological power without jeopardising our values, principles and sovereignty requires digital legal infrastructure provided by the state: Law as Code.
A NEW REALITY
We are experiencing a paradigm shift with unprecedented potential. AI is effectively removing the technical limits of information processing. What was previously limited by volume, speed and complexity can now be scaled to an entirely new level. This is precisely why AI affects the state at its core: the application of law is the interplay between law and reality. And within state operations, much of this interplay consists of structured information processing.
A SYSTEMIC QUESTION
This raises a fundamental question: Do we allow AI to take over this interplay, or does the state determine with binding effect how our law is to be understood and applied digitally? Law as Code represents the second option: the state provides authoritative legal logic as infrastructure and defines how AI may be used in the context of legal assessments. This requires technological development, conceptual innovation and institutional work. In the long term, it creates efficiency, interoperability, trust, AI readiness and governance.
A QUALIFICATION
Law as Code is not about another digital tool, but about the foundational architecture for the application of law in the digital state. It is about providing machine-executable legal subsumption logic as foundational legal infrastructure and operating that infrastructure. It must work together with data, identity and payment solutions to realize the transformation to the digital state.
WHAT EXACTLY IS LAW AS CODE, CONCEPTUALLY?
A state-authorised and versioned model of legal subsumption logic: conditions, exceptions, references, time limits, discretionary powers and legal consequences are represented in a structured, machine-executable form. This makes the law in force accessible, queryable and usable as shared digital infrastructure for courts, public administration, businesses, civil society and citizens. It forms the foundation for the digital application of law while also making the state’s use of AI governable: binding rules can specify where, under what conditions and for which tasks AI may be used.
The function of this digital legal infrastructure becomes clear from its position between the creation and the application of law. The legislature creates law. This level is political and generic. The executive and the judiciary apply it. This level is operational and specific: it leads to decisions in individual cases. Between them lies a function that has so far rarely been understood as a distinct responsibility of state infrastructure: the provision of the law in force. This function is formal and generic. It neither changes the law nor decides individual cases. In the analogue state, its medium was the statute book. In the digital state, this initially became the PDF and, more recently, XML. Yet XML, too, remains a document representation. Law as Code turns the provision of law into digital infrastructure for the first time: from digitally available legal text to machine-executable legal logic. Law as Code therefore sits precisely between the creation and the application of law.

WHY LAW AS CODE?
Because applying law digitally without shared, machine-executable legal logic leads to inefficiencies, a lack of interoperability and a loss of trust. And because AI can run the state – if not today, then tomorrow. Law as Code addresses precisely these challenges: it creates efficiency, interoperability, trust and AI readiness. Legal logic is modelled reliably once, made usable through shared infrastructure and rendered equally transparent and traceable for everyone. At the same time, it creates a binding framework within which the state determines which AI system may perform which tasks and under what conditions.
WHAT DOES LAW AS CODE REQUIRE?
Law as Code requires the coordinated development of technical, legal, institutional and political structures. These include a digital representation format, a scalable transformation process, binding procedures for review and authorisation, a clear and constitutionally sound allocation of state responsibility, the technical implementation and the assurance of the long-term operation of the infrastructure to be built.
HOW DOES LAW AS CODE CHANGE THE MARKET?
Law as Code shifts value creation from the institution-specific translation of law to the development, operation and use of shared state legal infrastructure. New value is created where this infrastructure is developed, reviewed, secured, updated and operated. New applications and services for public administration, the judiciary, businesses and the public are built on this infrastructure.
WHAT IS SPRIND DOING – and how can you get involved?
SPRIND is working to establish a shared understanding of Law as Code and to further define the concept, with the aim of initiating reference implementations. To position Law as Code internationally, open it to discussion and develop it collaboratively, SPRIND has initiated an OECD consultation. The public consultation is aimed at experts and institutions from law, technology, public administration, politics, academia, business and civil society. Across three phases, existing initiatives are mapped, common principles and requirements are developed, and a shared reference framework is created as the basis for international harmonisation.
Team
Contact us
Law as Code is being pursued as a high-priority initiative at SPRIND. The team presented here represents it externally and sets key developments in motion. We look forward to hearing from you and to your engagement.
Dr. Hakke Hansen, LL.M.
hakke.hansen@sprind.org
LinkedInHead of the
Law as Code
initiative- Hakke leads SPRIND’s
Law as Code
Initiative. - Previously, he spent nearly two decades working as a founder, project developer and consultant on the realisation of disruptive ventures in education, economic development and the digital economy.
- Hakke studied law and economics in Germany, Italy and the United States and completed his doctorate at the Max Planck Institute in the field of the economic analysis of law.
- Hakke leads SPRIND’s
Jörg Resch
joerg.resch@sprind.org
LinkedInInnovation Manager specialising in
The Future of the State
- Jörg supports the
Law as Code
Initiative in its strategic and technological development. - Previously, he led an analyst firm specialising in cybersecurity and digital identity and worked as a founder in deep tech and open-source software development.
- Jörg studied public administration and began his professional career as a civil servant at the Federal Foreign Office.
- Jörg supports the