Inferensys

Prompt

Self-Correction Prompt for Ungrounded Claims

A practical prompt playbook for using Self-Correction Prompt for Ungrounded Claims in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise conditions, required inputs, and system prerequisites for deploying the self-correction prompt, and clarifies when it should not be used.

This prompt is designed for the correction phase of a RAG pipeline, specifically after an initial answer has been generated and a grounding verification step has identified specific claims that lack support in the source evidence. Its job is to produce a revised answer by removing or explicitly caveating those ungrounded claims, without introducing new fabrications or altering the structure of well-supported content. The ideal user is an AI engineer or product developer who already has a list of failed claims from a fact-verification or hallucination-detection module and needs a reliable, automated correction step before the answer reaches the user.

Do not use this prompt as a standalone answer-generation prompt. It assumes a prior answer and a verification report exist as inputs. Using it without a verified list of ungrounded claims will likely result in the model 'fixing' a non-existent problem, potentially degrading a perfectly good answer. The prompt is also not a substitute for a robust grounding verification step; if your upstream hallucination detector has low recall, this correction step will only patch a subset of the issues. For high-stakes domains like healthcare or legal, the output of this prompt should still pass through a human review stage, as the correction itself can introduce subtle semantic drift or new, unsupported caveats.

Before integrating this prompt, ensure your pipeline produces a structured verification report that maps specific claims to their source evidence and flags failures. The prompt is most effective when the list of ungrounded claims is precise, referencing exact sentences or clauses from the original answer. If your verification step only provides a vague 'confidence score' without claim-level detail, use a claim extraction and source verification prompt first to generate the necessary granular report. The next section provides the copy-ready template you can adapt for your specific output schema and correction policy.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Self-Correction Prompt for Ungrounded Claims works and where it introduces new risks. Use these cards to decide if this prompt belongs in your RAG pipeline or if you need a different approach.

01

Good Fit: Post-Generation Verification Loops

Use when: You already have a RAG pipeline that generates answers and a separate verification step that checks claims against source evidence. This prompt shines as the correction step after verification flags unsupported statements. Guardrail: Always run verification before correction. Never feed the correction prompt unverified claims or it will hallucinate what needs fixing.

02

Bad Fit: Real-Time Chat Without Verification

Avoid when: You need sub-second responses and have no verification layer in place. Self-correction without verification is just the model guessing what might be wrong, which often introduces new fabrications. Guardrail: If latency matters more than accuracy, use a stricter initial grounding prompt instead of a correction loop.

03

Required Inputs: Verification Report with Source Mapping

Risk: Feeding the correction prompt only the original answer and context without structured verification results leads to superficial edits that don't actually fix grounding issues. Guardrail: The prompt requires a claim-by-claim verification report with explicit source evidence matches and mismatch flags. Without this structured input, correction quality collapses.

04

Operational Risk: Correction Introduces New Hallucinations

Risk: The model may remove an unsupported claim but replace it with a different unsupported claim that sounds more plausible. This is the most common failure mode in self-correction loops. Guardrail: Run verification again on the corrected output. Treat correction as a generation step that needs its own grounding check, not as a final fix.

05

Operational Risk: Over-Correction and False Abstention

Risk: The model may remove claims that were actually supported because the verification report was ambiguous or the model became overly cautious. This degrades answer usefulness. Guardrail: Include explicit instructions to preserve claims that pass verification. Use eval metrics that measure both hallucination recall and false abstention rate.

06

Pipeline Fit: Requires Human Review for High-Stakes Domains

Risk: In healthcare, legal, or financial applications, automated correction loops can silently change meaning in ways that create liability. Guardrail: For regulated domains, route corrected answers to a human review queue before delivery. The correction prompt should flag what changed and why, creating an audit trail for reviewers.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

Paste this template into your correction node. Square-bracket placeholders must be replaced by your application logic before sending to the model.

