Inferensys

Prompt

Evidence Grounding Failure Mode Analysis Prompt

A practical prompt playbook for using Evidence Grounding Failure Mode Analysis Prompt in production AI workflows.
Elegant overhead shot of a polished wooden communal table in a sun-drenched WeWork lounge, laptops and tablets displaying AI workflow dashboards, plants and pendant lights in background.
PROMPT PLAYBOOK

When to Use This Prompt

A diagnostic tool for classifying grounding failure modes in cited answers and routing to the correct recovery action.

This prompt is a diagnostic tool for AI observability pipelines. Use it when a cited answer from a RAG system, document intelligence workflow, or any evidence-grounded generation fails validation. The failure could be a missing citation, an unsupported claim, a hallucinated source, or a quote that does not match its reference. Instead of blindly retrying the generation, this prompt classifies the specific grounding failure mode and recommends a targeted recovery action. It is designed for platform engineers, AI reliability teams, and MLOps engineers who need to route failures to the correct repair prompt, not for end-users.

This prompt assumes you have already captured three inputs: the failed answer text, the evidence or source passages provided to the model, and the validator error that flagged the output. Without all three, the classification will be unreliable. The prompt produces a structured failure mode label from a fixed taxonomy—such as missing_citation, unsupported_claim, hallucinated_source, quote_mismatch, or evidence_insufficient—along with a recommended recovery action and the name of the specific retry prompt to invoke next. This turns an opaque failure into a routable event.

Do not use this prompt when the failure is a format or schema error rather than a grounding problem. If the output is valid JSON with broken citations, use this prompt. If the output is malformed JSON that a parser rejects, use a structured output repair prompt instead. Do not use this prompt directly in a user-facing retry loop without a retry budget and escalation path. Repeated classification without recovery wastes compute and latency. Wire this prompt into a harness that invokes the recommended recovery prompt, re-validates the result, and escalates to human review after a defined number of attempts.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Evidence Grounding Failure Mode Analysis Prompt works and where it does not. This prompt is designed for observability and debugging, not for real-time answer correction.

01

Good Fit: Post-Hoc Failure Diagnosis

Use when: you have a logged failure from a RAG pipeline and need to classify the root cause before triggering a specific recovery prompt. Guardrail: Run this analysis before any automated retry to ensure the correct recovery strategy is selected.

02

Bad Fit: Real-Time Answer Correction

Avoid when: you need to fix an answer inline for an end-user. This prompt analyzes failure modes; it does not regenerate text. Guardrail: Route the classified failure mode to a dedicated recovery prompt (e.g., Missing Citation Retry) for the actual fix.

03

Required Inputs

Risk: Garbage-in, garbage-out analysis. The prompt requires the original user query, the generated answer, and the retrieved evidence list. Guardrail: Validate that all three inputs are present and non-empty before invoking the analysis. Log and escalate if inputs are missing.

04

Operational Risk: Taxonomy Drift

Risk: The failure mode taxonomy may become stale as new model behaviors or data patterns emerge. Guardrail: Periodically review a sample of classified failures to ensure the taxonomy still captures the majority of issues. Add new categories as needed.

05

Operational Risk: Analysis Latency

Risk: Adding a diagnostic step before recovery increases end-to-end latency. Guardrail: Set a timeout for the analysis step. If it fails or times out, fall back to a default recovery strategy (e.g., Answer Regeneration with Mandatory Citations) and log the analysis skip.

06

Operational Risk: Ambiguous Failures

Risk: A single failure may exhibit traits of multiple categories, leading to an unhelpful or mixed classification. Guardrail: Instruct the prompt to return a primary failure mode and a confidence score. Route to the primary recovery strategy but log secondary modes for future taxonomy refinement.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A ready-to-adapt prompt that classifies evidence grounding failures and routes to the correct recovery action.

This prompt template is designed to be wired into an AI observability or debugging harness. It receives a failed cited answer and its associated evidence, then diagnoses the primary grounding failure mode from a defined taxonomy. The output is a structured classification and a single recommended recovery action, not a regenerated answer. Use this when you need automated triage before invoking a specific repair prompt.

