Short answer
Reliable AI contract review needs more than chunk-and-embed RAG. We parse the document's structure, resolve defined terms and cross-references into a clause-relationship graph, compare each clause against a configurable playbook, and grade deviations with a written rationale. Every decision is logged with source text and confidence so lawyers can verify it, and lawyers stay in the loop for every flag.
Key takeaways
- Naive chunking breaks legal meaning because clauses modify each other across sections.
- Hierarchical parsing plus a clause-relationship graph improves precision.
- A playbook with standard positions, fallbacks and walk-away points turns 'is this clause unusual?' into a checkable question.
- An append-only audit trail with source text and rationale is what makes legal AI defensible.
Legal document review is one of those tasks where AI confidence matters as much as AI capability. Get a clause wrong, and a client might sign away rights they meant to retain.
That constraint shaped every technical decision we made when building our Legal Document Intelligence system. This post covers why the obvious approach fails, what we built instead, how playbook comparison and risk grading work, and how to keep lawyers in control of the output.
What is AI contract review?
AI contract review is software that reads a contract, identifies its clauses, and compares them against the positions your organization accepts, flagging the ones that deviate and explaining why. It doesn't replace legal judgment. It moves the first pass, finding the clauses that need attention, from hours of reading to minutes, so lawyers spend their time on the decisions.
The value depends entirely on two things: whether it finds the issues that matter (recall), and whether lawyers can trust what it flags (precision and traceability).
The Problem With Naive RAG
The first instinct most people have is to chunk the document, embed it, and run similarity search against a playbook. We tried this. The recall was acceptable. The precision wasn't.
The issue: legal meaning is highly context-dependent. A termination clause buried in section 14.3 might directly modify a payment term in section 4.1. Naive chunking severs those relationships.
Contracts break chunk-based retrieval in a few predictable ways:
- Defined terms. "Confidential Information" or "Change of Control" means exactly what Section 1 says it means. A chunk that uses the term without its definition is half a clause.
- Cross-references. "Subject to Section 9.2" or "notwithstanding Clause 14" changes the clause it appears in. Similarity search can't see that link.
- Schedules and exhibits. Payment terms, service levels and liability caps often live in schedules at the back, far from the clause that relies on them.
- Overrides. An order-of-precedence clause can decide which of two conflicting provisions wins.
We go deeper on these retrieval failures in why naive RAG fails for enterprise documents.
What We Built
We use a hierarchical parsing approach. First, we extract the document's structural outline using Unstructured and LlamaParse. Then we build a semantic graph of clause relationships before we do any extraction.
The risk-flagging step compares extracted clauses against a configurable playbook stored in a vector database. But it's not just similarity — we run a secondary classification pass that rates deviation severity (low / medium / high) with a mandatory rationale.
Every AI decision is logged to an append-only audit table. Every clause extraction includes the source text, the confidence score, and the model's reasoning. That audit trail isn't optional — it's what makes the system legally defensible.
How does the review pipeline work, step by step?
Broken into steps, a structure-first review pipeline looks like this:
- Parse the structure. Recover the outline: articles, sections, numbered sub-clauses, schedules and tables. Numbering is data here, because cross-references depend on it.
- Resolve definitions and references. Index every defined term and every "subject to" or "as set out in" reference. These become edges in the clause graph.
- Classify clauses. Label each clause by type: limitation of liability, indemnity, termination, confidentiality, governing law, payment, assignment, and so on.
- Assemble context. For each clause, gather the definitions it uses and the clauses it references or is modified by. This is what the model sees, not an arbitrary chunk.
- Compare against the playbook. Check the clause against the organization's standard position and fallbacks for that clause type.
- Grade and explain. Rate the deviation as low, medium or high, with a written rationale that quotes the source text.
- Send to a lawyer. Flags go to a review screen, not straight into a client memo.
Steps 1, 2 and 4 are mostly deterministic engineering. The model's job is narrower than it looks: classification, comparison and explanation, on context the pipeline has already assembled correctly.
What goes into a contract playbook?
A playbook is your organization's negotiating position, written down per clause type. A useful one has three levels for each clause:
| Clause type | Standard position | Acceptable fallback | Escalate when |
|---|---|---|---|
| Limitation of liability | Cap at fees paid in the prior 12 months | Cap at a fixed multiple of annual fees | Uncapped liability, or a cap that excludes key heads of loss |
| Governing law | Your home jurisdiction | A neutral jurisdiction you've accepted before | Any other jurisdiction |
| Termination for convenience | Mutual, with notice | One-sided in your favour | One-sided against you |
Illustrative example only. Every organization's positions differ, and the playbook should be written by your lawyers.
This structure is what turns "is this clause unusual?" into a question the system can answer and a lawyer can check. It also means legal teams change behaviour by editing the playbook, not by asking engineers to rewrite prompts.
How do lawyers stay in control?
A legal AI system that acts on its own is a liability. It should be designed so the lawyer makes every decision:
- Every flag cites its source. The exact clause text, the section number, and the related clauses that informed the judgment.
- The rationale is mandatory. A severity rating without an explanation should never reach the user.
- Lawyers accept, reject or edit each flag, and their decision is recorded alongside the AI's.
- Redlines are suggestions. The system can draft a redline against the playbook position, but a lawyer decides whether it goes out.
This is the same human-in-the-loop pattern we use for any AI action with real consequences. Our post on AI agent guardrails and human-in-the-loop design covers the general approach.
What should the audit trail record?
At minimum, every extraction and flag needs the source text, the confidence score and the model's reasoning. A complete audit trail also records:
- Where the source text sits in the document
- The clauses and definitions included as context
- The model and prompt version, and the playbook version
- The reviewing lawyer's decision and any edits, with a timestamp
Append-only matters: records are never updated in place, so the log shows what the system said at the time, even after prompts or models change. When someone asks "why was this clause flagged?" six months later, the answer is a lookup, not a reconstruction.
Results
On a lengthy investment agreement, the system surfaced a focused set of clauses for attention in minutes — and the client's legal team validated them as genuine issues worth a closer look. Across our test contracts, the pipeline held up where naive RAG fell down.
That's not magic. That's careful prompt engineering layered on top of a well-designed data pipeline.
How do you measure accuracy?
Legal teams should hold any contract review system to measurable standards:
- Recall on issues: of the clauses lawyers marked as problems, how many did the system flag? Missing a real issue is the costly failure.
- Precision on flags: of the clauses the system flagged, how many were real issues? Too many false alarms and lawyers stop reading the flags.
- Extraction accuracy: were clause boundaries, numbering and defined terms captured correctly?
- Regression testing: re-run the labelled set whenever the model, prompts or playbook change, and compare.
The labelled set comes from lawyers' own review decisions, which the audit trail already captures. Our guide to evaluating LLM applications explains how to build and maintain one.
Where are the limits?
AI contract review works best on contracts with recognizable structure and a clear playbook. Be careful with:
- Poor scans, where OCR errors can garble clause numbering or amounts. These should be flagged for closer review.
- Bespoke or novel deal structures, where there's no playbook position to compare against.
- Jurisdiction-specific interpretation, which needs lawyers who know the governing law.
The system's job is to make sure nothing important is missed and every flag is explained. The judgment stays with the lawyers.
We build systems like this through our RAG and knowledge systems and computer vision and OCR services. See how we approach legal work on our legal industry page, or tell us about your review workflow.
Frequently asked questions
Can AI review contracts accurately?
AI can reliably extract clauses and flag deviations from a playbook when it is built on structured parsing, clause-relationship mapping and human review. It should support lawyers, not replace their judgment.
Why doesn't standard RAG work well for contracts?
Standard RAG splits documents into chunks, which separates clauses that depend on each other, such as a termination clause that changes a payment term. Retrieval then misses the context that determines the clause's meaning.
What is a contract playbook in AI review?
A playbook is your organization's standard positions and acceptable fallbacks for each clause type. The AI compares each extracted clause to it and flags how far the contract deviates.
How do you make legal AI auditable?
Log every extraction and flag with the source text, model reasoning, confidence score and model version in an append-only store, so any output can be traced and checked.
How do you measure the accuracy of AI contract review?
Build a labelled set of contracts where lawyers have marked the clauses and issues, then measure recall (how many real issues were flagged) and precision (how many flags were real issues). Track both every time prompts, models or the playbook change.
Does AI contract review work on scanned contracts?
Yes, but scanned contracts need OCR and layout recovery first, and numbering or tables may come out imperfectly. Low-quality scans should be flagged for closer human review rather than processed with full confidence.
Want to see how we build these systems for clients?
Let's talk →