This template implements a self-correction loop for RAG answers that failed grounding verification. It receives the original answer alongside a structured list of claims that were flagged as unsupported by your verification step. The model's job is to produce a revised answer that removes or explicitly caveats every flagged claim without introducing new fabrications or silently dropping verified content. Use this when your verification node has already identified specific grounding failures and you need a corrected answer for the user rather than a total regeneration from scratch.

text
SYSTEM: You are an answer correction specialist. Your only job is to revise a previously generated answer to remove or caveat claims that failed source verification. You must preserve all verified content exactly as written. You must not add new factual claims, examples, or details that were not present in the original answer and explicitly verified.

INPUT:
- Original answer: [ORIGINAL_ANSWER]
- Retrieved context used for verification: [RETRIEVED_CONTEXT]
- Unsupported claims (these failed verification): [UNSUPPORTED_CLAIMS_LIST]
- Verification notes: [VERIFICATION_NOTES]

INSTRUCTIONS:
1. For each unsupported claim, either remove it entirely or rewrite it with an explicit caveat that states the claim could not be verified against the provided sources.
2. Preserve all other content from the original answer without modification.
3. Maintain the original answer's structure, tone, and formatting.
4. If removing a claim creates a gap in the answer's flow, add a brief transitional phrase but do not introduce new factual content.
5. If all claims are unsupported, respond with a structured abstention: "I cannot provide a verified answer based on the available sources."
6. Output only the revised answer. Do not include explanations, commentary, or meta-analysis.

OUTPUT FORMAT: Plain text matching the original answer's style.

CONSTRAINTS:
- Do not add claims, statistics, dates, names, or factual assertions not present in the original verified content.
- Do not paraphrase verified claims in a way that changes their meaning.
- Do not speculate about why claims failed verification.
- If a caveat is added, use language like "[Note: this claim could not be verified against the provided sources]" or "[Unverified]" before the claim.

Replace each square-bracket placeholder before sending this prompt to the model. [ORIGINAL_ANSWER] should contain the full text of the answer that failed verification. [RETRIEVED_CONTEXT] should include the evidence passages used during verification so the model understands what was available. [UNSUPPORTED_CLAIMS_LIST] must be a structured list of the specific claims that your verification step flagged, ideally with the exact claim text and the reason it failed. [VERIFICATION_NOTES] can include any additional signals from your verification pipeline such as confidence scores, partial matches, or ambiguous cases. If your verification step produces a JSON payload, serialize the relevant fields into these placeholders before assembly. For high-stakes domains, route the revised answer to a human reviewer before returning it to the user and log both the original and corrected versions for audit.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the self-correction prompt to verify and revise ungrounded claims against source evidence. Each placeholder must be populated before the prompt is assembled and sent to the model.

PlaceholderPurposeExampleValidation Notes

[ORIGINAL_ANSWER]

The full answer text that may contain ungrounded claims and requires verification

The Acme 3000 processor achieves 4.2 TFLOPS in benchmark tests and is 40% faster than the previous generation.

Must be non-empty string. Check length under model context limit. Contains the claims to be verified against evidence.

[RETRIEVED_EVIDENCE]

Source passages retrieved from the knowledge base that should support or refute claims in the original answer

Passage 1: The Acme 3000 achieves 3.8 TFLOPS in standard benchmarks. Passage 2: Performance improvement over Acme 2000 is 22% in single-threaded workloads.

Must contain at least one passage. Validate retrieval completeness before passing. Null or empty triggers abstention path instead of correction.

[CLAIM_EXTRACTION_RESULT]

Pre-extracted list of individual factual claims from the original answer, each mapped to a claim ID for traceability

Claim 1: achieves 4.2 TFLOPS. Claim 2: 40% faster than previous generation. Claim 3: benchmark tests were used.

Must be structured as claim ID to claim text mapping. If null, prompt should include instruction to extract claims first. Validate claim count matches answer complexity.

[GROUNDING_VERIFICATION_RESULT]

Per-claim verification output showing which claims are supported, unsupported, or contradicted by evidence