text
You are an evidence grounding auditor for a RAG system. Your job is to diagnose why a generated answer failed its citation and evidence checks. Do not regenerate the answer. Do not correct the facts. Classify the primary failure mode and recommend the single most appropriate recovery action.

## FAILED ANSWER
[FAILED_ANSWER]

## PROVIDED EVIDENCE PASSAGES
[EVIDENCE_PASSAGES]

## FAILURE TAXONOMY
Classify the primary failure into exactly one of the following modes:
- MISSING_CITATION: A factual claim lacks any citation.
- UNSUPPORTED_CLAIM: A cited claim is not supported by the referenced passage.
- QUOTE_INACCURACY: A direct quote does not match the source text.
- HALLUCINATED_SOURCE: A citation references a source not present in the provided evidence.
- SOURCE_CONFLICT: Multiple cited passages contradict each other without resolution.
- EVIDENCE_INSUFFICIENCY: The provided evidence is too thin to support the answer's claims.
- CITATION_DRIFT: A citation is attached to the wrong claim or paragraph.
- OVER_CITATION: A trivial or common-knowledge statement is unnecessarily cited.

## RECOVERY ACTION ROUTING
Based on the failure mode, recommend exactly one recovery action from this list:
- RETRY_WITH_CITATION_REQUIREMENT: Regenerate the answer with mandatory inline citations.
- RETRY_WITH_EVIDENCE_CONSTRAINT: Regenerate using only claims directly traceable to evidence.
- RETRY_WITH_QUOTE_VERIFICATION: Regenerate with exact quote matching against source text.
- RETRY_WITH_EXPANDED_RETRIEVAL: Re-retrieve with broader scope and regenerate.
- RETRY_WITH_CONFLICT_RESOLUTION: Reconcile conflicting sources and regenerate with disclosure.
- FLAG_FOR_HUMAN_REVIEW: Escalate to human review without retrying.
- ABSTAIN_WITH_EXPLANATION: Generate a refusal that explains the evidence gap.

## OUTPUT FORMAT
Return a single JSON object with these fields:
{
  "failure_mode": "<MODE>",
  "confidence": <0.0 to 1.0>,
  "evidence": "<Quote the specific text from the failed answer or evidence that supports this diagnosis>",
  "recommended_action": "<ACTION>",
  "action_rationale": "<One sentence explaining why this action is appropriate>"
}

## CONSTRAINTS
- Classify only the PRIMARY failure mode, even if multiple issues exist.
- The evidence field must contain a verbatim quote from the input.
- If you cannot determine the failure mode with confidence > 0.7, set failure_mode to "UNCLEAR" and recommended_action to "FLAG_FOR_HUMAN_REVIEW".

Adapt this template by replacing the taxonomy with your organization's specific failure categories. The recovery actions should map directly to retry prompts or escalation workflows you have implemented. For high-stakes domains like healthcare or legal, always route FLAG_FOR_HUMAN_REVIEW when confidence is below 0.9, not 0.7. Wire the output JSON into a routing engine that invokes the corresponding recovery prompt or queues the item for human review. Validate that the evidence field contains a substring match against the input before trusting the classification.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Evidence Grounding Failure Mode Analysis Prompt. Each variable must be populated before the prompt is sent. Missing or malformed inputs will cause misclassification and incorrect recovery routing.

PlaceholderPurposeExampleValidation Notes

[FAILED_ANSWER]

The generated answer that failed grounding validation

The new policy reduces coverage by 15% according to industry reports.

Must be non-empty string. Should be the raw model output before any post-processing or repair.

[RETRIEVED_EVIDENCE]

The set of source passages provided to the model during generation

[{"source_id": "doc_42", "text": "Coverage reduction of 12% was observed in Q3."}, {"source_id": "doc_88", "text": "Industry-wide trends show a 5-10% decline."}]

Must be a valid JSON array of objects with source_id and text fields. Null allowed if no evidence was provided.

[CITATION_MAP]

The expected or actual citation markers linking claims to sources

[{"claim": "reduces coverage by 15%", "cited_source": "doc_42", "citation_text": "[1]"}]

Must be valid JSON array. Each object requires claim and cited_source fields. citation_text is optional. Null allowed for uncited answers.

[FAILURE_SIGNAL]

