This prompt is designed for eval pipeline builders and QA engineers who need an automated, repeatable method to audit AI-generated answers for factual fidelity. The core job-to-be-done is decomposing a generated text into discrete, verifiable claims and then matching each claim against a provided set of source evidence. The output is a structured audit trail—a claim list with per-claim grounding scores—that can be used as a quality gate in a CI/CD pipeline or as a continuous monitoring signal in production. The ideal user is someone integrating this step into an automated testing harness, not a human performing a one-off manual review.
Prompt
Claim Extraction and Source Verification Prompt

When to Use This Prompt
Define the job, reader, and constraints for automated claim extraction and source verification.
Use this prompt when you have a generated answer and the exact source context that was used to produce it, and you need a machine-readable verdict on whether each factual statement is supported. This is a post-generation verification step, distinct from real-time RAG answer synthesis. It is appropriate for regression testing where you compare model outputs against a golden dataset of known-good answers and sources, for pre-release answer quality gates that block deployment if hallucination rates exceed a threshold, and for production observability where you sample live answers and run them through this audit loop. Do not use this prompt when you lack the original source evidence, when the answer contains subjective opinions rather than verifiable claims, or when you need a single overall score without per-claim traceability. It is also not a substitute for human review in regulated domains—it is a filtering and prioritization tool that should escalate uncertain cases to human auditors.
Before wiring this into your application, define your grounding score thresholds and escalation rules. A claim with a low grounding score should trigger a specific action: block the answer, flag for human review, or regenerate with stricter constraints. The prompt template includes placeholders for [INPUT_ANSWER], [SOURCE_CONTEXT], and [OUTPUT_SCHEMA] so you can adapt it to your specific document formats and required JSON fields. Start by running this against a labeled evaluation set where you already know which claims are supported and which are fabricated, then calibrate your thresholds before relying on it in a production gate.
Use Case Fit
Where the Claim Extraction and Source Verification Prompt delivers reliable audit trails and where it introduces operational risk. Use these cards to decide if this prompt fits your eval pipeline before integrating it into CI/CD quality gates.
Good Fit: Automated Factual Audit Trails
Use when: you need a structured, claim-by-claim breakdown of a generated answer mapped back to source evidence. This prompt excels in CI/CD pipelines where every deployment must pass a grounding score threshold. Guardrail: pair with a deterministic JSON schema validator to catch malformed outputs before they reach downstream dashboards.
Good Fit: Pre-Release Answer Quality Gates
Use when: you are shipping a RAG feature and need an automated gate that blocks answers with unsupported claims. The prompt produces per-claim grounding scores that can trigger a release hold. Guardrail: define explicit pass/fail thresholds for the grounding score and run the eval against a golden dataset of known good and bad answers before relying on it in production.
Bad Fit: Real-Time User-Facing Guardrails
Avoid when: you need to block a hallucinated answer before it reaches a user in a synchronous chat flow. This prompt is designed for offline eval pipelines, not low-latency interception. Guardrail: use a lightweight, classifier-based hallucination detector for real-time flows and reserve this prompt for batch evaluation and regression testing.
Required Inputs: Answer Text and Source Evidence
Risk: running the prompt without providing the original source documents or retrieved chunks forces the model to guess what the evidence should be, producing fabricated verification results. Guardrail: always supply the exact retrieved context that was available during answer generation. The prompt harness should refuse to run if the evidence field is empty or truncated.
Operational Risk: Verification Model Hallucination
Risk: the model performing verification can hallucinate source matches, inventing evidence that supports a claim when the real source is silent. This creates a false sense of security. Guardrail: implement a secondary spot-check where a human or a stronger model audits a random sample of claim-evidence pairs, and track the false positive rate over time.
Operational Risk: Cost and Latency in CI/CD
Risk: running a full claim extraction and verification pass on every generated answer in a large test suite can become expensive and slow, leading teams to skip the check. Guardrail: sample answers for verification, prioritize high-risk query categories, and cache verification results for unchanged prompt-answer pairs to control cost without abandoning the safety net.
Copy-Ready Prompt Template
A reusable prompt for extracting claims from a generated answer and verifying each claim against source evidence, producing a structured audit trail.
This template is the core instruction set for decomposing an AI-generated answer into discrete, verifiable claims and then checking each claim against a provided set of source documents. It is designed to be dropped into an evaluation pipeline, not a user-facing chat interface. The prompt enforces a strict JSON output schema, making its results machine-readable for automated quality gates. Use this when you need a programmatic, repeatable method for factual auditing before an answer reaches a user or a downstream system.
codeYou are an expert fact-checker and claims auditor. Your task is to perform a structured audit of a generated answer against a set of provided source documents. You will decompose the answer into a list of discrete, atomic claims and then verify each claim against the evidence. # INPUT ## Generated Answer to Audit [ANSWER] ## Source Evidence [SOURCE_DOCUMENTS] # OUTPUT SCHEMA Return a single JSON object with the following structure. Do not include any text outside the JSON object. { "claims": [ { "claim_id": "string (unique identifier, e.g., 'C1', 'C2')", "claim_text": "string (the exact, self-contained factual statement from the answer)", "verification_status": "string (one of: 'SUPPORTED', 'UNSUPPORTED', 'CONTRADICTED', 'NOT_ADDRESSED')", "source_evidence": [ { "source_id": "string (the identifier of the source document from [SOURCE_DOCUMENTS])", "relevant_passage": "string (the exact text from the source that supports or contradicts the claim)", "match_explanation": "string (a brief explanation of how the passage relates to the claim)" } ], "confidence_score": "float (between 0.0 and 1.0, indicating how well the evidence supports the verification_status)" } ], "overall_grounding_score": "float (the proportion of 'SUPPORTED' claims out of total claims, between 0.0 and 1.0)", "audit_summary": "string (a concise summary of the audit findings, highlighting any critical unsupported or contradicted claims)" } # CONSTRAINTS 1. **Atomicity**: Each claim must be a single, self-contained factual statement. Break down compound sentences. For example, "The product launched in 2020 and was updated in 2022" becomes two claims. 2. **Fidelity**: The `claim_text` must be a direct quote or a minimally rephrased statement from the [ANSWER]. Do not alter the meaning. 3. **Evidence Grounding**: For a claim to be 'SUPPORTED', you must find explicit evidence in [SOURCE_DOCUMENTS]. Inference is not support. If the evidence implies the claim but does not state it, the status is 'UNSUPPORTED'. 4. **Source Exclusivity**: Only use the provided [SOURCE_DOCUMENTS] for verification. Do not use external knowledge. If the evidence is silent on a claim, the status is 'NOT_ADDRESSED'. 5. **Strict JSON**: Your entire response must be the valid JSON object described in the OUTPUT SCHEMA. No markdown fences, no introductory text. # RISK LEVEL [RISK_LEVEL] # ADDITIONAL INSTRUCTIONS [CONSTRAINTS]
To adapt this template, start by defining your [ANSWER] and [SOURCE_DOCUMENTS] variables. The [SOURCE_DOCUMENTS] should be a pre-formatted string that includes clear source identifiers (e.g., [DOC_ID: 1]) before each chunk of text. The [RISK_LEVEL] placeholder can be used to inject context-specific instructions, such as "HIGH: If any claim is UNSUPPORTED or CONTRADICTED, the overall_grounding_score must be 0.0." The [CONSTRAINTS] field allows you to add domain-specific rules, like "For legal claims, require a direct quote from a statute or case law." The most critical adaptation is ensuring the [SOURCE_DOCUMENTS] are chunked and identified in a way that the model can reliably reference them in the source_id field. Test this with a small, known set of claims and documents before integrating it into a CI/CD pipeline.
Prompt Variables
Required inputs for the Claim Extraction and Source Verification Prompt. Each placeholder must be populated before the prompt is sent to the model. Validation notes describe how to verify the input is correctly formed.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[ANSWER_TEXT] | The generated answer to decompose into individual factual claims for verification | The patient should take 50mg of metformin twice daily with meals to reduce gastrointestinal side effects. | Non-empty string. Must be the complete answer output from the upstream RAG system. Null or empty input should abort the verification pipeline. |
[SOURCE_DOCUMENTS] | The retrieved evidence passages used to generate the answer, with metadata | [{"id": "doc-12", "text": "Metformin dosing: 50mg BID with food...", "title": "Diabetes Management Protocol v3", "date": "2024-01-15"}] | JSON array of objects with required fields: id, text. Optional fields: title, date, url, authority_score. Empty array triggers abstention-only verification. Validate JSON parse before prompt assembly. |
[VERIFICATION_THRESHOLD] | Minimum grounding score for a claim to be considered supported by evidence | 0.7 | Float between 0.0 and 1.0. Values below 0.5 produce high false-positive rates. Values above 0.9 may cause over-rejection of faithful paraphrases. Default 0.7 if not specified. |
[MAX_CLAIMS] | Upper bound on the number of claims to extract from the answer | 15 | Integer between 1 and 50. Prevents runaway extraction on long answers. If answer contains more atomic claims, the prompt should prioritize substantive claims over stylistic ones. Set lower for latency-sensitive pipelines. |
[CITATION_FORMAT] | Required format for source references in the output | inline_id | Enum: inline_id, footnote_number, json_index, full_citation. Must match downstream consumer expectations. inline_id produces [doc-12] style references. json_index produces 0-based array indices into SOURCE_DOCUMENTS. |
[OUTPUT_SCHEMA_VERSION] | Schema version for the verification output to enable pipeline compatibility | 2.1 | Semantic version string. Pipeline validators should reject outputs with unsupported versions. Current schema includes claim_text, grounding_score, source_ids, verification_rationale, and unsupported_flag fields. |
[ABSTENTION_POLICY] | Instruction for how to handle claims that cannot be verified against any source | flag_unsupported | Enum: flag_unsupported, omit_claims, mark_low_confidence, escalate_for_review. flag_unsupported keeps the claim with unsupported_flag: true. omit_claims removes unverifiable claims from output. escalate_for_review triggers human review handoff. |
Implementation Harness Notes
How to wire the Claim Extraction and Source Verification Prompt into a CI/CD evaluation pipeline for automated factual audit trails.
This prompt is designed to operate as a post-generation verification gate within a CI/CD pipeline, not as a user-facing step. After your primary RAG system generates an answer, this prompt decomposes that answer into discrete factual claims and verifies each against the original retrieved evidence. The output is a structured audit trail—a list of claims, their grounding status, and per-claim scores—that your pipeline can use to block deployment, flag for review, or log for observability. The harness must treat this prompt as a deterministic evaluation step: same input should produce a comparable claim structure every time, which is why strict JSON output and schema validation are non-negotiable.
Integration pattern: Wire the prompt into an evaluation script that runs after answer generation but before the answer reaches a user or a release gate. The script should (1) receive the generated answer and the source context used to produce it, (2) call the model with this prompt, (3) parse the JSON output, (4) validate the schema, and (5) apply pass/fail rules. A minimal harness in Python might look like: claims = call_model(prompt_template.format(answer=generated_answer, context=retrieved_chunks)) followed by validate_claims_schema(claims) and assert all(c['grounding_score'] >= 0.7 for c in claims['claims']). The grounding score threshold is a tunable parameter—start at 0.7 and adjust based on your tolerance for unsupported claims. For high-stakes domains (legal, clinical, financial), require human review when any claim scores below 0.9 or when the unsupported_claims array is non-empty.
Validation and retry logic: The harness must validate the JSON structure before trusting the results. Check that every claim object contains claim_text, source_evidence_match, grounding_score, and verification_status fields. If the model returns malformed JSON, implement a retry with the same prompt plus the parsing error message appended as a correction hint. Limit retries to 2 attempts; after that, escalate the entire answer for human review rather than silently passing. Log every verification run—including the raw prompt, model response, parse errors, and final scores—to your observability platform. This log becomes your audit evidence when stakeholders ask why an answer was blocked or approved. For model choice, prefer models with strong JSON mode support (GPT-4o, Claude 3.5 Sonnet) and set temperature=0 to maximize output stability. Do not use this prompt with models that lack reliable structured output; the verification step is only as trustworthy as the schema compliance.
CI/CD gate integration: In your CI/CD pipeline, treat the grounding verification results as a quality gate. Define a policy such as: 'If any claim has grounding_score < 0.5 or verification_status == "unsupported", block the deployment and create a ticket.' For less critical applications, you might only block when more than 10% of claims are unsupported. Store the verification results alongside the answer in your evaluation database so you can track grounding quality over time and detect regressions when prompts or retrieval pipelines change. The claim_extraction_harness should also run against a golden dataset of known-good and known-bad answers to calibrate your thresholds before going live. Avoid the temptation to skip this harness in pre-production; an unverified RAG answer that reaches users is a hallucination incident waiting to happen.
Common Failure Modes
What breaks first when extracting claims and verifying them against source evidence, and how to build automated guardrails that catch failures before they reach downstream systems.
Hallucinated Claims Pass Verification
What to watch: The model fabricates a plausible-sounding claim that has no source match, but the verification step fails to flag it because the claim is semantically similar to existing evidence or the verifier is too permissive. Guardrail: Require explicit passage-span anchoring for every claim. If a claim cannot be mapped to a specific sentence or paragraph in the source, mark it as ungrounded regardless of semantic similarity.
Source-Answer Misattribution
What to watch: A claim is correctly extracted but attributed to the wrong source document, passage, or chunk. This is common when multiple sources discuss similar topics and the verifier matches by topic rather than by precise content. Guardrail: Include source metadata in every claim object and validate that the claimed source actually contains the specific fact. Cross-reference with a secondary passage-level check before accepting attribution.
Partial Grounding Masked as Full Support
What to watch: A claim is partially supported by evidence but the verifier returns a high grounding score because it found keyword overlap. The unsupported portion of the claim goes undetected. Guardrail: Decompose compound claims into atomic sub-claims before verification. Score each sub-claim independently and flag any composite claim where one or more sub-claims lack evidence. Do not average scores across sub-claims.
Verifier Model Drift Under Load
What to watch: The verification prompt works reliably in development but degrades in production when claim volume increases, source documents are longer, or the verifier model is swapped. Scoring becomes inconsistent and false negatives increase. Guardrail: Run a fixed golden set of claim-evidence pairs through the verifier on every deployment. Track precision and recall against known ground-truth labels. Alert if scores drift beyond a threshold. Version-lock the verifier prompt and model together.
Temporal Evidence Mismatch
What to watch: A claim references a fact that was true in an older version of a source but is contradicted by a newer version. The verifier matches against the outdated passage and returns a high grounding score. Guardrail: Include document timestamps or version identifiers in source metadata. Require the verifier to check whether the matched passage is the most current available version. Flag claims grounded in deprecated or superseded sources.
Overclaiming from Implicit Evidence
What to watch: The model infers a claim that is logically consistent with the evidence but not explicitly stated. The verifier accepts the inference as grounded because it is reasonable, not because it is directly supported. Guardrail: Instruct the verifier to distinguish between explicit support and reasonable inference. Require a separate confidence tier for inferential claims and route them for human review if they appear in high-stakes outputs. Never treat inference as direct grounding.
Evaluation Rubric
Use this rubric to test the quality of claim extraction and source verification outputs before integrating them into a CI/CD answer quality gate. Each criterion targets a specific failure mode common in automated factual audit trails.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Claim Completeness | Every factual assertion in [INPUT_ANSWER] is decomposed into a discrete claim in the output list | A factual statement from the answer is missing from the claims list | Manual spot-check: compare [INPUT_ANSWER] sentence-by-sentence against the extracted claims array |
Claim Atomicity | Each extracted claim contains exactly one verifiable fact | A single claim string contains multiple facts joined by 'and' or a semicolon | Parse output claims; flag any string with more than one subject-predicate pair |
Source Evidence Match | Every claim's [EVIDENCE] field contains a verbatim quote from [SOURCE_DOCUMENTS] that directly supports the claim | The evidence quote is paraphrased, truncated in a misleading way, or pulled from a non-existent source | String-inclusion check: verify each [EVIDENCE] string exists exactly in [SOURCE_DOCUMENTS] |
Grounding Score Calibration | GROUNDED claims have a score >= 0.9; UNVERIFIABLE claims have a score <= 0.3; CONTRADICTED claims have a score <= 0.1 | A claim with no supporting evidence receives a GROUNDED score; a direct quote match receives an UNVERIFIABLE score | Assert score thresholds in eval script; flag any claim where score contradicts the [VERIFICATION_STATUS] |
Verification Status Accuracy | The [VERIFICATION_STATUS] field correctly uses only the allowed enum values: GROUNDED, UNVERIFIABLE, CONTRADICTED | A claim with a direct source match is marked UNVERIFIABLE; a claim with no match is marked GROUNDED | Golden dataset comparison: compare model-assigned status against human-labeled status for 50 claims |
Contradiction Detection | When [SOURCE_DOCUMENTS] contain conflicting evidence, at least one claim is marked CONTRADICTED with both sources cited | Conflicting sources are ignored and the claim is marked GROUNDED based on only one source | Inject a test document pair with a known contradiction; assert CONTRADICTED status appears in output |
Null Handling | Claims that cannot be verified return [EVIDENCE]: null and [VERIFICATION_STATUS]: UNVERIFIABLE | A null evidence field is accompanied by a hallucinated quote or a GROUNDED status | Schema validation: assert that when [EVIDENCE] is null, [VERIFICATION_STATUS] equals UNVERIFIABLE |
Output Schema Compliance | The output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed | Missing [CLAIM_ID], malformed [GROUNDING_SCORE] as string instead of float, or extra undeclared fields | JSON Schema validator run in CI; reject any output that fails structural validation |
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 small golden set of 10-20 answer-evidence pairs. Remove strict JSON schema requirements initially; accept structured text output and parse it loosely. Focus on whether claims are being extracted and matched, not on perfect formatting.
Simplify the output to:
- Claim list
- Source match (yes/no)
- Brief justification
Use a single model call without retries. Log all outputs manually for pattern review.
Watch for
- Claims that paraphrase the answer rather than decompose it
- Source matches that cite document titles instead of specific passages
- Overly broad claims that can't be verified against any single chunk
- Missing abstention when no evidence exists

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