Saturday edition · 7 November 2026 · No. 311One considered edition. No endless feed.

Law That Software Can Check: The Code Exists, the Legal Force Does Not

If code had legal force, an error in it would become an error in the law, applied instantly and identically to everyone.

14 October 2026·13 min read·A possibility, not a prediction

Researched by an agentic pipeline. Reviewed and approved by the editor before publication.

At a glance
Kind of pieceA thought experiment
Builds onNo existing use case
Evidence qualityModerate

The problem

In 2022, federal regulation in the United States cost firms with fewer than 50 employees an estimated $14,700 per employee per year, against $12,200 in firms with 100 or more employees (estimated and partly modelled, October 2023; study commissioned by an industry association)1. The same study puts the total cost of federal regulation at $3.079 trillion in 2022 and does not address regulatory benefits1. The method is contestable, but the direction matters: the fixed cost of understanding a rule falls hardest on firms that cannot spread it over many employees.

The European Commission has set a target of cutting the administrative burden by 25% for businesses and 35% for small and medium-sized enterprises by the end of its current mandate, which it translates into €37.5 billion in reduced administrative costs (Commission target, stated 2025)2. That is a goal, not a measured result.

Part of that cost is interpretation. Today a rule is published as text, and then every firm, software vendor and public agency reads it separately and turns it into its own checklist or code. The OECD describes this process as "linear and siloed", with lawyers and developers acting as intermediaries whose separate translations "can create inconsistencies or errors" (2020)3. A small firm pays twice: once for advice to understand the rule, and again for the risk of having understood it differently from the regulator.

The idea explored here. Laws, or parts of laws, would be published in a form that software can run, and that form would carry legal force: a firm that followed the official code with accurate facts would be treated as having followed the law.

What already works

Coded rules published alongside the text

New Zealand. In 2018 a team of business-rules specialists, analysts, legislative drafters, service designers, policy specialists and software developers spent three weeks trying to code two laws, the Rates Rebate Act and the Holidays Act3. Its main finding was that "it is difficult to produce machine-consumable rules if the policy and legislation has not been developed with this outcome in mind"3. The approach became a work stream inside the Ministry of Business, Innovation and Employment3.

New South Wales. The state government created a digital version of its Community Gaming Regulation 2020, which sets the conditions for lotteries, bingo and trade promotions run by charities, not-for-profits and businesses. It published "machine readable rules in tandem with the human readable regulation", made them available through an application programming interface (a standard way for other software to query them), and put a questionnaire in front of them that tells an organisation whether its game is permitted and whether it needs an authority (operator-reported, date not shown)8. The government expects compliance cost savings for organisations running several hundred games a year but publishes no measured figure8. The page does not say that the coded version has legal force.

France. The OECD lists OpenFisca, an open-source platform that models tax and benefit rules, and public services built on coded rules among France's efforts3.

Digital-ready drafting

Denmark's Parliament decided unanimously in January 2018 that new legislation should be digital-ready6. Assessing whether a bill is digital-ready is now mandatory4, against seven principles that include simple and clear rules, the possibility of automated processing, and uniform concepts and reuse of data across authorities5. A first report on the ministries' work found significant progress on the principles but room to improve in describing the IT costs of implementing new laws (March 2020)6. An EU-funded project with the OECD records that over 800 laws and 340 proposals had been screened, while legislation from before 2018 "remains largely unreviewed"; ministries then launched a five-year programme to revise it (official, count undated)7.

Denmark shows that drafting can change. It does not make code the law: the text remains the law, written so that it is easier to automate.

Languages built for law

Catala is a programming language designed for "a straightforward and systematic translation of statutory law into an executable implementation", with each paragraph of law placed next to its code (peer-reviewed, 2021)9. Its authors tested it on part of the US federal income tax and on French family benefits, and report uncovering an error in an existing implementation of the French benefits9. A testing tool built for Catala later generated 186,390 tests for an implementation of French housing benefits running to 19,655 lines, in under seven hours of computing time (preprint, 2024)10.