The specific validator error or grounding check that triggered the analysis

citation_missing_for_claim OR unsupported_numeric_claim OR quote_boundary_mismatch

Must match one of the known failure signal codes in the taxonomy. Free-text descriptions should be normalized to a signal code before injection.

[GROUNDING_POLICY]

The organization's grounding rules that define acceptable evidence standards

Every factual claim must cite at least one source passage. Numeric claims require exact match or explicit source attribution.

Must be a non-empty string. Should be the canonical policy text used by validators, not an ad-hoc description.

[FAILURE_TAXONOMY]

The classification schema for grounding failure modes

["missing_citation", "unsupported_claim", "quote_inaccuracy", "source_conflict", "evidence_insufficiency", "hallucinated_source", "citation_drift", "over_citation"]

Must be a valid JSON array of failure mode strings. Should match the taxonomy used by downstream recovery routers.

[RECOVERY_OPTIONS]

Available recovery strategies that can be routed to after classification

[{"mode": "missing_citation", "action": "inline_citation_insertion_repair"}, {"mode": "unsupported_claim", "action": "unsupported_claim_correction"}]

Must be a valid JSON array of objects with mode and action fields. Each mode in the taxonomy should have at least one mapped action.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Evidence Grounding Failure Mode Analysis Prompt into a production observability or debugging pipeline.

This prompt is designed as a diagnostic step within a larger citation recovery harness, not as a standalone chat interaction. It should be invoked after a cited answer has failed a validation gate—such as a citation completeness check, a source-to-claim alignment verification, or a hallucinated source detection scan. The harness should pass the failed answer, the original retrieved evidence, and the specific validator error messages as inputs to this analysis prompt. The output is a structured failure classification and a recommended recovery route, which the harness then uses to select the next retry or escalation action.

Input assembly requires three components: the [FAILED_ANSWER] (the full generated text with its citations), the [RETRIEVED_EVIDENCE] (the source passages provided to the generation model, with identifiers), and the [VALIDATOR_ERRORS] (structured error objects from upstream validation, including the validator name, the failed claim or citation, and the reason for rejection). The prompt template expects these to be injected into the respective placeholders. For high-throughput systems, consider pre-processing the validator errors into a concise summary to stay within context window limits. Model choice should favor models with strong reasoning capabilities for classification tasks; a smaller, faster model may misclassify subtle failure modes like citation drift or evidence stretching.

Output validation is critical before routing. The prompt instructs the model to return a JSON object with failure_mode, confidence, affected_claims, and recommended_recovery. The harness must validate that failure_mode matches one of the entries in your defined taxonomy (e.g., missing_citation, unsupported_claim, hallucinated_source, quote_inaccuracy, source_conflict, evidence_insufficiency). If the model returns an unknown failure mode or a confidence score below your threshold (e.g., < 0.7), do not route to an automated recovery prompt. Instead, escalate to a human review queue with the full analysis payload. This prevents a misdiagnosis from triggering an inappropriate retry loop that wastes compute and degrades the answer further.

Recovery routing uses the recommended_recovery field to select the next prompt in your playbook. Map each recovery type to a specific retry prompt: regenerate_with_citations routes to the Answer Regeneration with Mandatory Citations Prompt; correct_unsupported_claims routes to the Unsupported Claim Correction Prompt; resolve_source_conflict routes to the Source Conflict Resolution Prompt; expand_retrieval routes to the Retry with Expanded Retrieval Window Prompt; and abstain routes to the Answer Abstention with Evidence Explanation Prompt. Implement a retry budget that tracks how many times a given answer has been through the analysis-recovery loop. After a configurable maximum (e.g., 3 attempts), break the cycle and escalate to a human operator with the full trace of failure modes and recovery actions attempted.

Observability requires logging the full input and output of this analysis prompt at each invocation. Attach the failure_mode, confidence, and recommended_recovery as span attributes in your tracing system. This data is essential for identifying systemic grounding weaknesses—for example, if a specific retrieval source consistently triggers evidence_insufficiency, or if a particular model version exhibits a spike in hallucinated_source classifications. Use these aggregate signals to improve your retrieval pipeline, fine-tune your generation prompts, or adjust your validation thresholds, rather than treating each failure as an isolated incident.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structured JSON output expected from the Evidence Grounding Failure Mode Analysis Prompt. Use this contract to validate the model's response before routing to a recovery action.

