Inferensys

Prompt

Evidence Chain-of-Thought Grounding Prompt

A practical prompt playbook for using Evidence Chain-of-Thought Grounding Prompt in production AI workflows. Produces step-by-step reasoning chains where each inferential step cites specific source passages for audit and review workflows requiring reasoning transparency.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Deploy this prompt when the reasoning path is the product, and every inferential step must be traceable to a specific source passage for audit, compliance, or high-trust review.

This prompt is built for workflows where a wrong answer is expensive and an unexplainable answer is unacceptable. The ideal user is a document intelligence team, legal reviewer, financial auditor, or clinical analyst who needs to see exactly how the model moved from evidence to conclusion. The required context is a set of source documents or retrieved passages that the model can cite. Without that evidence, the prompt will force the model to abstain rather than invent support, which is the correct behavior for this use case but a frustrating one for casual Q&A.

Do not use this prompt for fast, conversational interactions or for tasks where the answer matters more than the reasoning. It is a poor fit for creative writing, open-ended brainstorming, or low-stakes classification where latency and token cost outweigh traceability. It is also not a replacement for a RAG pipeline; you must supply the evidence passages. The prompt assumes you have already retrieved candidate sources and now need the model to reason over them transparently. If your retrieval is weak, the model will surface evidence gaps rather than paper over them, which is a feature for audit teams but a failure mode if you expected fluent answers from thin context.

Before deploying, pair this prompt with an evaluation harness that checks citation accuracy, reasoning-gap detection, and abstention correctness. In regulated domains, always route outputs through human review before they become decisions. The next section provides the copy-ready template you can adapt to your evidence format and output schema.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Evidence Chain-of-Thought Grounding Prompt works, where it breaks, and what you must have in place before using it.

01

Good Fit: Regulated Audit Workflows

Use when: every inferential step must be traceable to a source for compliance, legal, or clinical review. Guardrail: the prompt requires explicit source passage IDs; if the retrieval system cannot provide them, the prompt will refuse to generate a step.

02

Bad Fit: Real-Time Chat

Avoid when: latency budgets are under 2 seconds or the user expects a conversational answer. Risk: step-by-step reasoning with citations adds significant token generation overhead. Guardrail: use a faster citation-answer prompt for chat and reserve this for async audit jobs.

03

Required Input: Source-Anchored Passages

Risk: the prompt will hallucinate citations if given passages without stable IDs. Guardrail: every retrieved chunk must include a unique, persistent identifier (e.g., doc_id, chunk_index) before it enters the prompt. Validate IDs in preflight.

04

Operational Risk: Silent Citation Gaps

Risk: the model may skip citing a reasoning step if the evidence is weak, producing a plausible but unverifiable chain. Guardrail: run a post-generation citation_completeness eval that counts reasoning steps against cited sources and flags any step with zero evidence.

05

Operational Risk: Evidence Misrepresentation

Risk: the model may cite a source that does not actually support the stated claim. Guardrail: implement a fact-checking verification loop where a separate judge prompt compares each claim to its cited passage and returns a supported or contradicted verdict.

06

Not a Replacement for Human Judgment

Risk: teams may treat the reasoning chain as ground truth. Guardrail: the prompt output is an audit artifact, not a decision. Always route final conclusions to a human reviewer when the domain is high-stakes. The prompt's value is in making the review faster and more focused.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt that enforces step-by-step reasoning with mandatory source citations at every inferential step.

This prompt template is designed for audit and review workflows where reasoning transparency is non-negotiable. It forces the model to externalize its chain of thought, making every logical step explicit and grounding each one in a specific, cited source passage. The primary job-to-be-done is generating an output where a human reviewer can trace the conclusion back to the evidence without guessing how the model got there. Use this when you need a verifiable reasoning trace for compliance, legal review, or high-trust decision support. Do not use this for latency-sensitive chat applications where the verbosity of a full trace would degrade the user experience; a simpler RAG citation prompt is more appropriate for those cases.

text
You are an expert analyst. Your task is to answer the user's question by following a strict, step-by-step reasoning process. You must cite the specific source passage that justifies each inferential step.

## INPUT
**Question:** [USER_QUESTION]
**Sources:**
[SOURCES]