Claim 1: CONTRADICTED (evidence shows 3.8 TFLOPS). Claim 2: UNSUPPORTED (no comparison data found). Claim 3: SUPPORTED.

Must include status for every claim. Status values must be from controlled vocabulary: SUPPORTED, UNSUPPORTED, CONTRADICTED, PARTIALLY_SUPPORTED. Null statuses are invalid.

[CORRECTION_POLICY]

Rules defining how to handle each verification status: remove, caveat, correct with evidence, or flag for human review

CONTRADICTED: correct with evidence value. UNSUPPORTED: add explicit caveat. SUPPORTED: retain as-is. PARTIALLY_SUPPORTED: retain with qualifier.

Must map every possible verification status to an action. Missing mappings cause inconsistent corrections. Validate against allowed actions: REMOVE, CAVEAT, CORRECT, RETAIN, FLAG_FOR_REVIEW.

[OUTPUT_FORMAT]

Schema defining the structure of the corrected answer including revised text, change log, and remaining uncertainty flags

JSON with fields: revised_answer, changes (array of {claim_id, original, revised, action, evidence_citation}), unresolved_claims (array of claim_ids), confidence_score.

Must be a valid schema definition. Validate that required fields include revised answer text and per-claim change tracking. Missing change log prevents audit trail.

[MAX_REVISION_ATTEMPTS]

Integer limit on correction loop iterations to prevent infinite retry cycles when verification keeps failing

3

Must be positive integer between 1 and 5. Higher values risk cost escalation. Lower values may leave claims uncorrected. Default to 3 if not specified.

[HUMAN_REVIEW_THRESHOLD]

Confidence score below which the corrected answer should be routed for human review instead of returned to user

0.7

Must be float between 0.0 and 1.0. Answers with unresolved claims or low overall confidence below this threshold trigger escalation. Null means no automatic escalation.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the self-correction prompt into a RAG pipeline with automated verification, retry logic, and human review gates.

The self-correction prompt for ungrounded claims is not a standalone prompt—it is a recovery step inside a grounding verification loop. The typical harness flow is: (1) generate an initial answer from retrieved context, (2) run a hallucination detection or claim extraction prompt that maps each factual claim to source evidence, (3) collect the list of claims that failed source verification, and (4) feed the original answer plus the failed-claim list into this self-correction prompt. The output is a revised answer that removes or caveats unsupported claims. This prompt should never be the first step in a pipeline; it assumes a prior verification pass has already identified specific grounding failures.

Wire this prompt into your application as a conditional recovery step, not a default path. After the hallucination detection step returns a failed_claims array, check whether the array is non-empty. If empty, bypass self-correction and return the original answer. If non-empty, construct the prompt input with three required fields: [ORIGINAL_ANSWER] (the full answer text from the initial generation), [FAILED_CLAIMS] (a structured list of claims that could not be grounded, each with the claim text and the reason verification failed), and [RETRIEVED_CONTEXT] (the original source passages, so the model can re-check whether any claim can be salvaged with a different citation). Set [CORRECTION_MODE] to either REMOVE (excise unsupported claims entirely) or CAVEAT (retain claims but add explicit uncertainty language). For high-stakes domains, default to REMOVE and require human review before CAVEAT mode is used. Log every correction event with the original answer, failed claims, revised answer, and a diff for auditability.

Build validation and retry guardrails around this step. After the self-correction prompt returns a revised answer, run the same hallucination detection prompt against the revised output to verify that all previously flagged claims were actually removed or caveated. If the revised answer still contains ungrounded claims, increment a retry counter and re-invoke self-correction with the updated failed-claim list. Set a hard retry limit (typically 2-3 attempts). If the limit is exceeded, escalate to a human review queue with the full correction history. Additionally, run a 'new fabrication' check: compare the revised answer's claims against the original answer to detect whether the correction step introduced entirely new unsupported statements. This is a known failure mode where the model fills gaps left by removed claims with fresh fabrications. If new fabrications are detected, treat this as a critical failure and escalate immediately rather than retrying.