Field or ElementType or FormatRequiredValidation Rule

failure_mode

enum string

Must match one of the predefined failure taxonomy values: MISSING_CITATION, UNSUPPORTED_CLAIM, QUOTE_INACCURACY, SOURCE_CONFLICT, EVIDENCE_INSUFFICIENCY, HALLUCINATED_SOURCE, CITATION_DRIFT, OVER_CITATION, ATTRIBUTION_ERROR

severity

enum string

Must be one of: CRITICAL, HIGH, MEDIUM, LOW. CRITICAL reserved for fabricated sources or safety-impacting claims.

confidence

number

Float between 0.0 and 1.0. Values below 0.7 should trigger human review if severity is HIGH or CRITICAL.

affected_claims

array of objects

Each object must contain claim_text (string), source_passage_id (string or null), and citation_text (string or null). Array must not be empty.

root_cause_analysis

string

Must be a non-empty string explaining why the failure occurred, referencing specific evidence gaps or retrieval failures.

recommended_recovery_action

enum string

Must be one of: REGENERATE_WITH_CITATIONS, CORRECT_QUOTES, RESOLVE_CONFLICT, EXPAND_RETRIEVAL, ABSTAIN, FLAG_FOR_HUMAN_REVIEW, ESCALATE. Must align with the diagnosed failure_mode.

recovery_prompt_id

string or null

If a specific recovery prompt is recommended, provide its ID from the recovery prompt library. Null if no single prompt applies.

requires_human_review

boolean

Must be true if severity is CRITICAL, confidence is below 0.5, or failure_mode is HALLUCINATED_SOURCE. Otherwise false.

PRACTICAL GUARDRAILS

Common Failure Modes

Evidence grounding failures erode user trust and create compliance risk. These cards cover the most common failure modes when analyzing citation and evidence quality, why they happen, and how to guard against them in production.

01

Misclassification of Failure Type

What to watch: The analysis prompt confuses a missing citation with an unsupported claim, or labels a quote inaccuracy as a source conflict. This routes the recovery to the wrong retry path, wasting retry budget and failing to fix the root cause. Guardrail: Include a failure taxonomy with mutually exclusive definitions and require the model to cite the specific evidence passage that justifies its classification before recommending a recovery action.

02

Over-Confident Failure Diagnosis

What to watch: The analysis assigns high confidence to a failure mode classification even when the evidence is ambiguous, leading to aggressive recovery actions that degrade the answer rather than repair it. Guardrail: Require the prompt to output a confidence score for each failure classification and route low-confidence diagnoses to human review or a conservative fallback instead of automated recovery.

03

Recovery Recommendation Drift

What to watch: The analysis correctly identifies a grounding failure but recommends a recovery action that doesn't match the failure type—for example, suggesting expanded retrieval for a quote accuracy problem instead of quote verification. Guardrail: Use a structured mapping table in the prompt that ties each failure mode to exactly one primary recovery strategy and one fallback, and validate the recommendation against this mapping before execution.

04

Evidence Blindness in Analysis

What to watch: The analysis prompt itself hallucinates or misreads the provided evidence when diagnosing the failure, creating a recursive grounding problem where the fix is based on a faulty diagnosis. Guardrail: Require the analysis to quote the specific source text it relies on for each diagnostic claim, and run a secondary verification check that the quoted text actually exists in the provided evidence before accepting the diagnosis.

05

Taxonomy Boundary Collapse

What to watch: The failure taxonomy categories bleed into each other in edge cases—for example, a partially supported claim could be classified as either 'unsupported claim' or 'evidence insufficiency' depending on the threshold. Inconsistent classification across similar failures undermines recovery reliability. Guardrail: Define explicit decision boundaries with examples in the prompt, including tie-breaking rules for overlapping categories, and log boundary cases for periodic taxonomy review.

06

Retry Loop from Incorrect Recovery Routing