## OUTPUT FORMAT
Your entire response must be a single JSON object conforming to this schema:
{
  "final_answer": "string",
  "reasoning_trace": [
    {
      "step_number": "integer",
      "thought": "string (the logical step you are taking)",
      "conclusion": "string (the partial conclusion reached in this step)",
      "source_citation": "string (the exact text from the provided sources that supports this step, or 'No source available' if it is a purely logical deduction)",
      "source_id": "string (the ID of the source document, or null)"
    }
  ],
  "evidence_gaps": [
    "string (describe any part of the question that could not be answered from the sources)"
  ]
}

## CONSTRAINTS
1. **Mandatory Citations:** Every step in the `reasoning_trace` that uses factual information from the sources MUST include a verbatim quote in the `source_citation` field and the corresponding `source_id`. Do not paraphrase the citation.
2. **No Hallucination:** If a logical step cannot be supported by the provided sources, you must state 'No source available' in the `source_citation` field. Do not invent facts.
3. **Step-by-Step Logic:** Break down your reasoning into the smallest possible logical units. Do not skip steps. The `thought` field should explain *why* you are taking the step, and the `conclusion` field should state the *result* of that step.
4. **Gap Analysis:** After your reasoning trace, explicitly list any parts of the `final_answer` or the user's question that could not be fully supported by the evidence in the `evidence_gaps` array. If there are no gaps, return an empty array.
5. **JSON Only:** Your response must be valid, parseable JSON. Do not include any text outside the JSON object.

To adapt this template, replace the [USER_QUESTION] and [SOURCES] placeholders. The [SOURCES] placeholder should be filled with a pre-formatted string of your retrieved documents, each clearly labeled with a unique source_id (e.g., [DOC_ID_1]: ...). The strict JSON output contract makes this prompt ideal for direct integration into an application pipeline. Before deploying, validate the model's output against the schema and run evaluations that specifically check for citation accuracy and reasoning trace completeness. For high-risk domains, always route outputs with non-empty evidence_gaps arrays or null source_ids for factual claims to a human review queue.

IMPLEMENTATION TABLE

Prompt Variables

Inputs required to assemble the Evidence Chain-of-Thought Grounding Prompt. Validate each placeholder before template substitution to prevent runtime failures.

PlaceholderPurposeExampleValidation Notes

[USER_QUERY]

The question or task requiring evidence-grounded reasoning

Explain the impact of the new tariff policy on our supply chain costs

Must be non-empty string; reject null or whitespace-only input

[RETRIEVED_CONTEXT]

Array of source passages with metadata to ground the reasoning chain

[{"source_id": "doc-42", "passage": "Section 301 tariffs increased...", "authority": "high"}]

Must be valid JSON array with at least one object containing source_id and passage fields; reject empty array

[REASONING_STEPS]

Maximum number of inferential steps allowed in the chain

5

Must be integer between 2 and 15; default to 5 if out of range

[CITATION_FORMAT]

Required format for inline source references

source_id:paragraph

Must match pattern ^[a-zA-Z_]+:[a-zA-Z_]+$; reject unparseable format strings

[CONFIDENCE_THRESHOLD]

Minimum confidence score to include a claim in the output

0.7

Must be float between 0.0 and 1.0; claims below threshold must be flagged as uncertain

[OUTPUT_SCHEMA]

JSON schema defining the expected output structure

{"type": "object", "properties": {"steps": {"type": "array"}}}

Must be valid JSON Schema draft-07 or later; parse check required before prompt assembly

[ABSTENTION_RULES]

Conditions under which the model should refuse to produce a conclusion

insufficient_evidence, contradictory_sources

Must be non-empty string or array of valid rule identifiers; null allowed if abstention is disabled

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Evidence Chain-of-Thought Grounding Prompt into a production application with validation, retries, logging, and audit controls.

This prompt is designed to be the reasoning layer between retrieval and final answer generation. In production, assemble the prompt with validated source passages, call the model, parse the reasoning chain, and validate that every inferential step cites at least one source. The reasoning chain itself becomes a first-class output artifact, not just an intermediate throwaway. Store it alongside the final answer for downstream audit, review, and debugging workflows.