In plain terms, law can be coded at a real scale and checked automatically by machine. That is not the same as a government giving such code legal force.

What does not exist

No case was found in which a legislature enacted a coded version of a law as legally binding, either alongside the text or in its place. The OECD noted in 2020 that "there remain unresolved questions about the legal status of machine-consumable laws, how versions should be governed and how errors in the coded form of rules could be identified and corrected"3. In 2026 the OECD opened a public consultation on "a shared international reference framework for Law as Code", which it defines as "the transformation of enacted laws into machine-executable formats"14. That definition starts from enacted text; it does not give code its own legal force.

What would have to be invented, then, is not the code. It is the legal status of the code.

The possibility

One way this could work: a legislature passes a law in two linked forms, the text and an official coded version, drafted together by lawyers, policy officials and developers. The coded version would be published through a public interface. A small firm's accounting or payroll software would query it directly: given these facts about the business, is this activity allowed, what must be reported, what is owed. If the firm acted on the official answer with accurate inputs, it would be protected from penalty, much as some systems already protect those who act on a binding official ruling. If text and code diverged, the law would say in advance which one prevails and who bears the cost of the error.

“What would have to be invented, then, is not the code. It is the legal status of the code.”

The role of AI. The core of this idea is not AI. The official coded rules would need to be ordinary deterministic software: the same inputs give the same answer every time, and every step traces back to a paragraph of law. Generative AI does not guarantee either property. AI could help in three places around that core. As a drafting assistant, it could propose a first translation of text into code for human experts to correct. As an interface, it could help a business owner describe their situation in plain language and turn it into the structured facts the code needs. As a checker, it could search for gaps and contradictions between text and code. In each case the legal answer would come from the coded rule, not from the AI.

Most of the remaining work is not AI at all: changing how laws are drafted and enacted, publishing and versioning the code, building the interface, training drafters, and creating a route to appeal.

What would have to be true

  1. The law would have to say what the code is. A legislature would need to state whether the coded version binds, which version prevails when text and code disagree, and from what date. The OECD flagged legal status, version control and error correction as unresolved3.
  2. The rules would have to be codable. Coding suits rules with clear conditions and thresholds. Rules that rest on judgement resist it; Denmark's own approach allows its principles to be set aside where considerations such as the best interests of the child arise4.
  3. Drafting would have to change, not just translation. New Zealand's team found that rules not written with coding in mind are hard to code3, and Denmark's older law lags far behind its new law7.
  4. AI-assisted translation would have to stay under human control. In tests on US food assistance and health coverage rules, a large language model extracting rules without retrieval of the policy documents achieved 0% accuracy on numerical rules such as income and asset limits, while rules that vary less between states, such as citizenship, reached 100%; a simple prompt asking for code "generated unusable code" (measured without a control group, March 2025)11. In plain terms, the model got the easy rules right and the costly ones wrong. The researchers concluded that such models "still require external knowledge and human oversight within an iterative process for any policies containing complex logic"11.
  5. Someone would have to own the errors. The OECD's principles call for government to be accountable "for the coded rules if errors are made", with mechanisms "that allow the coded version to be corrected and/or appealed"3.
  6. Business rules, not only benefits, would have to be coded. Most examples found cover tax, benefits and individual entitlements; the New South Wales gaming regulation is one of the few aimed at business compliance8.

What could stop it

What the evidence shows

Automated rules can go wrong at scale. Australia's Royal Commission into the Robodebt Scheme, reporting on 7 July 2023, found that the scheme, which relied heavily on "income averaging" to raise welfare debts, produced inaccurate results and did not comply with the income calculation provisions of the Social Security Act13. In 2020, after a class action settlement, debts raised wholly or partly through averaging were reduced to zero13. Robodebt was not rules as code: it was an automated process without a sound legal basis.

