This prompt is a post-generation safety net for legal tech platforms and contract review systems. Its job is to take a model-generated contract summary or clause analysis and the original source contract, then identify every legal obligation, reference, or clause in the summary that cannot be traced back to the source text. The output is a structured audit report flagging spurious clauses, fabricated obligations, and invented legal language. The ideal user is a product engineer or legal operations professional building a review pipeline where a human attorney must approve flagged items before any output reaches a client-facing surface.
Prompt
Spurious Legal Clause Identification Prompt

When to Use This Prompt
Defines the exact job, user, and context for a post-generation legal hallucination audit, and clarifies when this prompt is the wrong tool.
This prompt belongs in the output validation layer, after a model has produced a summary or analysis but before that output is delivered. It is not a contract generation prompt, not a clause extraction prompt, and not a replacement for legal judgment. You should use it when the cost of a fabricated obligation—such as an invented indemnity, a hallucinated payment term, or a spurious governing law clause—is high enough to require a dedicated detection step. The prompt requires two concrete inputs: the model-generated summary or analysis, and the full source contract text. Without both, the audit cannot produce reliable traceability.
Do not use this prompt as a primary summarization or extraction tool. It is a validator, not a generator. It will not improve the quality of a good summary; it will only flag what is unsupported. If your workflow already includes strict retrieval-augmented generation with citation grounding, this prompt may be redundant. However, for systems where a model is allowed to synthesize or paraphrase without inline citations, this audit step is a critical safety control. After running this prompt, route all flagged items to a human review queue and log the audit report for compliance evidence.
Use Case Fit
Where the Spurious Legal Clause Identification Prompt delivers value and where it creates risk. This prompt is designed for post-generation review, not as a substitute for attorney review.
Good Fit: Contract Review Platforms
Use when: a model has already generated a clause summary or analysis from a source contract, and you need to verify that every obligation, right, or reference in the output is actually present in the source. Guardrail: always provide both the source contract text and the model-generated analysis as separate inputs to the prompt.
Bad Fit: Real-Time Clause Drafting
Avoid when: the model is generating new contract language rather than analyzing existing text. This prompt identifies spurious content in analysis outputs, not drafting hallucinations. Guardrail: use a separate grounding verification prompt for drafting workflows, and never present unverified generated clauses to clients.
Required Inputs
Must have: the complete source contract text, the model-generated clause analysis or summary, and a defined taxonomy of clause types to check. Guardrail: missing or truncated source text will cause false positives—the prompt will flag clauses as spurious when the evidence simply wasn't provided.
Operational Risk: False Confidence
What to watch: the prompt may miss subtly fabricated clauses that paraphrase real obligations with altered details. Guardrail: never treat a clean output as proof of accuracy. Require human attorney review for every flagged and unflagged clause before client delivery.
Operational Risk: Over-Flagging
What to watch: the prompt may flag legitimate clauses that use different wording than the source, especially for implied obligations or cross-referenced sections. Guardrail: implement a confidence threshold and route low-confidence flags to a human review queue rather than auto-stripping them.
Variant: Multi-Jurisdiction Contracts
What to watch: contracts referencing multiple governing laws may contain clauses that appear spurious when checked against only one jurisdiction's standard language. Guardrail: include jurisdiction context in the prompt and maintain a library of standard clause patterns per jurisdiction to reduce false flags.
Copy-Ready Prompt Template
A production-ready prompt template for identifying legal clauses, obligations, or references invented by a model that are not present in the source contract.
This template is the core instruction set for a spurious legal clause identification workflow. It is designed to be pasted directly into your application's prompt layer, with square-bracket placeholders replaced by real values at runtime. The prompt instructs the model to act as a strict contract auditor, comparing a generated analysis against the original source text and flagging any legal language, obligations, or references that lack a direct textual anchor. Because the output directly impacts legal review workflows, this prompt is designed for use within a harness that logs every comparison, surfaces flags for human attorney review, and never automatically removes content without explicit approval.
textYou are a contract audit assistant. Your task is to compare a model-generated contract analysis against the source contract text and identify any legal clauses, obligations, rights, remedies, definitions, or references that appear in the analysis but cannot be traced to the source. ## INPUT [SOURCE_CONTRACT_TEXT] [GENERATED_ANALYSIS_TEXT] ## INSTRUCTIONS 1. Extract every discrete legal assertion, clause reference, obligation, right, remedy, definition, and citation from the generated analysis. 2. For each extracted item, search the source contract text for a direct textual match or a reasonable paraphrase grounded in specific contract language. 3. Classify each item as: - **Grounded**: The item is directly supported by identifiable language in the source contract. Provide the exact source text span as evidence. - **Spurious**: The item cannot be traced to any language in the source contract. It appears to be invented, inferred without evidence, or imported from external legal knowledge. - **Uncertain**: The item may be a reasonable interpretation but lacks a clear textual anchor. Flag for attorney review. 4. For every Spurious or Uncertain item, explain why it could not be grounded, noting whether it introduces a new obligation, alters a party's rights, or references a legal concept absent from the contract. 5. Do not modify, rewrite, or correct any content. Only classify and flag. ## OUTPUT FORMAT Return a JSON object with this exact schema: { "findings": [ { "analysis_excerpt": "string (the exact text from the generated analysis being evaluated)", "classification": "grounded | spurious | uncertain", "source_evidence": "string | null (exact source contract text supporting the item, or null if none found)", "explanation": "string (reason for classification, especially important for spurious and uncertain items)", "risk_note": "string | null (if spurious, describe the potential impact: new obligation created, right altered, concept invented, etc.)" } ], "summary": { "total_items_reviewed": "number", "grounded_count": "number", "spurious_count": "number", "uncertain_count": "number", "requires_attorney_review": "boolean (true if any spurious or uncertain items found)" } } ## CONSTRAINTS - Do not introduce any legal analysis, interpretation, or commentary beyond grounding verification. - Do not reference legal knowledge, statutes, case law, or external standards unless they are explicitly cited in the source contract. - If the source contract is ambiguous, classify the item as Uncertain rather than Grounded. - Never state that an item is Grounded without providing the exact source text span. - If the generated analysis contains no spurious or uncertain items, return an empty findings array with appropriate summary counts.
To adapt this template, replace [SOURCE_CONTRACT_TEXT] with the full, unredacted contract text your system retrieved, and [GENERATED_ANALYSIS_TEXT] with the model-produced clause analysis or summary under review. If your application processes contracts in sections, run this prompt per section to keep context windows manageable and grounding evidence precise. The output JSON schema is designed for direct ingestion by a downstream validation harness that can log findings, trigger attorney review queues, and prevent spurious content from reaching client deliverables. Always pair this prompt with a human-in-the-loop step: the requires_attorney_review boolean should gate any automated publishing or delivery.
Prompt Variables
Inputs required for the Spurious Legal Clause Identification Prompt. Each variable must be populated from source documents or application state before the prompt is sent. Missing or empty inputs will cause false positives or missed fabrications.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SOURCE_CONTRACT_TEXT] | The full text of the original contract or legal document that the model output claims to summarize or analyze. | Master Services Agreement dated 2024-03-15 between Acme Corp and Beta LLC, Sections 1-12. | Required. Must be non-empty and contain at least one clause boundary. Reject if input is a summary or redline only. |
[MODEL_OUTPUT_CLAUSES] | The model-generated clause analysis, summary, or extraction that will be audited for spurious legal content. | Section 4.2: Indemnification. The Supplier shall indemnify the Buyer against all third-party claims arising from... | Required. Must contain identifiable clause-like segments. If output is unstructured narrative, run clause segmentation first. |
[CLAUSE_DELIMITER_PATTERN] | Regex or string pattern that separates individual clauses in [MODEL_OUTPUT_CLAUSES] for per-clause evaluation. | Section \d+.\d+:|ARTICLE [IVX]+|^\d+.\s | Required. Must match at least two clause boundaries in the output. If no pattern matches, return error and request structured input. |
[JURISDICTION_HINT] | Optional jurisdiction context to help the model recognize standard clause language vs. invented obligations. | Delaware, USA | England and Wales | Singapore | Optional. If null, model uses general contract language patterns. Providing jurisdiction improves detection of jurisdiction-specific invented terms. |
[CONTRACT_TYPE_HINT] | Optional contract type to narrow the set of expected clause categories and reduce false positives on legitimate boilerplate. | Master Services Agreement | Employment Contract | SaaS Subscription Agreement | Optional. If null, model evaluates against general contract clause expectations. Providing type improves precision for industry-specific clauses. |
[SPURIOUS_THRESHOLD] | Confidence threshold below which a clause is flagged as spurious. Scale 0.0 to 1.0. | 0.7 | Required. Default 0.7. Lower values increase false positives; higher values increase false negatives. Tune against a labeled validation set before production use. |
[OUTPUT_FORMAT] | Desired output structure for the spurious clause report. | JSON with fields: clause_id, clause_text, spurious_flag, confidence_score, reason_code, source_evidence_snippet, recommended_action | Required. Must specify JSON schema or structured format. If null, default to JSON array of clause objects. Validate output against this schema after generation. |
[HUMAN_REVIEW_REQUIRED] | Boolean flag indicating whether flagged clauses must be routed for attorney review before any downstream action. | Required. Must be true for any output that will be delivered to clients or filed. Set to false only for internal draft review with explicit legal team approval of the workflow. |
Implementation Harness Notes
How to wire the Spurious Legal Clause Identification Prompt into a contract review pipeline with validation, retries, and mandatory human review.
This prompt is not a standalone chat interaction. It is a post-generation filter designed to sit between a model that produces contract summaries or clause analyses and the attorney who reviews them. The harness must enforce a strict boundary: the prompt identifies potentially spurious clauses, but only a licensed attorney can decide whether flagged content is actually fabricated. The implementation must never present unverified output directly to a client or counterparty.
Input wiring: The harness must supply two required inputs: [SOURCE_CONTRACT] (the full text of the original agreement or the specific sections under review) and [GENERATED_ANALYSIS] (the model-produced summary, clause list, or obligation table being audited). An optional [REVIEW_SCOPE] parameter can limit the check to specific clause types—indemnification, limitation of liability, termination rights—to reduce noise in long contracts. The harness should chunk the source contract and generated analysis if they exceed the model's context window, running the prompt per chunk and merging results with deduplication logic. Model choice: Use a model with strong instruction-following and long-context handling. GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are appropriate. Avoid small or fast models that may miss subtle legal language fabrication.
Validation and retries: The output must conform to a strict JSON schema with a flagged_clauses array where each object contains clause_text, source_reference (the exact location in the source contract that contradicts or fails to support the clause), spurious_reason, and confidence (HIGH/MEDIUM/LOW). If the model returns malformed JSON, the harness should retry once with a repair prompt that includes the schema and the raw output. If the second attempt fails, log the failure and escalate the entire analysis for full human review. Logging and audit trail: Every run must log the prompt version, model, input hashes, raw output, parsed flags, and the attorney's final disposition for each flag. This audit trail is essential for demonstrating diligence if a missed spurious clause later causes a dispute.
Human review integration: The harness must route all flagged clauses into a review queue—never auto-remove them. Each flag should display the spurious clause side-by-side with the cited source contract excerpt. The attorney confirms (spurious, remove), overrules (not spurious, keep), or requests re-analysis. The harness should track review decisions to measure the prompt's precision and recall over time. What to avoid: Do not use this prompt as a replacement for attorney review. Do not auto-accept removals. Do not run the prompt on contracts where the source text is incomplete or redacted—the model will flag more false positives when it cannot verify against missing sections. If the contract is in a scanned PDF, run OCR and text extraction before invoking this prompt; poor extraction quality will degrade accuracy and increase spurious flags.
Expected Output Contract
Defines the exact fields, types, and validation rules for the spurious legal clause identification output. Use this contract to build downstream parsers, validation checks, and human review queues before the output reaches a client-facing surface.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
spurious_clauses | Array of objects | Must be a JSON array. If no spurious clauses are found, return an empty array, not null or a string. | |
spurious_clauses[].clause_text | String | Must be a non-empty string containing the exact text of the flagged clause as it appears in the model-generated summary. Must be a substring of the [MODEL_OUTPUT]. | |
spurious_clauses[].clause_type | Enum: obligation, restriction, representation, warranty, indemnity, condition, definition, term, other | Must match one of the allowed enum values. If the type is ambiguous, use 'other' and populate the notes field. | |
spurious_clauses[].source_contract_evidence | String or null | If the clause is partially grounded, provide the quoted source text. If completely fabricated, this must be null. A null value triggers a mandatory human review flag. | |
spurious_clauses[].fabrication_severity | Enum: complete_fabrication, material_misrepresentation, minor_embellishment | Must be one of the three severity levels. 'complete_fabrication' means no source evidence exists. 'material_misrepresentation' means the clause meaning is altered. 'minor_embellishment' means a detail was added but core meaning is intact. | |
spurious_clauses[].recommended_action | Enum: remove, replace, human_review | Must be 'remove' for complete fabrications, 'human_review' for material misrepresentations, and 'replace' only if a corrected clause can be sourced. If 'replace' is used, corrected_clause must be populated. | |
spurious_clauses[].corrected_clause | String or null | Required only when recommended_action is 'replace'. Must be a string grounded in the [SOURCE_CONTRACT]. If not applicable, must be null. | |
audit_metadata.review_required | Boolean | Must be true if any spurious clause has fabrication_severity of 'complete_fabrication' or 'material_misrepresentation'. Downstream systems must gate on this field before client delivery. |
Common Failure Modes
What breaks first when using a Spurious Legal Clause Identification Prompt and how to guard against it in production.
Over-Flagging of Boilerplate Language
What to watch: The model flags standard legal boilerplate (e.g., 'governed by the laws of...') as spurious because it doesn't match the exact phrasing in the source contract, even when the clause is substantively present. Guardrail: Include a 'substantive match' tolerance rule in the prompt that distinguishes between missing clauses and paraphrased standard language. Use few-shot examples showing acceptable paraphrasing.
False Negatives on Implied Obligations
What to watch: The model misses spurious clauses that invent implied obligations (e.g., 'the parties shall indemnify...') not present in the source, because the language sounds legally plausible. Guardrail: Require the prompt to map every flagged clause back to a specific source paragraph number. If no source paragraph can be cited, escalate the clause for human review regardless of plausibility.
Cross-Contamination from Training Data
What to watch: The model 'remembers' standard contract language from its training data and fails to recognize it as spurious when it doesn't appear in the source contract, treating it as a legitimate summary. Guardrail: Add an explicit instruction: 'Only clauses explicitly present in the provided source contract are valid. Do not supplement from general legal knowledge.' Test with contracts that deliberately omit common clauses.
Inconsistent Flagging Across Contract Sections
What to watch: The model applies different strictness levels to different contract sections—flagging aggressively in liability sections while missing spurious clauses in definitions or exhibits. Guardrail: Implement a structured output schema that requires the model to evaluate every section of the contract summary independently. Run section-level consistency checks in post-processing to detect variance in flagging rates.
Confidence Inflation on Ambiguous Clauses
What to watch: The model assigns high confidence to spurious clause flags when the source language is ambiguous or when a clause is partially present but materially altered in the summary. Guardrail: Require the prompt to output a confidence score and a 'requires attorney review' boolean for every flagged clause. Route all medium-confidence and ambiguous matches to a human review queue.
Source Grounding Drift in Long Contracts
What to watch: For contracts exceeding the model's effective context window, the model loses track of which clauses appeared in the source and begins flagging legitimate clauses as spurious or vice versa. Guardrail: Chunk the source contract and summary into aligned sections before prompting. Process each section pair independently, then merge results. Never send an un-chunked long contract to a single prompt call.
Evaluation Rubric
Use this rubric to test the Spurious Legal Clause Identification Prompt before production deployment. Each criterion targets a specific failure mode common in legal hallucination detection. Run these tests against a golden dataset of contracts with known spurious and valid clauses.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Recall of Spurious Clauses | ≥95% of injected spurious clauses are flagged | Spurious clause present in output but not in [FLAGGED_CLAUSES] array | Run prompt against 20 contracts with 5 known spurious clauses each; count false negatives |
Precision on Valid Clauses | ≤5% of valid source clauses incorrectly flagged as spurious | Clause text from [SOURCE_CONTRACT] appears in [FLAGGED_CLAUSES] with is_spurious: true | Run prompt against 20 clean contracts with zero spurious content; count false positives |
Source Text Grounding | Every flagged clause includes a [SOURCE_QUOTE] field with verbatim text from the contract | [SOURCE_QUOTE] field is null, empty, or contains text not found in [SOURCE_CONTRACT] | Parse output JSON; substring-match every [SOURCE_QUOTE] against [SOURCE_CONTRACT] text |
Obligation Fabrication Detection | Invented obligations not present in source are flagged with reason_code: OBLIGATION_FABRICATED | Model output describes a party obligation absent from [SOURCE_CONTRACT] but not flagged | Seed test contracts with known obligations; insert 3 fabricated obligations; verify all 3 flagged |
Party Name Hallucination | All party names in [FLAGGED_CLAUSES] match entities in [SOURCE_CONTRACT] exactly | Flagged clause references a party name not found in contract preamble or signature block | Extract all party names from [SOURCE_CONTRACT]; cross-reference against flagged clause entities |
Null Output Handling | When no spurious clauses exist, output returns [FLAGGED_CLAUSES] as empty array with confidence ≥0.9 | [FLAGGED_CLAUSES] is non-empty or confidence score <0.9 on clean contract | Run prompt against 10 clean contracts; verify empty array and high confidence |
Reason Code Completeness | Every flagged clause includes a non-null [REASON_CODE] from the allowed enum | [REASON_CODE] is null, empty, or not in [NOT_PRESENT_IN_SOURCE, OBLIGATION_FABRICATED, PARTY_HALLUCINATED, DATE_FABRICATED, TERM_INVENTED] | Validate [REASON_CODE] against allowed enum for all flagged clauses in test run |
Human Review Escalation | Output includes [REQUIRES_ATTORNEY_REVIEW]: true when any clause is flagged | [REQUIRES_ATTORNEY_REVIEW] is false when [FLAGGED_CLAUSES] is non-empty | Assert boolean consistency across 50 test runs with mixed spurious and clean contracts |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a single contract. Use a simple markdown table for the output instead of a strict JSON schema. Focus on getting the clause-level flagging logic right before adding structured metadata or audit trails.
Simplify the output to: | Clause Text | Present in Source? | Confidence | Notes |
Watch for
- The model flagging paraphrased clauses as spurious because wording differs
- Over-flagging boilerplate language that is standard in contracts
- Missing clauses that are implied but not explicitly stated

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us