Model choice matters for this workflow. Self-correction prompts require strong instruction-following and low hallucination rates under correction pressure. Prefer models with explicit grounding training or verified low fabrication rates in RAG benchmarks. Avoid smaller or older models that tend to 'fill silence' when asked to remove content—they often replace removed claims with plausible-sounding alternatives. For production deployments, pair this prompt with structured output constraints (request JSON with revised_answer, removed_claims, caveated_claims, and modification_summary fields) so you can programmatically verify the correction rather than relying on free-text parsing. If your pipeline uses multiple models for cost optimization, route self-correction requests to your highest-quality model regardless of the model used for initial answer generation.

When deploying in regulated or high-risk domains, add a human review gate after self-correction. The review packet should include: the user's original question, the retrieved context passages, the initial answer, the hallucination detection results, the self-correction prompt input and output, and any retry history. Human reviewers should confirm that removed claims were genuinely unsupported (not just poorly cited), that caveated claims carry appropriate uncertainty language, and that no new fabrications were introduced. Track metrics including correction trigger rate, first-pass correction success rate, retry escalation rate, new fabrication rate, and human review overturn rate. These metrics will tell you whether your grounding verification is too aggressive (flagging claims that are actually supported), too lenient (missing fabrications), or whether the self-correction step itself is introducing quality regressions.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structure, types, and validation rules for the corrected answer produced by the self-correction prompt. Use this contract to parse and verify the model's output before it reaches the user or the next pipeline stage.

Field or ElementType or FormatRequiredValidation Rule

corrected_answer

string

Must be non-empty. Must not contain any claim flagged as ungrounded in the input [VERIFICATION_REPORT] unless that claim is now explicitly caveated with an uncertainty qualifier (e.g., 'The source does not confirm...').

correction_summary

array of objects

Each object must have the keys 'original_claim' (string), 'verification_result' (string, one of: 'removed', 'caveated', 'retained'), and 'action_rationale' (string). The array length must match the number of claims in the [VERIFICATION_REPORT] that were not verified.

correction_summary[].original_claim

string

Must be an exact, verbatim substring from the original [DRAFT_ANSWER] that was flagged as ungrounded.

correction_summary[].verification_result

enum: ['removed', 'caveated', 'retained']

Must be a valid enum value. 'retained' is only allowed if new, valid grounding evidence was found in the [CONTEXT] that was missed by the verifier, and this must be explained in 'action_rationale'.

new_claims_introduced

array of strings

If present, each string is a factual claim in the 'corrected_answer' that was not in the original 'draft_answer'. An empty array or null is acceptable. A non-empty array should trigger a secondary grounding check.

abstention_flag

boolean

Must be true if the entire 'corrected_answer' is a refusal or abstention message because no claims could be verified. Otherwise, false. If true, 'corrected_answer' must not contain any substantive claims.

PRACTICAL GUARDRAILS

Common Failure Modes

Self-correction prompts introduce a second inference pass to remove or caveat ungrounded claims. This loop can fail in predictable ways. Here are the most common failure modes and how to guard against them.

01

Correction Introduces New Fabrications

What to watch: The model removes an ungrounded claim but replaces it with a different unsupported statement to maintain fluency. The correction pass becomes a new source of hallucination. Guardrail: Run the same grounding verification prompt against the corrected output. Compare claim sets before and after correction. Flag any new claims that lack source evidence.

02

Over-Correction Removes Grounded Claims

What to watch: The model becomes overly aggressive, stripping claims that were actually supported by the evidence. This produces answers that are faithful but incomplete, eroding user trust. Guardrail: Track claim retention rate. Compare the set of grounded claims in the original answer against the corrected answer. Alert if grounded claims are removed without justification.

03

Correction Loop Never Converges

What to watch: Each correction pass triggers new verification failures, creating an infinite loop. The system burns tokens and latency without reaching a stable answer. Guardrail: Set a hard maximum of two correction passes. After the second pass, if verification still fails, escalate to a human review queue with the original answer, evidence, and failure history attached.

