This prompt is a post-generation verification harness for AI quality engineers who need an automated, structured audit trail before a RAG-generated answer reaches a user or a downstream system. Its job is to take a synthesized answer and the exact set of source passages that were provided to the generation model, then map every claim in the answer to an evidence span, flag unsupported statements, and score overall faithfulness. The ideal user is an evaluation engineer, a platform reliability engineer, or a product developer embedding a guardrail into a retrieval-augmented generation pipeline. Required context includes the full generated answer text and the complete, unmodified list of source passages that were in the model's context window at generation time. Without both, the audit cannot produce a valid claim-to-evidence mapping.
Prompt
Source-By-Source Synthesis Audit Prompt

When to Use This Prompt
Defines the precise job-to-be-done, required context, and operational boundaries for the Source-By-Source Synthesis Audit Prompt.
Use this prompt when you need a deterministic, evidence-backed audit report that can be logged, reviewed, or used as a gating condition before publishing an answer. It is appropriate for high-stakes domains—such as legal research, clinical decision support, financial analysis, or compliance documentation—where an unsupported claim can cause real harm. The prompt is designed to be wired into an automated pipeline: after answer generation, the audit runs, and if the faithfulness score falls below a threshold or unsupported claims are detected, the system can either regenerate, escalate for human review, or refuse to surface the answer. It is also useful during offline evaluation runs, where you need to measure grounding fidelity across a test suite of question-answer-source triples.
Do not use this prompt as a general-purpose hallucination detector for open-domain chat or for answers generated without explicit source passages. It assumes a closed-world evidence set: every claim must be traceable to at least one provided passage, and anything outside that set is flagged as unsupported. It is not designed to detect factual errors where the source itself is wrong, nor to assess whether the retrieved passages are sufficient to answer the question—those are separate concerns handled by evidence sufficiency and fact-checking prompts. If your generation pipeline uses multiple retrieval steps, re-ranking, or source fusion, ensure the exact passages seen by the generation model are captured and passed to this audit prompt without modification. The audit's value depends entirely on the integrity of that evidence snapshot.
Use Case Fit
Where the Source-By-Source Synthesis Audit Prompt delivers value and where it introduces risk. Use these cards to decide if this verification harness fits your pipeline before integrating it.
Strong Fit: Post-Generation QA Gate
Use when: you need an automated step to verify that every claim in a generated answer traces back to at least one source passage before the answer reaches a user. Guardrail: Run this audit prompt as a blocking step in your generation pipeline. If the faithfulness score falls below your threshold, route the output for human review or regeneration rather than delivering it.
Strong Fit: Regulated Domain Evidence Tracing
Use when: you operate in legal, healthcare, or financial domains where unsupported claims create compliance risk. Guardrail: Store the audit report alongside the generated answer as an evidence trail. Require human sign-off when the audit flags unsupported statements, and never auto-publish outputs with unresolved flags.
Poor Fit: Real-Time Chat with Latency Budgets Under 500ms
Avoid when: your application requires sub-second response times and cannot afford an additional model call for verification. Guardrail: Reserve this audit prompt for asynchronous or batch verification workflows. For real-time use, consider a lightweight classifier or regex-based citation check instead.
Poor Fit: Single-Source or Trivial Synthesis Tasks
Avoid when: the answer is generated from a single, unambiguous source passage with no synthesis required. Guardrail: Skip the audit when the retrieval set contains exactly one passage and the generation prompt already enforces strict citation. The overhead of claim-by-claim tracing adds no value for trivial cases.
Required Input: Source Passages with Stable Identifiers
Risk: The audit prompt cannot trace claims to sources if passages lack unique identifiers or if the generation prompt does not preserve source mapping. Guardrail: Ensure every source passage passed to the generation step has a persistent ID. Include those IDs in the audit prompt's input schema so the model can reference them precisely in the audit report.
Operational Risk: Audit Model Hallucination
Risk: The model running the audit can itself hallucinate claim-to-source mappings, producing a false sense of security. Guardrail: Pair this audit prompt with a deterministic span-matching validator that checks whether cited source passages actually contain the claimed text. Never rely solely on the audit model's output without programmatic verification of evidence spans.
Copy-Ready Prompt Template
A copy-ready template for auditing whether every claim in a generated answer is supported by at least one source passage.
The prompt below is designed to be dropped into your evaluation harness as a post-generation verification step. It instructs the model to act as an auditor, mapping each factual claim in a generated answer back to a specific evidence span in the provided source passages. Replace every square-bracket placeholder with your actual data before running the audit. The prompt is structured to produce a consistent JSON report that your application can parse, log, and use to gate whether the answer is shown to the user or sent for repair.
textYou are a source-by-source synthesis auditor. Your job is to verify that every factual claim in a generated answer is directly supported by at least one provided source passage. You do not evaluate the quality of the answer itself—only whether each claim can be traced to evidence. ## INPUT - Generated Answer: [GENERATED_ANSWER] - Source Passages (with IDs): [SOURCE_PASSAGES] - Claim Types to Audit: [CLAIM_TYPES] ## OUTPUT SCHEMA Return a JSON object with the following structure: { "audit_report": { "total_claims_found": <integer>, "supported_claims": <integer>, "unsupported_claims": <integer>, "partially_supported_claims": <integer>, "claims": [ { "claim_id": "<string>", "claim_text": "<exact text from the answer>", "claim_type": "<factual | interpretive | quantitative | temporal | attribution>", "support_status": "<supported | unsupported | partially_supported>", "supporting_source_ids": ["<source_id>", ...], "supporting_evidence_spans": ["<exact quote from source>", ...], "auditor_notes": "<explanation of why this claim is or is not supported>" } ], "unsupported_claim_summary": "<summary of what the answer claims without evidence>", "overall_faithfulness_score": <float between 0.0 and 1.0> } } ## CONSTRAINTS - Extract every factual claim from the generated answer. A claim is any statement that asserts something true about the world. - For each claim, search all source passages for direct supporting evidence. The evidence must be a verbatim span or a clear paraphrase that does not add or distort information. - If a claim is partially supported (some parts have evidence, others do not), mark it as partially_supported and note which parts lack evidence. - Do not mark a claim as supported if the source only implies it. Support must be explicit. - If no source passage supports a claim, mark it as unsupported and leave supporting_source_ids and supporting_evidence_spans empty. - The overall_faithfulness_score is the proportion of supported claims (counting partially_supported as 0.5) divided by total claims. - If the generated answer contains no factual claims, return an empty claims array with a score of 1.0 and note that no claims were found. ## EXAMPLES [FEW_SHOT_EXAMPLES] ## RISK LEVEL [RISK_LEVEL]
To adapt this template, start by populating [GENERATED_ANSWER] with the full text output from your RAG pipeline or LLM call. Populate [SOURCE_PASSAGES] with the retrieved passages that were provided as context during generation, each labeled with a unique source ID. The [CLAIM_TYPES] field lets you scope the audit to specific categories—for example, you might only audit factual and quantitative claims if interpretive statements are expected to be subjective. The [FEW_SHOT_EXAMPLES] placeholder should contain 2–3 worked examples showing the model exactly how to extract claims, match evidence spans, and assign support statuses. These examples are critical for consistent output structure. The [RISK_LEVEL] field should be set to high, medium, or low to adjust the auditor's strictness—at high risk, even minor unsupported qualifiers should be flagged.
Before deploying this prompt into a production pipeline, validate the output against a golden dataset of known-supported and known-unsupported answer-source pairs. Measure precision (are flagged unsupported claims actually unsupported?) and recall (are all unsupported claims caught?). Common failure modes include the auditor missing claims embedded in compound sentences, accepting source paraphrases that subtly change meaning, and failing to detect when a claim combines information from multiple sources in a way that neither source individually supports. For high-stakes domains such as healthcare, legal, or financial applications, always route audit reports with unsupported claims to a human reviewer before the answer reaches the end user. Log every audit report with the answer version, source set, and timestamp for downstream traceability.
Prompt Variables
Required inputs for the Source-By-Source Synthesis Audit Prompt. Each variable must be populated before the prompt is assembled and sent. Missing or malformed inputs are the most common cause of audit failures.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SYNTHESIZED_ANSWER] | The generated answer to audit for source faithfulness | The new tax law will affect small businesses by increasing the standard deduction threshold to $25,000. | Must be non-empty string. Reject if length < 10 characters. Check for truncation artifacts at boundaries. |
[SOURCE_PASSAGES] | Array of retrieved source passages with identifiers | [{"source_id": "doc-12", "text": "Section 3(a) raises the standard deduction to $25,000 for businesses with fewer than 50 employees."}] | Must be valid JSON array. Each object requires source_id (string) and text (string). Reject if array is empty or any text field is null. |
[AUDIT_SCHEMA] | JSON schema defining the expected audit output structure | {"claims": [{"claim_text": "string", "source_ids": ["string"], "support_level": "fully_supported|partially_supported|unsupported"}]} | Must be valid JSON Schema. Reject if missing required fields: claims, claim_text, source_ids, support_level. Validate enum values are present. |
[FAITHFULNESS_THRESHOLD] | Minimum acceptable percentage of claims that must be fully or partially supported | 0.85 | Must be float between 0.0 and 1.0. Reject if > 1.0 or < 0.0. Default to 0.80 if not specified. Triggers retry or human review if score falls below threshold. |
[MAX_UNSUPPORTED_CLAIMS] | Hard limit on number of unsupported claims before automatic rejection | 3 | Must be positive integer. Reject if 0 or negative. Set to null if no hard limit. Triggers immediate escalation to human review when exceeded. |
[CITATION_FORMAT] | Expected format for source references in the audit output | source_id_only | Must be one of: source_id_only, source_id_and_span, source_id_and_quote. Reject unrecognized values. Determines whether audit includes text spans or just source identifiers. |
[CONFIDENCE_LABELS] | Taxonomy for expressing auditor confidence in each support determination | ["high", "medium", "low"] | Must be non-empty array of strings. Reject if array contains duplicates. Labels are applied per-claim in the audit output. Default to ["high", "low"] if not specified. |
Implementation Harness Notes
How to wire the Source-By-Source Synthesis Audit Prompt into a production verification pipeline with validation, retries, and human review gates.
The Source-By-Source Synthesis Audit Prompt is designed as a post-generation verification harness, not a user-facing prompt. It should be called after your primary RAG pipeline produces an answer, receiving both the generated answer and the full set of retrieved source passages as inputs. The prompt's job is to produce a structured audit report that maps every claim in the answer back to specific evidence spans, flags unsupported or hallucinated statements, and computes a synthesis faithfulness score. This makes it suitable for automated CI/CD eval pipelines, pre-release answer quality gates, and production monitoring where every user-facing answer must pass a grounding check before delivery.
Wire this prompt into your application as a secondary model call that runs in the verification layer. The primary flow looks like: (1) retrieve passages, (2) generate the user-facing answer, (3) call the audit prompt with the answer and retrieved passages, (4) parse the structured audit output, and (5) decide whether to deliver, retry, or escalate. For the audit call, use a model with strong instruction-following and structured output capabilities—GPT-4o, Claude 3.5 Sonnet, or equivalent. Set response_format to JSON mode or use structured output APIs to enforce the audit schema. The audit output should include at minimum: a list of claims extracted from the answer, per-claim source spans with passage IDs and quote excerpts, a binary supported/unsupported flag per claim, and an aggregate faithfulness score. Validate the output schema before proceeding—if the model fails to produce valid JSON or the claim count doesn't match the answer's sentence count, retry once with a simplified schema or escalate to human review.
Build a decision gate around the audit results. If the faithfulness score falls below your threshold (start with 0.85 and calibrate based on domain risk), do not deliver the answer to the user. Instead, either regenerate the answer with stricter grounding instructions, expand retrieval to pull more passages, or surface a qualified response that explicitly flags unsupported claims. For high-risk domains such as legal, medical, or financial applications, any unsupported claim should trigger human review regardless of the aggregate score. Log every audit result—claim-level support flags, source passage IDs, and the raw audit output—to enable traceability, regression testing, and prompt improvement over time. This audit trail is also your primary defense when stakeholders ask whether the AI's answers are actually grounded in evidence.
Common failure modes to instrument for: the audit prompt itself hallucinating source spans that don't exist in the provided passages (validate that every returned passage ID and quote excerpt actually appears in the input), the audit prompt missing subtle unsupported claims that are paraphrased rather than invented (use spot-check evals comparing audit results to human annotations), and the audit prompt being overly strict and flagging reasonable inferences as unsupported (tune your threshold and consider a severity scale: fully supported, partially supported, unsupported, contradicted). Run this audit prompt against a golden dataset of known-good and known-bad answer-passage pairs before deploying, and include it in your regression test suite so that prompt changes to either the generation or audit step are caught before they degrade grounding quality.
Expected Output Contract
Defines the exact shape, types, and validation rules for the Source-By-Source Synthesis Audit Report. Use this contract to parse the model output, run automated checks, and reject malformed responses before they reach downstream systems.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
audit_id | string (UUID v4) | Must match regex pattern for UUID v4. Reject if missing or malformed. | |
generated_answer | string | Must be non-empty. Must exactly match the answer under audit. Reject if truncated or altered. | |
source_passages | array of objects | Must contain at least 1 object. Each object must have source_id (string) and passage_text (string). Reject if empty array. | |
claim_audits | array of objects | Must contain at least 1 object. Each object must have claim_text (string), source_id (string or null), evidence_span (string or null), and support_level (enum: FULLY_SUPPORTED, PARTIALLY_SUPPORTED, UNSUPPORTED). Reject if any required field is missing. | |
claim_audits[].source_id | string or null | If support_level is FULLY_SUPPORTED or PARTIALLY_SUPPORTED, must be a non-null string matching a source_id in source_passages. If UNSUPPORTED, must be null. Reject on mismatch. | |
claim_audits[].evidence_span | string or null | If source_id is non-null, must be a verbatim substring of the corresponding passage_text. If source_id is null, must be null. Reject if span not found in passage. | |
unsupported_claims | array of strings | Must contain the claim_text of every claim_audit with support_level UNSUPPORTED. Reject if count mismatch or missing entries. | |
faithfulness_score | number (0.0 to 1.0) | Must be a float between 0.0 and 1.0 inclusive. Must equal (count of FULLY_SUPPORTED + PARTIALLY_SUPPORTED claims) / total claims. Reject if out of range or calculation mismatch. |
Common Failure Modes
What breaks first when running a source-by-source synthesis audit and how to guard against it.
Hallucinated Claim-to-Source Mappings
What to watch: The model fabricates a mapping between a claim and a source passage that does not actually support it. This happens when the model prioritizes producing a complete audit report over accuracy. Guardrail: Require the model to quote the exact evidence span for each claim. Add a secondary verification step that checks whether the quoted span semantically entails the claim.
False Negatives on Implicit Support
What to watch: The audit flags a claim as unsupported because the evidence is implicit or requires one logical inference step. This produces noisy reports that erode trust in the audit. Guardrail: Define explicit rules for what counts as support (direct statement, paraphrase, or single-hop inference). Include few-shot examples of implicit support that should be accepted.
Overclaiming Synthesis Faithfulness
What to watch: The audit assigns a high faithfulness score despite the answer introducing qualifiers, hedges, or causal claims absent from the sources. The model confuses fluent coherence with faithful synthesis. Guardrail: Break the audit into atomic checks per claim rather than a single holistic score. Require a binary supported/unsupported label before computing aggregate metrics.
Source Boundary Confusion
What to watch: The model attributes a claim to Source A when the evidence actually comes from Source B, especially when sources discuss similar topics. This corrupts provenance tracking. Guardrail: Assign each source a unique short ID and require the model to output the ID alongside every evidence span. Validate that the quoted text exists in the referenced source document.
Audit Drift on Long Answers
What to watch: The audit starts strong but degrades on later claims in a long answer, skipping checks or accepting weaker evidence as the context window fills. Guardrail: Chunk the answer into claim groups and audit each group independently. Use a fresh context window per chunk to prevent attention dilution.
Confidence Miscalibration
What to watch: The audit expresses high confidence in its own mappings even when the evidence-to-claim relationship is ambiguous. This creates a false sense of security for downstream reviewers. Guardrail: Require the audit to output a confidence level per claim mapping (high/medium/low) based on evidence specificity. Flag low-confidence mappings for human review.
Evaluation Rubric
Use this rubric to test the output quality of the Source-By-Source Synthesis Audit Prompt before shipping. Each criterion maps to a pass standard, a failure signal, and a test method that can be automated or run manually.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Claim-to-Source Mapping Completeness | Every claim in the generated answer maps to at least one source passage ID and evidence span | Audit report lists unmapped claims or claims mapped to a null source ID | Parse the audit report JSON; assert that the claims array length equals the number of claims in the answer and that no claim has an empty source_mappings array |
Evidence Span Accuracy | Each mapped evidence span is a verbatim substring of the cited source passage | A mapped span contains words not present in the source passage or is a paraphrase rather than a direct quote | For each claim mapping, perform an exact substring match of the evidence_span against the source passage text; flag any non-matching spans |
Unsupported Claim Flagging | All claims without supporting evidence are flagged with a support_level of unsupported and a confidence of 0.0 | An unsupported claim is marked as partially_supported or fully_supported, or has a confidence greater than 0.0 | Filter the audit report for claims where no source passage contains the claim's subject and predicate; assert support_level equals unsupported and confidence equals 0.0 |
Synthesis Faithfulness Score Calibration | The overall faithfulness_score is between 0.0 and 1.0 and equals the ratio of fully_supported claims to total claims | The faithfulness_score is 1.0 when unsupported claims exist, or the score does not match the claim-level support ratio | Calculate expected score as count(fully_supported claims) / count(total claims); assert the reported faithfulness_score equals the calculated value within a 0.01 tolerance |
Hallucination Detection | The audit report identifies any claim that introduces entities, numbers, or facts not present in any source passage | A fabricated detail appears in the answer but is not flagged as unsupported in the audit report | Extract all named entities and numeric values from the answer; for each, verify presence in at least one source passage; assert that any missing entity corresponds to an unsupported flag in the report |
Source Conflict Transparency | When two or more source passages contradict each other on a claim, the audit report notes the conflict and lists the conflicting source IDs | Contradictory sources are mapped to the same claim without a conflict flag, or the conflict is resolved by choosing one source without explanation | For each claim, compare the evidence spans from different sources; if spans are semantically contradictory, assert that the audit report includes a conflict_flag of true and lists both source IDs |
Output Schema Compliance | The audit report is valid JSON matching the specified schema with all required fields present and correctly typed | The output is missing required fields, contains fields of the wrong type, or is not parseable JSON | Validate the output against the JSON schema; assert all required fields are present, field types match the schema definition, and no extra fields exist outside the schema |
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 set of 3-5 source passages. Remove the strict JSON output schema and ask for a plain-text audit report instead. Use a single model call without retry logic. Focus on getting the claim-to-evidence mapping direction right before hardening the format.
Prompt modification
Replace the [OUTPUT_SCHEMA] placeholder with: "Return a bulleted list. For each claim in the answer, state whether it is SUPPORTED, PARTIALLY SUPPORTED, or UNSUPPORTED, and quote the relevant source span."
Watch for
- The model inventing source spans that don't exist in the passages
- Skipping claims that are implicit or paraphrased rather than verbatim
- Overly generous SUPPORTED labels for weak or tangential evidence

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