THE SOURCE CODE
OF LAW

AI × LAW × SOCIETYOPEN ACCESS

The source code
of law.

AI agents rewrite and red-team
30,000 articles of French law.

Can AI turn a political programme into a coherent, auditable body of law? An open experiment across five major French codes explores what happens when legislation becomes a system we can inspect, revise and test.

Alexandre Masmejean · Nathalie Gouailhardou · Kevin Primicerio

Working paper · Revised 10 November 2026

30,317

articles in the source corpus

5

major French legal codes

1,264

articles in the fresh paired audits

01 / THE STUDY

From political intent
to inspectable law.

Starting with 30,317 articles from France’s official LEGI database, AI agents drafted proposals, checked coherence across the full corpus, and subjected the results to a separate adversarial review. The method separates policy objectives from the machinery used to rewrite and check the law.

This independent case study uses reforms inspired by David Lisnard’s 2027 programme. It was not commissioned or endorsed by him or his movement. The pipeline is intended to be adaptable to other programmes.

THE CENTRAL FINDING

On the same randomly drawn articles, blind AI audits found gross defects in 3.5% of rewritten texts, versus 7.5% of existing law.

Reported reduction: 54% (95% CI: 40–64%). The measure mainly tests coherence, not constitutional or EU-law compliance or the merits of the reforms. Drafting and evaluation were AI-led; no lawyer has validated the results.

THE METHOD

01

Specify

Specify policy objectives

02

Rewrite

Draft and justify proposals

03

Red-team

Look for contradictions

04

Audit

Measure defects in blind audits

02 / READ & DOWNLOAD

One paper. Two languages.

Read either edition, or download the combined English–French manuscript.

Source manuscript and reproducibility materials on GitHub

SUPPORT THE PUBLICATION

Endorse alexmasmej
on arXiv.

cs.CY / Computers and Society

We are seeking endorsement for Alexandre Masmejean to submit to cs.CY (Computers and Society). If you are an eligible arXiv endorser in this area, please review the paper and consider the request.

Open endorsement request
Endorsement code: O4ML3D

Endorsement supports author eligibility; it is not peer review or acceptance of the paper. How arXiv endorsement works ↗