Coding can reshape the law itself. A 2024 legal analysis of Denmark's reform argues that legislation made "ready and 'pre-cooked'" for digital solutions may reduce "the flexibility and adaptive quality of regulatory templates that are crucial to the rule of law", producing a simpler legal geometry that "does not fully accommodate the diversity of citizens and enterprises" (peer-reviewed)12.

The advocates are cautious. The OECD's 2020 work called rules as code "an early stage concept with much to test", with "no known large-scale approaches currently embedded in and across governments"3.

Code is a second text that can be wrong. Catala's authors found an error in an existing implementation of French benefits rules9.

Reasoning

If code had legal force, an error in it would become an error in the law, applied instantly and identically to everyone. The uniformity that makes code attractive would then become the risk. The people most exposed would be those whose situations the coders did not anticipate, which is the concern raised about Denmark's simplified legal geometry12. Robodebt shows what happens when an automated process and the law part ways and nobody is accountable for the gap13.

Incentives cut against the idea too. A government that gives code legal force takes on liability for every bug. Compliance software vendors and advisers sell interpretation; a free, official, binding interface would compete with them, and they might argue for keeping it advisory. Legislators may resist drafting constraints that limit political compromise, which often relies on deliberately open wording.

Simpler options exist. Plain-language guidance, safe harbours for firms acting in good faith on official guidance, and binding advance rulings already reduce uncertainty without changing what the law is. For many small firms, fewer and simpler rules, the European Commission's stated aim2, might cut more cost than coding the existing ones.

The most defensible version of the idea may therefore be narrow: legal force for coded versions of a small set of rules that are already numerical and stable, such as thresholds, rates and eligibility tests, with the text prevailing everywhere else.

Signs to watch

  • The outcome of the OECD consultation on a shared reference framework for law as code, and whether the final framework addresses the legal status of coded law14.
  • Progress reports from Denmark's five-year programme to revise legislation passed before 20187.
  • Any legislature that enacts a coded rule with stated legal force, or a statute that states which version prevails when text and code disagree.
  • Further New South Wales regulations published as machine-readable rules, and any published measurement of compliance cost savings8.
  • Published evaluations of AI-assisted translation of law into code that compare error rates on numerical rules with those of human coders.
  • The European Commission's annual reports on progress towards its 25% and 35% burden-reduction targets2.
Sources
  1. Crain and Crain, The Cost of Federal Regulation to the U.S. Economy, Manufacturing and Small Business National Association of Manufacturers (commissioning body) · October 2023
  2. Simplification, implementation and enforcement European Commission · date not shown
  3. Cracking the Code: Rulemaking for Humans and Machines OECD Observatory of Public Sector Innovation · 12 October 2020
  4. What is digital-ready legislation Danish Agency for Digital Government · date not shown
  5. Guidances and tools Danish Agency for Digital Government · date not shown
  6. Report: Improved focus on the digital impacts of new legislation Danish Agency for Digital Government · 18 March 2020
  7. Development of a framework and methodology to revise the digital readiness of existing Danish legislation European Commission, Reform Support · date not shown
  8. An Australian first: NSW translating rules as code to make compliance easy Digital NSW (operator-reported) · date not shown
  9. Merigoux, Chataing and Protzenko, Catala: A Programming Language for the Law Proceedings of the ACM on Programming Languages · 2021
  10. Goutagny, Fromherz and Monat, CUTECat: Concolic Execution for Computational Law arXiv (preprint) · October 2024
  11. AI-Powered Rules as Code: Experiments with Public Benefits Policy Georgetown University Beeck Center, Digital Benefits Network and Massive Data Institute · 24 March 2025
  12. Gøtze, Danish Digital Design and the Gradual Erosion of Technology Neutral Administrative Law Central European Public Administration Review · 27 November 2024
  13. Report Royal Commission into the Robodebt Scheme · 7 July 2023
  14. Consultation on the digital provision of law: Towards a shared reference framework for law as code OECD · date not shown
More from The Fringe

See what is already in use in Legal Services →

All of The Fringe →