DEV Community

CourtGPT
CourtGPT

Posted on

A Hallucination Defense Standard for Legal AI

Every legal-AI product on the market in 2026 will, at some point, produce a hallucination. This is not a controversial claim — it's the well-documented nature of large language models. The question for legal practitioners isn't whether hallucinations happen. The question is what vendors and users do about them.

This piece proposes a "hallucination defense" standard — a checklist of what a serious legal-AI product should do to minimize the probability and impact of hallucinations, and what a practitioner should look for when evaluating a vendor.

The taxonomy of hallucinations in legal AI

Not all hallucinations are equal. A useful framework distinguishes four categories:

Type 1: Citation fabrication. The AI produces a citation to a source that doesn't exist — a statute section that was never enacted, a case that was never published, a court rule that was renumbered.

Type 2: Citation drift. The AI cites a real source but attaches paraphrased language that subtly changes the meaning. The statute says "X is permitted if Y." The AI's response says "X is permitted."

Type 3: Factual hallucination. The AI produces a factual claim about the law (e.g., "the statute of limitations is two years") that is incorrect.

Type 4: Reasoning hallucination. The AI produces reasoning that, while superficially logical, draws conclusions not supported by the cited sources.

Each type requires different mitigations.

Hallucination defense #1: Constrained generation

The most effective defense against citation fabrication is constrained generation — architecting the system so it cannot produce a citation that isn't in its source layer.

How it works:

  1. The user's question triggers retrieval from a primary-source database.
  2. The retrieved sources are injected into the prompt as the only allowed grounds for claims.
  3. The model is instructed: "Use ONLY the following sources. If the question cannot be answered from these sources, say so explicitly."
  4. A post-processing layer verifies every citation reference in the output maps to a retrieved source. Any ungrounded claim is rejected before the response reaches the user.

Constrained generation is not foolproof. The model can still produce a Type 4 reasoning hallucination (drawing a conclusion that the sources don't support). But it does structurally prevent Type 1 and substantially reduce Type 2.

Hallucination defense #2: Citation graph

A citation graph maps every paragraph in every source to its canonical citation form and connects related authorities.

This defense addresses Type 2 (citation drift). When the model retrieves a statute, the citation graph returns:

  • The canonical citation (e.g., "Cal. Penal Code § 187")
  • The verbatim text of the statute
  • The effective date
  • A persistent identifier that the response can cite

Because the response carries the canonical citation forward into its answer, the practitioner sees exactly what was retrieved. Drift becomes visible because the cited text is shown verbatim next to the response.

Hallucination defense #3: Effective-date tracking

Statutes get amended. A citation to "Cal. Penal Code § 187" without a date is a citation to an unknown version.

Effective-date tracking addresses this by carrying the effective date of every source into the response. The practitioner sees "Cal. Penal Code § 187 (effective 2024-01-01)" rather than just "Cal. Penal Code § 187."

This defense reduces the probability of using stale authority.

Hallucination defense #4: Audit interface

The audit interface is what makes the other defenses verifiable. Every response exposes:

  • The list of sources retrieved
  • The list of claims made
  • The list of citations attached
  • A click on any citation shows the verbatim source

A senior partner who asks "where did this come from?" should be able to answer in one click. That's the audit interface.

This defense addresses all four hallucination types by making them visible.

Hallucination defense #5: Practitioner-side verification

Vendor-side defenses aren't sufficient. Practitioner-side verification is essential.

The practitioner should:

  • Verify every citation before relying on it. Click through. Read the excerpt. Confirm the effective date.
  • Document verification when AI-generated language is used in client work.
  • Report hallucinations to the vendor.
  • Choose tools that meet the standard.

What vendors should publish

Every legal-AI vendor should publish a hallucination-defense statement that includes:

  1. Architecture. What hallucination defenses does the system use?
  2. Hallucination rate. What's the observed rate of citation fabrication in production?
  3. Audit interface. What's the practitioner-facing interface for verifying responses?
  4. Amendment tracking. How does the system handle statute amendments?
  5. Failure disclosure. What happens when a hallucination is detected?

A vendor that can't or won't publish these details is one to avoid.

What bar associations should consider

Bar associations have a unique role in setting standards. They could accelerate hallucination-defense adoption by:

  1. Issuing guidance on what practitioners should expect from legal-AI tools.
  2. Including hallucination defense in CLE.
  3. Publishing model guidance that practitioners can use when selecting tools.

Closing

Hallucinations are a feature of LLMs, not a bug to be patched away. The defense is architectural — the system is built so hallucinations are structurally prevented or made visible.

Practitioners should demand hallucination defense from every legal-AI tool they evaluate. Vendors who can't meet the standard aren't ready for production legal work.

CourtGPT is built around hallucination defense as a core architectural constraint.


CourtGPT is built by Talking Machines LLC, a San Diego, CA-based legal-AI team. Live product at app.courtgpt.ai. Architecture inquiries: hello@courtgpt.ai.

Top comments (0)