Separate the words from the file
A legal document has two very different kinds of content: the semantic body — the argument, the facts, the requested relief — and the presentation — margins, fonts, caption tables, numbering, signature blocks. Collapsing both into one model request is why AI-generated documents look almost right and behave unpredictably.
What is the reliable pattern?
The model drafts clean Markdown — just the legal body, reviewable at a glance. Deterministic code then builds the final document from that draft plus a metadata-only manifest: it applies the approved template, the correct fonts, the caption table, the numbering, and the filename. The same draft, built twice, produces the same file. The model never touches layout.
Why determinism matters in a court file
A hallucinated citation is the famous failure, but silent formatting drift is the common one: a heading that renumbers, a party name that shifts, a template that subtly changes between drafts. When assembly is deterministic, those classes of error simply cannot occur — the build is a repeatable function, not a fresh act of generation each time.
Automation means the machine does the assembly and the first draft; your lawyers do the judgment, every time. The system is built to make professional review faster, not optional.
The build is a handoff, not a black box
Because the draft is plain Markdown and the build is metadata-driven, every stage is inspectable. You can read the draft before it becomes a document. You can see which template and fields produced the file. And you can validate the finished artifact against a known-good baseline — checking that required sections are present, numbering is continuous, placeholders are gone, and the approved template was used — before anyone reviews the substance.
States that must never be collapsed
A file sitting in a folder named “final” is not the same as an approved document. The pipeline keeps these states distinct: produced (the file exists), validated (automated structural checks passed), reviewed (a lawyer read it), approved (an authorized person accepted it), and delivered (it was actually filed or sent). Treating a green validation light as professional sign-off is exactly the error the architecture is designed to prevent.
This article is general information from a technology consultancy, not legal advice, and does not create an attorney-client relationship. Figures describing the founder’s own practice are illustrative, not a promise of results.