Implement a two-pass architecture for high-trust deployments. The first pass generates the reasoning chain with citations using the prompt template. The second pass validates citation accuracy by extracting each cited passage from the original sources and checking that the claim in the reasoning step is actually supported by the cited text. Flag any step where the cited passage does not contain the claimed information or where a reasoning step lacks a citation entirely. If validation fails, retry the first pass with a stricter instruction appended to the prompt, such as 'Every reasoning step MUST include a verbatim quote from the cited source that directly supports the claim.' After three failed retries, escalate to human review with the full trace attached.

Log the complete reasoning trace, source passages, model version, prompt template version, and validation results as an immutable audit record. For regulated domains, store this record in a write-once data store with a hash chain or timestamped entry. Include a structured metadata block with fields like reasoning_step_count, citation_coverage_score, validation_pass, and human_review_required. Wire the output into your application by extracting the final conclusion from the reasoning chain and presenting it alongside a collapsible or expandable reasoning trace in the UI. Never surface the raw reasoning chain to end users without first running the validation pass to catch hallucinated citations before they become visible.

Model choice matters here. Use models with strong instruction-following and long-context reasoning capabilities. If using a smaller or faster model for cost reasons, increase the retry budget and lower the threshold for human escalation. For tool-augmented setups, consider giving the model a cite_source tool that accepts a source ID and quote string, enforcing structured citation at the tool-call level rather than relying solely on text-format instructions. This reduces parsing fragility and makes validation deterministic.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required fields, types, and validation rules for the structured reasoning trace produced by the Evidence Chain-of-Thought Grounding Prompt. Use this contract to build a post-generation validation harness.

Field or ElementType or FormatRequiredValidation Rule

reasoning_steps

Array of objects

Must be a non-empty array. If the model cannot produce any steps, it should return an empty array and populate the abstention field.

reasoning_steps[].step_id

String (e.g., 'S1', 'S2')

Must be a unique identifier within the array. Validate with a regex for the expected pattern (e.g., 'S[0-9]+') and check for duplicates.

reasoning_steps[].claim

String

Must be a non-empty string representing a single inferential step. Validate that it is a declarative statement, not a question or instruction.

reasoning_steps[].evidence

Array of objects

Must be an array. If no direct evidence supports the claim, this must be an empty array, and the claim's confidence should be 'low' or 'none'.

reasoning_steps[].evidence[].source_id

String

Must exactly match a [SOURCE_ID] provided in the input context. Validate against the list of known source IDs. A mismatch is a critical grounding failure.

reasoning_steps[].evidence[].quote

String

Must be a verbatim substring from the source text associated with the source_id. Validate by performing a case-sensitive string containment check against the original source text.

reasoning_steps[].confidence

String (Enum: 'high', 'medium', 'low', 'none')

Must be one of the defined enum values. If the evidence array is empty, the value must be 'low' or 'none'. If evidence is present, 'high' or 'medium' is expected.

final_conclusion

String

Must be a non-empty string summarizing the final answer. Validate that it does not introduce any new claims not present in the reasoning_steps.

abstention

Object or null

If present, must be an object with a 'reason' (String) field. Required if reasoning_steps is empty. If not abstaining, this field must be null.

PRACTICAL GUARDRAILS

Common Failure Modes

Evidence Chain-of-Thought prompts fail in predictable ways. Here are the most common failure modes and how to guard against them in production.

01

Fabricated Citations

What to watch: The model invents plausible-sounding source references, page numbers, or passage IDs that do not exist in the provided evidence. This is especially common when the prompt demands citations but the evidence is insufficient. Guardrail: Require the model to quote the exact passage it is citing. Validate citations against the source document index before accepting the output. Add a post-generation check that every citation marker resolves to a real passage.

02

Reasoning Without Evidence Anchors

What to watch: The model produces a logical chain of reasoning but skips the step of linking each inferential hop to a specific source passage. The reasoning reads as coherent but is untethered from the provided documents. Guardrail: Structure the prompt to require an evidence anchor after every reasoning step. Use a strict output schema that pairs each reasoning sentence with a source reference. If no source supports a step, the model must flag it as an assumption.

03

Gap Concealment

What to watch: When evidence is missing for a critical step, the model fills the gap with plausible-sounding but unsupported reasoning rather than explicitly flagging the evidence gap. The chain appears complete but hides missing links. Guardrail: Add an explicit instruction to mark unsupported inferential steps with a gap token such as [EVIDENCE_GAP]. Include a post-generation scan for reasoning steps that lack source references. Route outputs with gaps to human review.