04

Caveat Language Becomes Meaningless

What to watch: The model hedges every claim with vague language like 'may indicate' or 'could suggest,' even when evidence is strong. The answer becomes so qualified that it provides no actionable information. Guardrail: Define explicit caveat tiers in the correction prompt. Require the model to match caveat strength to evidence quality. Validate caveat distribution against human-annotated certainty benchmarks.

05

Source Attribution Drifts During Correction

What to watch: The correction pass rephrases claims and breaks the original citation anchors. Surviving grounded claims lose their source links, making the corrected answer unauditable. Guardrail: Require the correction prompt to preserve or regenerate citation anchors for every retained claim. Run a citation coverage check on the corrected output before delivery.

06

Correction Prompt Ignores Verification Signals

What to watch: The verification step returns structured failure data, but the correction prompt treats it as noise and rewrites the answer without addressing specific flagged claims. Guardrail: Pass verification results as structured input (claim ID, failure reason, source evidence) rather than free-text feedback. Use a schema that forces the correction prompt to address each flagged claim explicitly.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for evaluating the quality of a self-corrected answer after an ungrounded claim removal pass. Use this rubric to gate the corrected output before it reaches the user or proceeds to the next pipeline stage.

CriterionPass StandardFailure SignalTest Method

Claim Removal Completeness

All claims flagged as UNSUPPORTED in the verification report are removed or explicitly caveated in the revised answer.

The revised answer retains a claim that was previously flagged as having no supporting evidence.

Automated diff check between the original flagged claims list and the revised answer text using an LLM judge or substring match.

No New Fabrications

The revised answer introduces zero new factual claims that are not present in the original answer or the provided [SOURCE_CONTEXT].

A new specific entity, statistic, or causal relationship appears in the revised answer that cannot be mapped back to the original text or sources.

Run the hallucination detection prompt on the revised answer against [SOURCE_CONTEXT] and compare extracted claims to the original answer's claim set.

Surviving Claim Fidelity

Claims not flagged for removal remain semantically unchanged and are still correctly grounded in [SOURCE_CONTEXT].

A previously correct claim was reworded into a false or misleading statement during the correction pass.

Semantic similarity check (e.g., BERTScore > 0.95) between the original and revised versions of each surviving claim.

Caveat Quality

Where a claim is caveated instead of removed, the caveat accurately reflects the specific evidence gap (e.g., 'The source does not specify the release date').

The caveat is generic ('This might be inaccurate') or misrepresents the reason for uncertainty.

LLM-as-judge evaluation comparing the caveat text against the specific gap description in the verification report.

Structural Integrity

The revised answer maintains the required [OUTPUT_SCHEMA] structure, including all required fields like citations, confidence scores, and abstention flags.

The correction pass drops a required field, malforms the JSON, or strips inline citation anchors from surviving claims.

Schema validation against the [OUTPUT_SCHEMA] definition; parse check for JSON validity.

Abstention Consistency

If all claims were removed, the output is a valid abstention response matching the [ABSTENTION_FORMAT] contract.

The output is an empty string, a generic error message, or a fabricated answer when all claims were unsupported.

Assert that when the claim removal rate is 100%, the output strictly conforms to the abstention schema defined in the system prompt.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base self-correction prompt and a single verification pass. Use a lightweight schema that asks the model to list unsupported claims and produce a corrected answer. Keep the verification criteria simple: flag claims that cannot be directly matched to a source passage.

code
Review the answer below against the provided sources.
For each claim that lacks direct source support, mark it as [UNSUPPORTED].
Then produce a corrected answer that removes or caveats those claims.

Sources: [SOURCES]
Answer: [DRAFT_ANSWER]

Watch for

  • The model removing claims that are actually supported but phrased differently
  • Over-correction that strips useful synthesis along with fabrications
  • No mechanism to detect new fabrications introduced during correction
  • Missing structured output, making automated downstream checks impossible
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.