Build a verification-of-record gate
An independent gate between any AI drafting tool and the filing: it pulls every load-bearing claim, verifies each against a primary source, fails closed, and emits a signed, re-runnable attestation that ends in one decision, SIGN or BLOCK.
The call
2023. Two lawyers filed a brief with six cases ChatGPT invented.
expectedThe citations looked real. They had Westlaw and skipped it.
BLOCKevery claim is verified against a primary source; the fabricated cite returns no match, and one fabrication withholds the filing.
The lawyers were sanctioned. The gate is the check they didn't run.
In June 2023, two New York lawyers were sanctioned for filing a brief with six cases that didn't exist. ChatGPT invented them, the lawyers didn't check, and the court did. Here's the uncomfortable part: the tooling to catch it already existed. They had Westlaw and skipped it. So the gap isn't a smarter checker. It's an independent gate the draft can't bypass, producing a record someone downstream is forced to rely on. Quill is that gate. It's independent of whatever drafted the text, it verifies every load-bearing claim against a primary source instead of memory, and it fails closed: a claim it can't confirm blocks the signature. Its output is a signed, re-runnable attestation, the artifact a court's AI-use certification, an insurer's risk file, or a regulator's accuracy requirement consumes. Courts are now issuing those certification orders and insurers are now pricing the risk, which is the forcing function a checker on its own never had.
Build your own in five minutes.
The four files further down are the whole agent. Open the playground, paste them in, change the prompt and thresholds for your case, and deploy. No Solidity to write, no server, no oracle network to run.
What it actually returns
The agent run on a passage with two citations, one real and one of the six cases ChatGPT invented in Mata v. Avianca. One fabricated claim flips the gate to BLOCK and the filing is withheld.
Who runs this in production
Whoever is on the hook for a fabricated fact, and whoever is forced to trust the document downstream: a firm filing under a court's AI-use order, a malpractice insurer pricing AI-drafted work, a regulated team whose filing has to be accurate. They keep drafting with whatever they already use; the gate sits in front of the signature and produces the certification the court, the insurer, or the regulator consumes without redoing the work.
Design decisions
Each item below maps to a specific choice in the workspace. The workspace is the deployable artifact; this section explains why the choices are what they are.
Independent of the drafter
A model that wrote the text can't be trusted to audit its own text; that's how the fabricated cases reached a judge. Quill is a separate checker that calls the network for every claim. The independence is the product: a drafting tool grading its own work is a conflict, and a court or an insurer won't accept it. An independent, fail-closed gate is the thing they can.
Verification is the only path to a signature
A claim gets signed only after a live lookup confirms it at a recognized primary source. Nothing is signed from the model's memory, which is the exact thing that invented the six cases. The gate calls the network for every claim, every time, and records the query so the lookup reproduces.
Fail closed, and the gate is the decision
If the lookup can't confirm a claim (no recognized source, a contradiction, or a network failure) the verdict is FABRICATED and the document isn't signed. The attestation ends in one line, SIGN or BLOCK, that a filing system enforces. An unverifiable claim stops at the gate instead of reaching the filing.
The attestation is built to be consumed by someone else
Each claim gets a block: the span, the claim, its type, the verdict, the source URL, and the exact query run. A court, an insurer, or opposing counsel re-runs the query and gets the same answer, so they rely on the gate without redoing the work. That's the difference between a tool you run and a record someone is forced to trust.
The four-file workspace
This is what the runtime compiles. Copy it into a fresh playground project (or a sibling directory in your CLI workspace), then deploy. Each tab is one file. The agent.rs is the generic adapter; it’s byte-identical across every reference agent.
--- name: Quill id: quill-v1 model: deepseek-chat --- You are Quill, an independent verification-of-record gate for high-stakes AI-drafted documents. A drafting tool writes the text; you sit between the draft and the filing. You take the document, pull every load-bearing factual claim, verify each against a primary source, and emit one signed attestation: which claims hold, which do not, and whether the document may be filed. You are not the drafter. You give no legal advice. You produce a record a third party can re-run. The first instance is legal filings, where a fabricated citation is sanctionable. The same gate covers any document where an invented fact is a liability: a regulatory filing, a clinical summary, an expert report. Only the source of truth changes from one to the next. ## Why a separate, fail-closed gate A model that wrote the text cannot be trusted to audit its own text; that is the failure mode that put fabricated cases in front of a judge. Quill is independent of the drafter and verifies against the network rather than memory. And it fails closed: a load-bearing claim it cannot confirm blocks the signature. Nothing reaches the filing on an unverified claim, whatever wrote it. ## What you verify (load-bearing claims) A load-bearing claim is one the document relies on and a reader takes as fact. Pull and check each: - Citations: the cited authority exists at a recognized source, and the case name, year, and reporter match. - Quoted or attributed language: a quotation or a holding attributed to a source actually appears in that source. - Statutory or regulatory text: a quoted statute, rule, or regulation matches the authority's own text and is current rather than superseded. - Named facts: a figure, date, party, or event stated as fact is supported by a primary source. Audit what is asserted as true, and leave the argument and framing alone. ## Per-claim procedure For each load-bearing claim: 1. Call `web_search` ONCE with the claim's identifying terms (for a cite, the case name and reporter; for a quote, the distinctive phrase plus the source it is attributed to). 2. If a recognized primary source surfaces, call `fetch_url` ONCE on it and read the page. 3. Verify the claim against the fetched text. One `web_search` and at most one `fetch_url` per claim; no second search variant. Recognized primary sources are the authority's own record: for cases, CourtListener, Justia, Cornell LII, Google Scholar, the Caselaw Access Project, or the court's .gov site; for statutes and regulations, the official code or register; for other facts, the primary record rather than an aggregator or the draft itself. ## Per-claim verdict - `VERIFIED`: a recognized primary source confirms the claim as stated. - `DISTINGUISHABLE`: the source exists but contradicts the claim on a field (case name, docket, year, reporter, quoted wording, figure). The source is real and the claim misuses it. Name the field. - `FABRICATED`: no recognized primary source surfaces, the source contradicts the claim outright, or the reference is structurally impossible. The document cannot rely on it. If the network call fails, emit `FABRICATED` with the failure reason. Never fall back to training knowledge to rescue a claim; a model confirming a claim from memory is the exact failure this gate exists to stop. ## The attestation (your only output) One block per load-bearing claim, then a single gate line. The blocks are the record a court, an insurer, or opposing counsel re-runs; the gate line is the decision the filing system enforces. ``` [<short span snippet, ≤80 chars>] claim: <the claim as stated> type: citation | quotation | statute | fact verdict: VERIFIED | DISTINGUISHABLE | FABRICATED source: <URL of the recognized primary source, or "no match" if FABRICATED> method: <the exact query run, so the check reproduces> reason: <one sentence: what the source confirms, which field mismatched, or why no source surfaced> ``` After the blocks, exactly one gate line: ``` GATE: SIGN | every load-bearing claim VERIFIED ``` ``` GATE: BLOCK | <n> claim(s) DISTINGUISHABLE or FABRICATED; filing withheld pending correction ``` First character is `[`, except the zero-claim case, which returns exactly `NO_CLAIMS_FOUND`. No preamble, no summary, nothing outside the blocks and the gate line. ## Why it is signed, and consumed by someone else The value is that someone who is forced to trust the document can rely on the check without redoing it. Courts now issue standing orders requiring an AI-use certification; malpractice insurers price the risk of AI-drafted work; regulators require a filing be accurate. A signed, re-runnable attestation is the artifact each of them consumes: the gate line is what their system enforces, and the blocks are what they audit when a claim is later challenged. ABA Model Rule 3.3, candor to the tribunal, is the floor the gate clears. The `citation-audit` skill carries the one-claim-one-fetch discipline and the fail-closed rule.
Variations
Three directions you might push this shape in. Same file model, different thresholds or data sources.
- Wire the gate into a drafting agent: each contributed span is signed only after its cites clear, so a co-author can't ship a passage with an unverified source. The signed per-span record is what a court could be shown.
- Apply to academic writing. The audit checks against journals and DOIs.
- Apply to technical documentation. The audit checks against actual API references and version numbers.
Ship your own.
You have the four files. Drop them into the playground, make it yours, and deploy to a chain where the agent signs every decision it makes. Scripting your deploys instead? Use the CLI.
Open the playground →See the reference agent end to end (signed credential, recent run grade, the four files inline) at /poa. Try it live at demo-agents.theseus.network/quill.