04

Over-Citation Dilution

What to watch: The model cites sources for every sentence including trivial or definitional statements, making it difficult to distinguish which citations actually support consequential claims. The signal-to-noise ratio collapses. Guardrail: Instruct the model to cite only for factual claims, quantitative statements, and inferential leaps. Exclude citations for common knowledge, definitions, and restatements of the question. Validate citation density against a configured threshold.

05

Source Misattribution

What to watch: The model correctly quotes a passage but attributes it to the wrong source document, section, or author. The evidence is real but the provenance is wrong, breaking audit trails. Guardrail: Require the model to include a source identifier and passage position with every citation. Cross-check citation metadata against the source index. For multi-document prompts, use distinct source labels that the model cannot confuse.

06

Premature Conclusion Lock-In

What to watch: The model commits to a conclusion early in the reasoning chain and then selectively cites evidence that supports it while ignoring contradictory passages. The chain-of-thought becomes rationalization rather than reasoning. Guardrail: Require the model to surface and address contradictory evidence before reaching a conclusion. Add a counter-evidence check step in the prompt. Use an eval that measures whether all provided evidence is accounted for in the reasoning trace.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each criterion on a pass/fail or 1-5 scale to test output quality before shipping the Evidence Chain-of-Thought Grounding Prompt.

CriterionPass StandardFailure SignalTest Method

Step Completeness

Every reasoning step from input to conclusion is present; no gaps in the logical chain.

Output jumps from evidence to conclusion without intermediate inferential steps.

Manual review or LLM-as-judge: count distinct reasoning steps and check for logical adjacency.

Citation Coverage

Every factual claim and inferential step cites at least one specific source passage.

A claim or reasoning step appears without a citation marker or source reference.

Regex scan for citation markers; cross-reference each marker against the provided [SOURCE_MATERIAL] list.

Citation Fidelity

Cited passages directly support the claim they are attached to; no fabricated or misrepresented evidence.

A cited passage contradicts the claim, is irrelevant, or does not exist in [SOURCE_MATERIAL].

Extract cited text spans; compare against [SOURCE_MATERIAL] using string match or embedding similarity threshold.

Gap Detection

The reasoning chain explicitly flags when evidence is insufficient, conflicting, or missing for a step.

The output proceeds through a weak inference without noting low confidence or missing evidence.

Search output for gap-indicator terms (e.g., 'insufficient evidence', 'no source addresses'); if absent on a borderline claim, flag.

Source Conflict Handling

When sources conflict, the output acknowledges the conflict, presents both sides, and explains the resolution rationale.

Conflicting sources are ignored, or one side is presented as fact without noting the disagreement.

Inject a known conflicting source pair into [SOURCE_MATERIAL]; verify the output addresses both and states a resolution basis.

Uncertainty Calibration

Confidence language matches evidence quality; weak or single-source claims use hedging, strong multi-source claims use definitive language.

A claim based on a single low-authority source is stated with high certainty.

LLM-as-judge: compare confidence markers against the number and authority of cited sources for a sampled claim.

Output Schema Adherence

The output strictly follows the defined [OUTPUT_SCHEMA] with all required fields present and correctly typed.

Missing reasoning_steps array, malformed citation objects, or extra untyped fields.

Parse output with a JSON schema validator; reject on validation error.

Abstention Discipline

The output refuses to answer or explicitly states 'cannot be determined' when [SOURCE_MATERIAL] contains no relevant evidence.

The model hallucinates an answer or reasoning chain when no relevant sources exist.

Provide [SOURCE_MATERIAL] with zero relevant passages; output must contain an abstention statement and no fabricated citations.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single source document. Remove strict schema requirements and use plain-text reasoning output. Focus on getting the chain-of-thought flow right before adding validation.

code
You are an evidence analyst. For each conclusion you reach:
1. State the inferential step.
2. Quote the exact source passage that supports it.
3. If no passage supports a step, mark it as [UNSUPPORTED].

Source: [DOCUMENT_TEXT]
Question: [USER_QUESTION]

Watch for

  • Reasoning steps that sound plausible but lack actual source quotes
  • The model skipping the [UNSUPPORTED] marker and inventing evidence
  • Long chains where later steps drift from the original source material
  • No easy way to verify if quoted passages actually exist in the source
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.