What to watch: A misclassified failure triggers the wrong recovery prompt, which fails to fix the issue, which triggers another analysis, which may misclassify again—creating a retry loop that burns budget without improving the answer. Guardrail: Implement a recovery attempt counter that escalates to a human reviewer or a conservative abstention after two failed recovery cycles, and log the full diagnosis-recovery chain for debugging.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to evaluate the output of the Evidence Grounding Failure Mode Analysis Prompt before shipping. Each criterion targets a specific failure mode classification or recovery recommendation that must be correct for the analysis to be actionable.

CriterionPass StandardFailure SignalTest Method

Failure Mode Classification

Output selects exactly one primary failure mode from the defined taxonomy (e.g., missing_citation, unsupported_claim, quote_inaccuracy, source_conflict, evidence_insufficiency, hallucinated_source, citation_drift)

Output selects multiple primary modes, invents a mode not in the taxonomy, or fails to select any mode

Parse output for failure_mode field; assert value is in allowed enum list and exactly one value is present

Evidence Gap Identification

Output lists specific, verifiable evidence gaps by referencing exact claim IDs or text spans from the failed answer that lack source support

Output describes gaps in vague terms without referencing specific claims, or identifies gaps that are actually supported by provided evidence

Cross-reference gap_list claim IDs against the input failed answer; verify each flagged claim is genuinely unsupported by the input evidence passages

Root Cause Attribution

Output attributes the failure to a specific stage in the pipeline (retrieval, generation, citation insertion, source mapping) with a concrete reason

Output blames the model generically without identifying the pipeline stage, or attributes the failure to a stage that could not have caused the observed error pattern

Manual review by a prompt engineer: does the root cause explanation match the failure mode and evidence gap pattern?

Recovery Action Routing

Output recommends a specific recovery prompt or action from the available recovery library that matches the classified failure mode

Output recommends a recovery action designed for a different failure mode, or suggests a generic 'regenerate' without specifying which recovery prompt to use

Assert recovery_action field matches a valid recovery prompt slug; verify the slug is appropriate for the classified failure_mode using a lookup table

Retry Budget Assessment

Output includes a retry_count assessment and a boolean escalate flag that is true when retry_count exceeds the configured budget or when the failure mode is non-recoverable

Output always sets escalate to false regardless of retry count, or fails to include retry budget fields

Parse retry_count and escalate fields; assert escalate is true when retry_count > [MAX_RETRIES] or when failure_mode is in [NON_RECOVERABLE_MODES]

Confidence Score Calibration

Output assigns a grounding_confidence score between 0.0 and 1.0 that correlates with the severity of the evidence gap (lower scores for more severe gaps)

Output assigns high confidence to answers with severe evidence gaps, or assigns scores outside the 0.0-1.0 range

Run a calibration test set of 20 known failure cases with pre-labeled severity; assert Spearman correlation between confidence scores and severity labels is above 0.7

Human Review Flagging Accuracy

Output sets human_review_required to true when the failure mode is hallucinated_source, source_conflict, or when confidence is below [REVIEW_THRESHOLD]

Output sets human_review_required to false for hallucinated sources or high-severity conflicts, or sets it to true for trivial missing-citation cases that auto-repair can fix

Assert human_review_required matches expected boolean for each failure mode in a golden test set of 15 cases

Output Schema Compliance

Output is valid JSON matching the expected schema with all required fields present and no extra fields

Output is missing required fields, contains fields not in the schema, or is not parseable JSON

Validate output against JSON Schema; assert all required fields are present and no additional properties exist

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single failure example and a simplified taxonomy (3-4 categories). Run against a small set of known failures to validate the classification logic before expanding. Keep the output schema flat—just failure_mode and recovery_action.

code
Analyze this failed cited answer and classify the grounding failure.

[FAILED_ANSWER]
[RETRIEVED_EVIDENCE]

Return JSON:
{
  "failure_mode": "missing_citation | unsupported_claim | quote_error | source_conflict",
  "recovery_action": "regenerate_with_citations | abstain | re_retrieve | reconcile"
}

Watch for

  • Overly broad classifications that don't distinguish between missing citations and unsupported claims
  • No validation that the classified failure mode actually matches the evidence
  • Single-turn analysis without considering multi-step recovery paths
Prasad Kumkar

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.