ironclad logo

How Ironclad’s Legal Team Got AI Extraction Prompts to 100% Accuracy—and What Stopped Two from Getting There

Graphic with the text Ironclad Blueprints and EDITION 06 on a blue background featuring custom AI properties, geometric shapes, and an abstract logo.

The ability to systematically test and refine our prompts—rather than guess at them—meant we could actually trust the results. That’s the difference between a proof of concept and something you can deploy across your full repository.”

ELIE MALKOUNcontracts administrator, IronclaD LEGAL

The challenge

Ironclad’s standard AI metadata extraction surfaces the fields most contracts share: parties, effective dates, contract types, governing law. But our legal team needed more. We needed to know, across hundreds of active customer contracts, things like:

  • Does this Order Form include a renewal price lock cap, and if so, what’s the ceiling?
  • Is there a termination-for-convenience right, or is the subscription non-cancellable?
  • Which DPA subprocessor notice method applies: email, physical mail, or a customer portal?
  • Does this contract contain negotiated restrictions on how Ironclad may use Customer Data for AI or benchmarking purposes?

These aren’t fields that exist in a standard contract schema but rather nuanced, company-specific properties that live in different sections of different document types: sometimes in a negotiated Enterprise Services Agreement, sometimes in the Special Terms of an Order Form, and sometimes nowhere at all (which itself is the answer). Manual review across the full repository wasn’t realistic. We needed the AI to do the work.

The question was whether we could build prompts precise enough to actually trust the output.

The approach

We built our custom properties using Ironclad’s Customize AI Detection feature (RunAI), which lets teams define a property, write an extraction prompt, and supply training examples drawn from real contracts. We ran two separate workstreams:

Workstream I covered 10 Sales contract properties: Price Lock Percent, Publicity, Automatic Renewal, Insurance Requirement, Termination for Convenience, Total Liability Cap, Special Claims Liability Cap, DPA Designated POC, DPA Subprocessor Notice Period, and DPA Subprocessor Notice Method. Testing was conducted across 30 contracts over two rounds (15 per round), drawn from a diverse mix of Order Forms, Enterprise Services Agreements (ESAs), and Data Processing Addendums (DPAs).

Workstream II covered 3 customer data restriction properties: AI Use Restriction (Customer Data), Benchmarking & Product Development Restriction, and Data Access Restrictions. Each property was paired with a Custom AI Clause trained on attorney-validated contract language, with the attorney’s review serving as the ground truth for all test results.

In both workstreams, the methodology was the same: build the first version of each prompt with as many real contract examples as possible, run a controlled test, analyze every failure by root cause, refine the prompt, and test again. The lessons from these two workstreams have since informed a broader library of 24 custom properties across various metadata.

The results

Workstream I saw overall accuracy improve from 63% in Round 1 to 85% in Round 2. Six of the ten properties reached 100% accuracy by Round 2, including Insurance Requirement (up from 53%), DPA Designated POC (up from 33% — the largest single-round gain), and DPA Subprocessor Notice Period and Method. Two properties — Price Lock Percent and Publicity — remained at 33%, both affected by a persistent RunAI output format detection issue.

PropertyRound 1Round 2
Automatic Renewal100%100%
Insurance Requirement53%100%
Termination for Convenience87%100%
DPA Designated POC33%100%
DPA Subprocessor Notice Period73%100%
DPA Subprocessor Notice Method87%100%
Total Liability Cap93%93%
Special Claims Liability Cap93%93%
Price Lock Percent0%33%
Publicity7%33%

Workstream II produced 100% accuracy on AI Use Restriction (Customer Data) across all 13 attorney-validated contracts on the first controlled run. Benchmarking & Product Development Restriction achieved 100% accuracy on 9/9 active records after a single round of refinement. Data Access Restrictions reached 91% accuracy (49/54 records), with the 5 remaining misses traced to document indexing gaps, not detection failures. All 13 properties are ready for full repository deployment.

PropertyRound 1Round 2
AI Use Restriction (Customer Data)100%
Benchmarking & Product Development Restriction78%100%
Data Access Restrictions86%91%

What made the difference

Five lessons closed the gap between first-draft prompts and production-ready ones.

