Inferensys

Prompt

Evidence Sufficiency Gate Prompt for RAG Outputs

A practical prompt playbook for using Evidence Sufficiency Gate Prompt for RAG Outputs 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 operational boundaries for deploying an Evidence Sufficiency Gate in a RAG pipeline, including ideal use cases, required inputs, and scenarios where it should not be used.

This prompt acts as a pre-generation circuit breaker. Its job-to-be-done is to prevent the language model from attempting to synthesize an answer when the retrieved context is insufficient, irrelevant, or contradictory. The ideal user is an AI engineer or platform operator responsible for the factual reliability of a RAG system, particularly in high-stakes domains like healthcare, legal, finance, or compliance, where the cost of a hallucinated answer far exceeds the cost of declining to answer. You should use this gate when your retrieval pipeline is noisy, when your knowledge base has coverage gaps, or when user queries frequently fall outside the scope of your indexed documents. It is a critical component for building retrieval quality monitors and automated guardrails that run before answer generation, not after.

To use this gate effectively, you must provide it with the user's original query and the complete, unmodified set of retrieved evidence chunks (including their metadata, such as document IDs or relevance scores). The prompt does not perform retrieval itself; it assumes you have already executed your search, vector, or hybrid retrieval step. The gate's output should be a structured decision—typically a boolean or categorical label like SUFFICIENT, INSUFFICIENT, or CONTRADICTORY—along with a concise rationale. This structured output allows your application logic to branch cleanly: proceed to answer generation, trigger a re-retrieval with an expanded query, or surface a 'cannot answer' message to the user with a specific reason (e.g., 'No relevant information found' vs. 'Sources contradict each other'). In high-risk deployments, log the gate's decision and rationale alongside the final answer for auditability.

Do not use this prompt as a substitute for improving your retrieval pipeline. If your retrieval consistently returns poor results, the gate will correctly block answers, but the user experience will degrade into a system that rarely responds. The gate is a safety net, not a retrieval fix. Also, avoid using this prompt for open-ended creative tasks, chitchat, or scenarios where the model is expected to use its own parametric knowledge. The gate is designed for strict evidence-grounded Q&A. Finally, do not rely on this gate alone for factual accuracy; it checks for evidence sufficiency, not for the correctness of the evidence itself. A downstream hallucination detection or fact-verification step is still required for a complete quality assurance pipeline.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Evidence Sufficiency Gate Prompt works and where it does not. Use these cards to decide if this pre-generation gate fits your RAG architecture and operational constraints.

01

Good Fit: Pre-Generation Quality Gate

Use when: you need a binary go/no-go decision before answer generation. The prompt excels at preventing the system from attempting to answer when retrieved context is thin, irrelevant, or contradictory. Guardrail: Wire the gate's output to a routing decision—if evidence is insufficient, trigger re-retrieval, query expansion, or a graceful 'I cannot answer' response instead of proceeding to generation.

02

Bad Fit: Real-Time Latency Budgets Under 500ms

Avoid when: your RAG pipeline has a strict sub-500ms end-to-end latency budget. Adding a separate LLM call for evidence sufficiency assessment introduces an extra inference step that can double response time. Guardrail: For low-latency systems, consider a lightweight heuristic gate (e.g., retrieval score threshold, chunk count minimum) or run the sufficiency check asynchronously for offline monitoring rather than inline gating.

03

Required Input: Retrieved Context with Metadata

What to watch: The prompt cannot assess sufficiency without the actual retrieved passages and the original user question. Passing only retrieval scores or document IDs produces unreliable verdicts. Guardrail: Always include the full text of retrieved chunks, their relevance scores, and the raw user query. Structure the input so the model can compare question intent against evidence content, not just metadata.

04

Operational Risk: Gate Becomes a Bottleneck

What to watch: If the sufficiency gate is too conservative, it blocks legitimate answers and creates user friction. If too permissive, it passes inadequate context and downstream hallucination increases. Guardrail: Calibrate the gate's threshold using a labeled dataset of sufficient/insufficient context pairs. Monitor the gate's pass rate and false-positive/false-negative rates in production. Implement an override path for human review of blocked answers.

