The Legislator as the First Prompt Engineer
Legal AI hallucination is often a format problem, not a model problem. Structuring meaning into the law itself would make legal AI verifiable against the source.
June 18, 2026 ยท Quantum Nexus Ventures FZCO
Every time a legal AI hallucinates a citation, the default reaction is to blame the model.
The better answer is to blame the format.
Laws are written for humans trained for years in legal hermeneutics. An experienced lawyer reads "for the purposes of this regulation" and automatically activates an interpretive framework built over years in law school, in practice, and across hundreds of cases. They know that phrase delimits the scope of application, that there are exceptions in article 14, that the Supreme Court qualified its reach in 2019.
The AI knows none of that. It infers. And when it infers from legal text, hallucination is just another word for misinterpretation.
The problem is not that the models are bad. It is that we are using 21st-century tools to read documents designed in the 19th century.
How a human reads the law, and how a machine tries to
When a lawyer reads an article, they do not read it alone. They read it with the entire normative pyramid in mind. They know that this regulation derives from that directive, that this directive takes precedence over national law, that this specific article was modified by a transitional provision buried in a different official gazette from three years ago.
An AI has to reconstruct that graph of relationships from statistical patterns. Sometimes it does it well. Sometimes it invents a court that does not exist or cites a decision with the right case number but the wrong ruling. Not because it lies. Because nobody gave it the map.
The proposal: let the legislator tokenize
To tokenize laws here does not mean what an NLP tokenizer does, splitting words into subunits so the model can process them. It means something different: embedding into the norm itself the semantic information that today exists only inside the head of the expert jurist.
Four concrete layers:
First, definition tokens. Every term with a specific technical meaning carries its official definition linked directly, not in a loose glossary at the end but anchored to the body of the article. "Legal person" in civil law is not the same as "legal person" in tax law. The machine does not have to guess. The legislator tells it.
Second, intent tokens. The explanatory memorandum exists in every law but it is written in free text, just as opaque to AI as the articles themselves. If that intent were structured in machine-readable fields (problem being solved, affected party, anticipated exception), the AI would not need to infer the "why" of the norm. It would read it directly.
Third, hierarchy tokens. Which superior norm grounds this article, which norm it repeals, which exception overrides which general rule. This is the Kelsenian pyramid converted into a structured graph. Today AI reconstructs that graph with probabilities. With tokens it would be deterministic.
Fourth, living interpretation tokens. When the Supreme Court or Constitutional Court establishes doctrine on a specific article, that interpretation could be annotated directly onto the text of the law, updated in real time. The norm and its judicial interpretation, synchronized.
The obvious objection
"Laws are made by jurists, not prompt engineers."
True. But the jurists who drafted the first codes in the 19th century were not printers either, and yet they adopted the printing format because it was the distribution system of the era.
The distribution system for law in the 21st century is AI. The jurists who understand that before everyone else will be the ones who shape how law is interpreted for the coming decades.
This is not about legislators learning to code. It is about the systems surrounding legislative production adopting semantic structuring standards the same way they adopted HTML when the web arrived.
What already exists and why it is not enough
Akoma Ntoso is an XML standard for legislative documents used by several African legislatures and the European Parliament. EUR-Lex structures European regulations with hierarchy metadata. ELI (European Legislation Identifier) gives persistent URIs to norms.Sources: Akoma Ntoso ยท EUR-Lex ยท ELI
These are skeletons. They are publication formats, not meaning formats. They tell you that an article is an article, that a section belongs to a chapter. They do not tell you what "consequential damages" means in the specific context of that article, nor how it relates to Supreme Court doctrine over the past five years.
The proposal here sits one level above: not structuring the container (the norm as document) but the content (the norm as meaning).
The change nobody is asking for but that is coming
Right now, legal AI models โ including ours at Nexus Legal, covering 63 jurisdictions โ compensate for the absence of semantic structure with retrieval, reranking, cross-verification, and citation-fidelity verification systems. They work. But they are engineering compensations for a problem that has a legislative solution.
Imagine a world where the GDPR carries directly annotated the exact concept of "personal data" it handles, which EU directive it implements, which most recent supervisory authority ruling has modulated the interpretation of article 6(1)(f), and which CJEU cases apply. Not as a PDF with margin notes. As structured metadata any system can read and use.
That world makes legal AI go from "probably correct" to "verifiable against the source."
Parliaments that adopt this practice first will produce law that AI can interpret correctly without effort. Those that do not will keep watching their norms generate hallucinations, misinterpretations, and unnecessary litigation. Not because AI is bad, but because the legislative format is opaque.
The legislator as the first prompt engineer. Not a metaphor. A technical description of what is coming.
This is an opinion / thought-leadership piece. It is not legal or financial advice.
More insights
July 4, 2026
The Epistemic Bottleneck: Why AI Gives Engineers 10X and Lawyers 3XJune 29, 2026
AI Regulation Around the World: Where the Frameworks Converge, Where They Diverge, and What It Means for Global OperatorsJune 29, 2026
Deploying Legal AI in India: What the Law Requires, What the Government Wants, and What the Data Actually Looks Like