1. Output format must be locked explicitly. If the prompt does not restrict outputs to a defined value set, the AI will invent its own. For booleans, the AI would return a mix of “True”/”False” and “Yes”/”No” across contracts: same underlying logic, inconsistent output. The fix was to state the only acceptable values and explicitly prohibit everything else: “Never return ‘Yes,’ ‘No,’ ‘N/A,’ or any value other than ‘True’ or ‘False.’”

For Price Lock Percent and Publicity, Round 2 surfaced a detection pattern where RunAI returned numeric and mixed-format outputs rather than TRUE/FALSE, even with explicit output constraints in place. Rather than advancing with an unresolved behavior, both properties have been set aside for dedicated investigation.

2. Default logic must be stated, not implied. When no relevant clause is found, the AI defaults to N/A or null unless the prompt says otherwise. For fields where a contractual default applies (Ironclad’s standard DPA defaults to a 30-day subprocessor notice period; standard ESA defaults to 1x ARR for the general liability cap), the prompt needs to say so explicitly.

“Return ’30 days’ as the default in any of the following scenarios: the Order Form incorporates Ironclad’s standard ESA by reference and no negotiated DPA is attached; the Order Form references a previously negotiated ESA but no modified DPA is attached to the current document…”

This kind of enumerated default logic eliminated a whole class of failures that weren’t about detection at all. The AI found nothing because nothing was there, and then returned the wrong value.

3. Use section headings, not section numbers. Prompts that hardcode a specific section number (e.g., “look in Section 10.4”) will fail on contracts where the same content appears under a different number. Section headings are far more reliable identifiers across a diverse contract sample. From the DPA Subprocessor Notice Method prompt: “ESA ‘Notices’ section — identified by a section heading that begins with or is titled ‘Notices,’ regardless of section number.”

4. Build in tiered fallback logic for complex properties. The DPA Designated POC property went from 33% to 100% accuracy in a single round by replacing a flat extraction instruction with a three-tier search hierarchy: (1) DPA Section 9 Designated POC → (2) ESA Notices section → (3) Legal Notice Email field in the Order Form. Each tier had explicit handling rules, including a placeholder/dummy email exclusion. That structure — search here first, then here, then here — closely mirrors how a human reviewer would actually navigate the document, and the AI follows it reliably.

5. Real contract examples are non-negotiable. The most effective improvements came from uploading actual contract language and mapping it to the correct expected output, then incorporating that language into the “Look for language such as” and “Do not extract” sections. Generic descriptions of what to find produce generic results. Specific language from real contracts produces specific, accurate extraction.

A few practical notes

Character limits are real. Ironclad’s Customize AI Detection UI has a character limit for prompt text. We hit it during configuration of the DPA Subprocessor Notice Method prompt (~6,452 characters in draft form), which required trimming to ~4,911 characters. Build with the limit in mind.The “Look for language such as” and “Do not extract” sections are where length tends to accumulate, and both can almost always be tightened without losing logic.

Plan for processing time. There’s a noticeable delay between selecting “Extract Metadata” and receiving the AI Processing Completed notification. It varies by contract length and system load. Build this into your testing session planning, especially when running extractions across multiple contracts in sequence.

Use the Verify step. When RunAI extracts metadata for a contract, a verification banner appears with a Suggested Properties panel showing each extracted value. Don’t default to “Accept all suggestions.” Spot-check properties that showed lower accuracy in testing. The verification UI is also the most useful place to identify failure patterns during early testing rounds.

What’s next

Eight of the ten Workstream I properties are performing at 93–100% and are ready for broader use. Price Lock Percent and Publicity have been set aside for dedicated investigation following a detection pattern that persisted through Round 2.

For Workstream II, the next step is a full repository run across all three properties, with attorney review of the results dashboard before any action is taken on individual contracts. We’ll establish a quarterly review cadence to add new training examples as novel restriction language shows up in incoming contracts.

The broader takeaway: Customize AI Detection can produce highly accurate, consistently formatted metadata extraction,but it requires deliberate prompt engineering and iterative testing. The investment in that process up front is what makes the output reliable enough to act on at scale.