05

Good Fit: High-Stakes Domains with Audit Requirements

Use when: you operate in healthcare, legal, finance, or compliance where answering from inadequate evidence carries regulatory or safety risk. The gate provides an auditable decision point that can be logged as evidence of due diligence. Guardrail: Log every gate decision with the input context, the sufficiency verdict, and the model's reasoning. This creates an audit trail showing that the system checked evidence quality before responding.

06

Bad Fit: Single-Chunk Retrieval Without Reranking

Avoid when: your retrieval pipeline returns only one chunk without reranking or diversity optimization. The gate will frequently flag insufficient evidence because a single passage rarely covers all aspects of a complex question. Guardrail: Before deploying the gate, ensure your retrieval pipeline returns multiple diverse chunks (5-10) and includes a reranking step. The gate assesses collective sufficiency, so it needs a reasonable evidence pool to evaluate.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready system prompt that gates answer generation on evidence sufficiency, outputting a structured verdict before the system commits to a response.

This prompt acts as a pre-generation gate in your RAG pipeline. Before your system spends tokens synthesizing an answer, it evaluates whether the retrieved context is collectively sufficient to address the user's question. The prompt forces a binary decision with a confidence score and actionable reasoning, making it suitable for automated decision points where you need to either proceed with generation, trigger re-retrieval, or escalate to a human. Use this when the cost of a wrong answer exceeds the cost of saying "I don't have enough information."

text
You are an evidence sufficiency evaluator for a retrieval-augmented generation system. Your job is to determine whether the provided evidence is sufficient to answer the user's question accurately and completely. Do not answer the question itself. Only assess the evidence.

## INPUT

**User Question:**
[QUESTION]

**Retrieved Evidence:**
[EVIDENCE]

## EVALUATION CRITERIA

Assess the evidence against these criteria:
1. **Coverage:** Does the evidence address all parts of the question? If the question has multiple sub-questions, each must be covered.
2. **Specificity:** Is the evidence specific enough to produce a precise answer, or is it vague, tangential, or only partially relevant?
3. **Consistency:** If multiple evidence passages are provided, are they consistent with each other? Flag contradictions.
4. **Recency:** If the question implies a time constraint, is the evidence current enough?
5. **Authority:** Does the evidence come from a source that should know the answer, or is it speculative, opinion-based, or from an unreliable context?

## OUTPUT FORMAT

Return a JSON object with the following schema:

```json
{
  "decision": "SUFFICIENT" | "INSUFFICIENT" | "PARTIAL",
  "confidence": 0.0-1.0,
  "reasoning": "Concise explanation of the decision, referencing specific gaps or strengths in the evidence.",
  "gaps": ["List of specific information gaps if any"],
  "contradictions": ["List of any contradictions found between evidence passages"],
  "recommended_action": "PROCEED" | "RETRIEVE_MORE" | "NARROW_QUESTION" | "ESCALATE" | "ABSTAIN"
}

CONSTRAINTS

  • If the evidence is completely absent or empty, return INSUFFICIENT with confidence 1.0.
  • If the evidence partially answers the question but has clear gaps, return PARTIAL with a confidence reflecting how much is covered.
  • If the evidence is sufficient but contains minor inconsistencies, return SUFFICIENT but flag the contradictions.
  • Do not fabricate evidence. Only assess what is provided.
  • If the question is ambiguous, note this in reasoning and recommend NARROW_QUESTION.

Adapt this template by adjusting the evaluation criteria to match your domain's evidence standards. For legal or clinical use cases, add criteria for source provenance and regulatory compliance. For customer support, you might lower the specificity bar but raise the consistency requirement. The output schema can be extended with domain-specific fields such as missing_document_ids or required_retrieval_filters to feed directly into your retrieval loop. Always validate the JSON output against the schema before proceeding—malformed outputs should trigger a retry or fallback to a conservative INSUFFICIENT decision. For high-stakes domains, route PARTIAL decisions to a human reviewer rather than automatically retrieving more.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Evidence Sufficiency Gate Prompt. Each variable must be populated before the prompt is assembled and sent to the model. Missing or malformed inputs will cause the gate to fail open or produce unreliable verdicts.

PlaceholderPurposeExampleValidation Notes

[USER_QUESTION]

The original question the system needs to answer

What is the refund policy for annual subscriptions?

Must be non-empty string. Truncate if longer than 2000 characters. Log if question appears truncated or garbled.

[RETRIEVED_CONTEXT]

The set of passages or documents returned by the retrieval step

Passage 1: Annual subscriptions are refundable within 30 days... Passage 2: Monthly plans are non-refundable.

Must be non-empty array or concatenated string with clear passage delimiters. Validate that context is not identical to a previous failed retrieval attempt.

[CONTEXT_METADATA]

Source identifiers, retrieval scores, and document provenance for each passage

{"passage_1": {"source": "policy_doc_v3.pdf", "score": 0.92, "date": "2024-11-01"}}

Optional but strongly recommended. If absent, the gate cannot assess source recency or authority. Log warning if metadata is missing when context is present.

[QUESTION_TYPE]

Classification of the question to calibrate sufficiency thresholds

policy_lookup | factual_claim | comparison | procedure | calculation

Must match an allowed enum value. Use a lightweight classifier prompt upstream. Default to 'factual_claim' if classification fails. Different types have different evidence density requirements.

[MINIMUM_EVIDENCE_THRESHOLD]

The minimum number of distinct, relevant passages required for a SUFFICIENT verdict

2

Integer >= 1. Set higher for comparison or multi-hop question types. Gate should return INSUFFICIENT if distinct relevant passages fall below this threshold.

[REQUIRED_EVIDENCE_ELEMENTS]

Specific facts or data points the evidence must contain to be considered sufficient

["refund window in days", "eligibility conditions", "process for requesting refund"]

Optional list derived from question decomposition. If provided, gate checks each element for coverage. If null, gate uses general relevance and completeness heuristics.

[OUTPUT_SCHEMA]

The expected structure for the gate's verdict output

{"verdict": "SUFFICIENT|INSUFFICIENT|PARTIAL", "confidence": 0.0-1.0, "missing_elements": [...], "rationale": "..."}

Must be a valid JSON schema or type description. Gate prompt should include this schema inline. Validate that the model output parses correctly before proceeding to answer generation.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Evidence Sufficiency Gate into a RAG pipeline as a pre-generation guard.

The Evidence Sufficiency Gate is not a standalone prompt; it is a decision point inserted between retrieval and answer generation. Its job is to prevent the LLM from attempting to answer when the retrieved context is too thin, off-topic, or contradictory to support a reliable response. In practice, this means the gate prompt receives the user's question and the raw retrieval results, then returns a structured verdict that your application code can act on before spending tokens on a full answer generation call. The primary integration points are your retrieval pipeline's post-processing step and your answer generation router.

To wire this into a production RAG system, place the gate after retrieval deduplication and re-ranking but before the final context assembly for the answer prompt. The application should call the gate model with the [QUESTION] and [RETRIEVED_CHUNKS] placeholders populated. Parse the output for a sufficiency field (e.g., sufficient, insufficient, partial). On sufficient, proceed to answer generation with the same chunks. On insufficient, return a controlled abstention message to the user or trigger an expanded retrieval loop. On partial, you may choose to answer with explicit caveats or request user clarification. Log the gate verdict, confidence score, and chunk IDs for every request to build a retrieval quality dashboard. For high-stakes domains, require a confidence threshold above 0.8 before auto-proceeding; route anything below to a human review queue with the evidence and question attached.

Validation and retry logic should be explicit. If the gate model returns malformed JSON, retry once with a stricter schema reminder in the system prompt. If it fails again, default to insufficient and escalate—never guess. Implement a circuit breaker: if the gate rejects more than 60% of queries in a rolling window, pause the pipeline and alert the retrieval team. Model choice matters here; a smaller, faster model (e.g., a quantized 7B or 13B parameter model) often suffices for this classification task, keeping latency and cost low before the more expensive answer generation step. Avoid using the same model instance for both gating and answering to prevent correlated failures. Store gate decisions alongside final answers in your trace logs so you can measure whether the gate correctly predicted answer quality over time.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structured JSON output that the Evidence Sufficiency Gate Prompt must return. Use this contract to validate the model's response before routing to answer generation or a fallback path.

Field or ElementType or FormatRequiredValidation Rule

sufficiency_verdict

enum: SUFFICIENT | INSUFFICIENT | PARTIALLY_SUFFICIENT

Must be exactly one of the three enum values. Reject any other string.

confidence_score

float between 0.0 and 1.0

Must be a valid float. Reject if null, non-numeric, or outside the 0.0-1.0 range.

missing_information_summary

string or null

If verdict is INSUFFICIENT or PARTIALLY_SUFFICIENT, this field must be a non-empty string describing what is missing. If SUFFICIENT, it must be null or an empty string.

evidence_gaps

array of strings

If present, each element must be a non-empty string. If verdict is SUFFICIENT, this array must be empty or absent. Validate array type and element types.

contradictions_detected

boolean

Must be a strict boolean true or false. Reject string representations like 'true' or 'yes'.

contradiction_details

array of objects with fields: claim_a, claim_b, source_a, source_b

Required if contradictions_detected is true. Each object must have all four string fields non-empty. If false, must be an empty array or absent.

rationale

string

Must be a non-empty string. Should briefly justify the verdict by referencing evidence coverage, gaps, or contradictions found.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when using an Evidence Sufficiency Gate and how to guard against it. These failures prevent the gate from correctly stopping inadequate answers or cause it to block valid ones.

01

False Negatives: Gate Passes Insufficient Evidence

What to watch: The gate approves a question even though the retrieved chunks are missing key facts, are out of date, or only tangentially related. The downstream generator then hallucinates to fill the gap. This often happens when evidence contains overlapping keywords but lacks the specific answer. Guardrail: Include explicit negative examples in the prompt showing keyword overlap without semantic sufficiency. Require the gate to identify the specific fact needed and confirm its presence, not just topical relevance.

02

False Positives: Gate Blocks Sufficient Evidence

What to watch: The gate rejects a question because the answer is distributed across multiple chunks, requires simple inference, or is stated in different terminology. This creates a dead end where the system refuses to answer a knowable question. Guardrail: Instruct the gate to assess evidence collectively, not chunk-by-chunk. Add a rule that explicit logical deductions from provided facts count as sufficient. Test with multi-hop questions where no single chunk contains the full answer.

03

Overconfidence on Ambiguous Questions

What to watch: The gate passes a question that is fundamentally ambiguous, where the evidence supports multiple interpretations. The downstream generator picks one and presents it as fact, misleading the user. Guardrail: Add an ambiguity check to the gate prompt. If the question can be reasonably interpreted in multiple ways and the evidence doesn't disambiguate, the gate should return insufficient with a note requesting clarification, not sufficient.

04

Temporal Staleness Not Detected

What to watch: The evidence is factually correct but outdated. The gate sees a complete answer and passes it, but the information is no longer true. This is common with policies, pricing, or status questions. Guardrail: If document dates or version metadata are available, include them in the evidence payload and instruct the gate to consider recency. Add a rule: if the question implies a current state and the evidence is older than a defined threshold, flag as potentially stale.

05

Gate Prompt Drift Over Model Versions

What to watch: A gate prompt tuned on one model version becomes too permissive or too strict after a model upgrade. The structured output schema remains valid, but the judgment threshold shifts silently. Guardrail: Maintain a golden dataset of question-evidence pairs with expected gate decisions. Run this eval suite against any new model version before deployment. Track pass/block rates and investigate any shift larger than 5%.

06

Evidence Truncation Hides Gaps

What to watch: Retrieved chunks are truncated by the context window or a chunking strategy, cutting off the critical sentence that contains the answer. The gate sees partial evidence and incorrectly judges it insufficient, or worse, sees enough keywords to pass it while the key fact is missing. Guardrail: Log the full retrieved text alongside the gate decision. If a gate returns insufficient, trigger a retrieval expansion step before final refusal. Monitor the rate of insufficient decisions to detect systemic truncation issues.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Evidence Sufficiency Gate Prompt before deploying it in production. Each criterion defines a pass standard, a clear failure signal, and a concrete test method. Run these evaluations against a golden dataset of question-evidence pairs with known sufficiency labels.

CriterionPass StandardFailure SignalTest Method

Sufficiency Classification Accuracy

Correctly classifies >= 95% of golden dataset examples as sufficient or insufficient

Gate misclassifies insufficient evidence as sufficient, allowing answer generation from inadequate context

Run prompt against 100+ labeled question-evidence pairs; calculate precision, recall, and F1 for both classes

Missing Key Fact Detection

Identifies >= 90% of cases where a specific, named fact required to answer is absent from evidence

Gate returns 'sufficient' when the evidence lacks a critical date, name, or figure needed for a correct answer

Curate 50 examples where exactly one key fact is missing; measure detection rate and false negative rate

Ambiguity Handling

Correctly flags ambiguous questions as requiring clarification rather than classifying evidence as insufficient

Gate conflates an ambiguous question with insufficient evidence, recommending retrieval changes instead of user clarification

Test with 20 ambiguous questions where evidence is present but question intent is unclear; verify gate recommends clarification

Output Schema Compliance

Returns valid JSON matching [OUTPUT_SCHEMA] in 100% of test cases with no parsing errors

Output contains extra fields, missing required fields, or malformed JSON that breaks downstream parsing

Validate all test outputs with a JSON schema validator; count parse failures and schema violations across 200 runs

Boundary Case: Partial Evidence

Correctly classifies partially sufficient evidence as insufficient when the gap would cause a materially incorrect answer

Gate classifies evidence as sufficient when a minor detail is missing but the core answer is still correct

Create 30 borderline cases with varying degrees of completeness; measure agreement with human expert labels

Citation Grounding in Rationale

Every claim in the rationale references a specific passage or explicitly notes the absence of evidence

Rationale contains unsupported assertions about evidence quality without pointing to specific source text

Manual review of 50 rationales; flag any claim in the rationale that cannot be traced to a source passage or explicit gap note

Latency Budget Compliance

Completes evaluation in under 2 seconds for contexts up to 4000 tokens in 95% of test runs

Gate exceeds latency budget, causing timeout in the pre-generation pipeline and degrading user experience

Benchmark with 100 requests at varying context lengths; measure p50, p95, and p99 latency against budget

Adversarial Evidence Resistance

Correctly identifies insufficient evidence when context contains irrelevant but plausible-sounding text

Gate is fooled by high-volume irrelevant context and classifies it as sufficient due to topical similarity

Test with 30 examples where 80% of context is on-topic but irrelevant to the specific question; measure false positive rate

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple pass/fail output. Remove the structured JSON schema requirement and ask for a plain-text verdict with a brief reason. Use a single [CONTEXT] block and a single [QUESTION] placeholder. Test with 10-20 examples manually.

code
You are an evidence sufficiency reviewer. Given the context below, determine if there is enough information to answer the user's question.

Context: [CONTEXT]
Question: [QUESTION]

Respond with only "SUFFICIENT" or "INSUFFICIENT" followed by a one-sentence reason.

Watch for

  • Overly optimistic sufficiency calls when context is thin
  • No distinction between partial and complete sufficiency
  • Model ignoring implicit information needs in the question
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.