This prompt is built for debugging teams and evaluation engineers who need to verify that each step in a reasoning trace correctly depends on prior steps. The core job-to-be-done is dependency integrity checking: does step 4 actually follow from what was established in steps 1 through 3, or did the model make an unsupported leap? The ideal user is someone staring at a long chain-of-thought output and asking 'where did this conclusion come from?'—not someone grading the final answer for correctness. You need the full reasoning trace as input, and you should already suspect that the model is fabricating connections, ignoring earlier findings, or treating speculation as established fact.
Prompt
Step Dependency Mapping and Validation Prompt

When to Use This Prompt
Identify the right debugging scenarios for step dependency mapping and when to choose a different evaluation tool.
Use this when you're debugging reasoning failures in production agents, auditing RAG pipelines for faithfulness, or building evaluation harnesses that need to catch structural reasoning errors before they reach users. The prompt produces a structured dependency graph with explicit link validation, broken-link detection, and severity ratings. Each dependency claim gets checked: does the referenced step actually contain the information the current step claims to inherit? When a link is broken, the output tells you whether the step fabricated a connection, contradicted prior steps, or silently dropped an established conclusion. This is particularly valuable for multi-step math solutions, legal analysis traces, medical reasoning workflows, and any domain where the path matters as much as the destination.
Do not use this prompt when you need a general correctness grader, a factual accuracy checker, or a logical validity assessor. It does not evaluate whether the reasoning is sound—only whether each step's claimed dependencies actually exist in the preceding steps. If you need to catch logical fallacies, use the Fallacy Detection in Chain-of-Thought Prompt. If you need to verify factual grounding against source documents, use the Factual Grounding Check Across Reasoning Steps Prompt. If you need to assess whether the conclusion follows from the reasoning, use the Conclusion-Support Alignment Scoring Prompt. This prompt answers one narrow question: does each step actually follow from what came before it?
The output is most useful when wired into an automated evaluation pipeline that flags broken dependencies before human review. Set severity thresholds based on your risk tolerance: a single broken link in a ten-step trace might be acceptable for low-stakes summarization, but any broken link in a medical or legal reasoning trace should trigger immediate human review. Pair this prompt with the Error Propagation Analysis in Reasoning Chains Prompt to trace how early dependency breaks cascade through later steps. For production systems, log the dependency graph alongside the original trace so you can track whether model updates reduce broken-link rates over time.
Use Case Fit
Where the Step Dependency Mapping and Validation Prompt delivers value and where it introduces risk. This prompt is designed for debugging reasoning chains, not for generating them.
Good Fit: Debugging Long Reasoning Traces
Use when: you have a multi-step reasoning trace (10+ steps) and need to find where a conclusion lost support. Guardrail: Feed the prompt the full trace, not a summary. The dependency graph is only as good as the raw material.
Bad Fit: Real-Time or Streaming Outputs
Avoid when: you need to validate dependencies in a streaming response before the model finishes. Risk: The prompt requires the complete trace to build the graph. Guardrail: Use this as a post-hoc debugging tool, not an inline interrupter.
Required Input: Complete Reasoning Trace
What to watch: The prompt fails silently if you pass a truncated or summarized trace. Guardrail: Validate that the input contains explicit step markers (e.g., 'Step 1:', 'Step 2:') before calling the prompt. Missing markers cause broken dependency links.
Operational Risk: Model Confabulating Links
What to watch: The LLM may invent dependencies between steps that are semantically similar but logically independent. Guardrail: Always pair this prompt with a human review step for high-stakes traces. Treat the output as a debugging aid, not an audit record.
Good Fit: Pre-Release Reasoning QA
Use when: you are about to ship a new system prompt or chain-of-thought instruction and need to verify that the model's reasoning doesn't make unsupported leaps. Guardrail: Run this prompt against a golden dataset of traces before cutting a release.
Bad Fit: Subjective or Creative Reasoning
Avoid when: the reasoning trace is for creative writing, brainstorming, or subjective analysis. Risk: The prompt will flag legitimate associative thinking as 'broken links.' Guardrail: Only apply this to traces where formal logical dependency is expected, such as math, code, or compliance analysis.
Copy-Ready Prompt Template
Paste this prompt into your evaluation harness to map step dependencies and detect broken links in reasoning traces.
This prompt template is designed to be dropped directly into your evaluation harness for step dependency mapping and validation. It instructs the model to analyze a provided reasoning trace, identify explicit and implicit dependencies between steps, construct a dependency graph, and flag any broken links where a step references a conclusion or fact not yet established. The template uses square-bracket placeholders that you must replace with your specific reasoning trace, output schema, and operational constraints before execution.
textYou are an expert reasoning auditor. Your task is to analyze the provided reasoning trace and produce a step dependency map. ## INPUT [REASONING_TRACE] ## INSTRUCTIONS 1. Parse the reasoning trace into discrete, numbered steps. Each step should be a single logical unit. 2. For each step, identify its dependencies: what prior steps, facts, or assumptions must be true for this step to be valid? Distinguish between explicit dependencies (directly cited) and implicit dependencies (logically required but not stated). 3. Construct a dependency graph as a list of edges, where each edge is a directed link from a dependency source to the dependent step. Use step numbers as node identifiers. 4. Validate the graph by checking for broken links. A broken link occurs when a step depends on a conclusion, fact, or value that has not been established in any prior step or provided context. 5. For each broken link, provide a severity rating (CRITICAL, HIGH, MEDIUM, LOW) and a brief explanation of why the dependency is unsatisfied. ## OUTPUT_SCHEMA [OUTPUT_SCHEMA] ## CONSTRAINTS - Do not invent dependencies that are not present in the trace. - If a step depends on common knowledge or an axiom stated in the prompt, note it as an external dependency, not a broken link. - If the trace is too ambiguous to parse into steps, output a single error object explaining why. ## RISK_LEVEL [RISK_LEVEL]
After pasting the template, replace [REASONING_TRACE] with the full text of the chain-of-thought output you are auditing. Replace [OUTPUT_SCHEMA] with your expected JSON structure—for example, an object containing steps, edges, and broken_links arrays. Set [RISK_LEVEL] to HIGH if this audit feeds into a safety-critical or compliance pipeline, which will instruct the model to adopt a stricter, more conservative stance on flagging potential issues. For high-risk workflows, always route outputs flagged with CRITICAL or HIGH severity broken links for human review before accepting the reasoning trace as valid. Before deploying, run this prompt against a golden dataset of reasoning traces with known dependency errors to calibrate your evaluation thresholds and confirm the model correctly identifies both obvious and subtle broken links.
Prompt Variables
Each placeholder required by the Step Dependency Mapping and Validation Prompt. Use these to construct your API request and validate inputs before sending.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[REASONING_TRACE] | The full step-by-step reasoning text to analyze for dependency integrity | Step 1: Identify user need. Step 2: Because the user needs X, we query Y. Step 3: Based on Y, we conclude Z. | Required. Must contain at least 3 distinct steps delimited by newlines or numbered markers. Reject if empty or single-step. |
[STEP_DELIMITER] | The token or pattern used to split the trace into individual steps for analysis | "\nStep" or "\n\d+." | Required. Must be a valid regex or literal string. Test with a sample trace to confirm correct step count extraction. |
[DEPENDENCY_TYPE] | The class of dependency relationship to validate between steps | "logical_entailment" or "evidence_citation" or "variable_reuse" | Required. Must match one of the predefined enum values. Invalid types should trigger a pre-validation error before model call. |
[OUTPUT_FORMAT] | The desired structure for the dependency graph output | "mermaid" or "adjacency_list" or "json_graph" | Required. Must be one of the supported formats. Schema check the output against the format specification after generation. |
[STRICTNESS_LEVEL] | Controls whether the validator flags potential issues or only definite breaks | "permissive" or "standard" or "strict" | Optional. Defaults to "standard". Permissive allows inferred dependencies; strict requires explicit connective language. Validate against allowed enum. |
[CONTEXT_WINDOW] | Any preceding context the reasoning trace references but does not restate | "The user is an enterprise admin with read-only permissions." | Optional. If provided, validate that dependency checks consider this context as an implicit Step 0. Null allowed. |
[KNOWN_FACTS] | A list of verified facts to ground dependency validation and detect unsupported leaps | ["Database schema: users(id, name, role)", "API rate limit: 100 req/min"] | Optional. If provided, each fact should be a string. Use for grounding checks. Null allowed. If present, enable hallucination flagging on steps that contradict known facts. |
Implementation Harness Notes
How to wire the Step Dependency Mapping and Validation Prompt into an evaluation pipeline or debugging workflow.
The Step Dependency Mapping and Validation Prompt is designed to be integrated into an automated reasoning evaluation pipeline, not used as a one-off manual check. Its primary job is to receive a multi-step reasoning trace and return a structured dependency graph with explicit broken-link detection. The harness must supply the full reasoning trace as [REASONING_TRACE], an optional [CONTEXT] containing source documents or established facts, and a [DEPENDENCY_SCHEMA] that defines the expected output format. The prompt returns a JSON object mapping each step to its declared dependencies, validated dependencies, and any broken links where a step references a prior conclusion that was never established or was contradicted later.
Wire this prompt into your evaluation harness by calling it after the primary reasoning model produces its trace. Use a structured output API or a strict JSON mode to enforce the [DEPENDENCY_SCHEMA]. Implement a post-processing validator that checks: (1) every step ID in the dependency graph exists in the original trace, (2) every dependency reference points to a real prior step, and (3) broken-link flags include the specific step indices and the nature of the failure. For high-stakes debugging workflows, add a retry layer: if the prompt returns malformed JSON or missing step IDs, retry once with a simplified [REASONING_TRACE] truncated to the suspect region. Log every dependency graph alongside the original trace for later analysis. Model choice matters here—use a model with strong structured output capabilities and long-context handling, as reasoning traces can span thousands of tokens. For traces exceeding the model's context window, chunk the trace into overlapping segments and run dependency mapping per segment, then merge graphs with a reconciliation step that checks cross-segment references.
Avoid treating this prompt as a final verdict without human review when broken links are detected in safety-critical or regulated domains. A flagged dependency failure indicates the reasoning trace made an unsupported leap, but the root cause could be a poorly stated prior step, an implicit assumption the model didn't surface, or a genuine logical error. Use the output to route traces to a human review queue when broken-link severity exceeds a configurable threshold. Do not use this prompt to evaluate traces shorter than three steps—dependency mapping adds noise when there isn't enough structure to analyze. Pair this prompt with the Step-by-Step Correctness Grading Prompt and the Error Propagation Analysis in Reasoning Chains Prompt for a complete reasoning quality pipeline.
Expected Output Contract
Defines the structure, types, and validation rules for the dependency graph and broken-link detection output. Use this contract to parse the model response, validate correctness, and trigger retry or repair logic before the output reaches downstream systems.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
dependency_graph | JSON object | Top-level key must exist. Must contain 'steps' and 'edges' arrays. Parse check: valid JSON. Schema check: object with exactly two array properties. | |
dependency_graph.steps[] | Array of objects | Each step object must include 'step_id' (string), 'description' (string), and 'status' (enum: 'valid' | 'warning' | 'broken'). Array must not be empty. Length >= 2. | |
dependency_graph.steps[].step_id | String | Must match the pattern 'step_[0-9]+' and correspond to a step identifier from the input reasoning trace. No duplicate step_id values allowed. | |
dependency_graph.edges[] | Array of objects | Each edge object must include 'source' (string), 'target' (string), and 'dependency_type' (enum: 'logical' | 'factual' | 'computational'). Array can be empty if no dependencies are detected. | |
dependency_graph.edges[].source | String | Must match a step_id present in dependency_graph.steps. Represents the step that provides information or a conclusion. | |
dependency_graph.edges[].target | String | Must match a step_id present in dependency_graph.steps. Represents the step that depends on the source. Self-loops (source == target) are invalid. | |
broken_links[] | Array of objects | Each broken link must include 'dependent_step' (string), 'expected_source' (string), 'failure_type' (enum: 'missing_reference' | 'unsupported_leap' | 'contradiction' | 'ignored_conclusion'), and 'severity' (enum: 'critical' | 'major' | 'minor'). Array can be empty. | |
broken_links[].failure_type | String (enum) | Must be one of: 'missing_reference', 'unsupported_leap', 'contradiction', 'ignored_conclusion'. If value is 'contradiction', the 'contradicting_step' field must also be present in the broken link object. |
Common Failure Modes
Step dependency mapping fails in predictable ways. These are the most common production failure modes and how to guard against them before they corrupt your evaluation pipeline.
Phantom Dependencies
What to watch: The model claims Step B depends on Step A when no logical or factual link exists. This inflates dependency graphs with spurious connections and masks real reasoning gaps. Guardrail: Require explicit citation of the specific claim or value from the prior step that Step B uses. If the model cannot produce a direct quote or variable reference, flag the dependency as unsubstantiated and remove it from the graph.
Broken Chain After Correction
What to watch: When an early step is corrected, the model fails to propagate the update through downstream steps that depended on the original value. The dependency graph becomes stale and conclusions rest on invalidated premises. Guardrail: After any step-level correction, re-run dependency validation for all downstream steps. Implement a cascading invalidation rule: if Step A changes, any step that consumed Step A's output must be re-evaluated or marked as suspect.
Implicit Assumption Masking
What to watch: The model treats an unstated assumption as an established conclusion from a prior step, creating a dependency that looks valid in the graph but rests on nothing. This is the most common cause of confident-sounding nonsense in long reasoning chains. Guardrail: Run a hidden-assumption extraction pass before dependency mapping. Any dependency that traces back to an extracted assumption rather than an explicit prior step must be flagged with an assumption warning and excluded from the verified dependency graph.
Circular Dependency Loops
What to watch: Step C depends on Step D, which depends on Step C. The model uses its own conclusion as a premise, creating a reasoning loop that passes dependency validation but proves nothing. Guardrail: Run cycle detection on every generated dependency graph. Any detected cycle must break the graph and trigger a regeneration request with an explicit constraint: no step may depend on any step that transitively depends on it. Flag cycles as fatal reasoning errors.
Overclaiming Step Completeness
What to watch: The model marks a step as complete and available for downstream dependency when it actually contains unresolved sub-questions, ambiguous values, or missing evidence. Downstream steps build on incomplete foundations. Guardrail: Add a step-completeness gate before dependency mapping. Each step must pass a checklist: all referenced values are defined, all sub-questions are resolved, and no placeholder tokens remain. Incomplete steps cannot serve as dependency sources.
Dependency Graph Drift Across Retries
What to watch: When the same reasoning trace is re-evaluated, the model produces a different dependency graph. This makes regression testing unreliable and masks real failures behind graph instability. Guardrail: Run dependency mapping at least twice per trace and compute graph similarity. If structural similarity falls below a threshold, flag the trace as unstable and escalate for human review. Unstable graphs cannot be used for automated pass/fail decisions.
Evaluation Rubric
Use this rubric to programmatically or manually evaluate the quality of the Step Dependency Mapping and Validation Prompt's output before shipping changes to production.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Dependency Graph Completeness | Every reasoning step from [REASONING_TRACE] is represented as a node in the output graph. | Node count in output graph is less than the number of steps in the input trace. | Parse output JSON, count nodes in the |
Dependency Link Accuracy | Every | A link references a non-existent step ID, a future step, or a step whose output is not logically required for the current step. | For each link, verify the |
Broken Link Detection Recall | All instances where a step uses information not established in prior steps are flagged in | A manual review finds a logical leap in the trace that is not captured as a | Create a small, hand-crafted [REASONING_TRACE] with a known unsupported leap. Assert the leap's step ID and description appear in the |
Unsupported Leap Justification | Each entry in | A | Parse the |
Output Schema Validity | The output is a single, valid JSON object conforming to the specified [OUTPUT_SCHEMA] with all required fields present. | JSON parsing fails, a required field like | Validate the raw output string with a JSON parser. Validate the parsed object against the [OUTPUT_SCHEMA] using a tool like |
Ignoring Irrelevant Context | The analysis is based solely on the logical flow of [REASONING_TRACE] and does not introduce external knowledge or hallucinate dependencies. | The | For a trace with a known unsupported leap, check that the |
Handling of Final Conclusion | The final conclusion step is correctly identified as having dependencies on the steps that directly support it, and is not flagged as a broken link if its premises are established. | The final step is missing from the graph, has no dependencies, or is incorrectly flagged as a broken link when its direct premises are logically supported by prior steps. | Inspect the |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and a single reasoning trace. Skip the formal dependency graph schema—ask for a plain-text list of broken links and unsupported leaps instead. Focus on getting useful qualitative output before building validation harnesses.
Prompt modification
Replace the strict [DEPENDENCY_GRAPH_SCHEMA] with: Return a list of reasoning steps where the conclusion doesn't follow from prior steps. For each, explain why in one sentence.
Watch for
- The model inventing dependencies that don't exist in the trace
- Overly broad "this step is unsupported" without specifying which prior step should have provided support
- Missing step indices when the trace is long

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us