This prompt is designed for AI reliability engineers and platform teams who need to quickly diagnose why a single production response failed an automated evaluation. The core job-to-be-done is to move from an alert—a failed eval score—to a structured, evidence-backed hypothesis about the root cause. It assumes you are not starting from scratch; you must already have access to the specific trace data for that request, including step-level attribution (retrieval, tool calls, model inference), the final model output, and the detailed results of the evaluation rubric that flagged the failure. This is a focused diagnostic tool, not a general-purpose analysis assistant.
Prompt
Eval Failure Root-Cause Triage Prompt

When to Use This Prompt
A practical guide for AI reliability engineers to triage a specific production response that failed an automated evaluation by correlating eval results with trace data.
Use this prompt when an eval alert fires in your monitoring dashboard and you need to rule out common failure categories before committing to a deep-dive investigation. For example, if a 'faithfulness' eval fails, you can feed the trace's retrieval steps and the final output into this prompt to determine if the root cause was a retrieval gap, a context window truncation, or a genuine hallucination. Do not use this prompt for aggregate trend analysis across thousands of sessions, for real-time incident response where trace data is not yet available, or for cases where you suspect the evaluation rubric itself is misconfigured and producing false positives. In those scenarios, you would first need to validate the eval or gather broader data before a per-trace triage is useful.
The prompt's value is in its structured output, which forces a systematic review rather than an ad-hoc scan of logs. It will ask you to correlate specific eval dimensions with trace events, consider a checklist of common failure modes (e.g., prompt injection, tool-call errors, stale few-shot examples), and produce a ranked list of hypotheses. The next step after using this prompt is to take the top hypothesis and conduct a targeted deep-dive, perhaps using a more specialized prompt like the 'Retrieval Gap Root-Cause for Eval Failure Prompt' or the 'Tool-Call Error Correlation with Eval Failure Prompt.' Avoid the temptation to skip this triage step and jump straight to a solution, as a misdiagnosed root cause often leads to a prompt change that fixes the symptom but introduces a new failure mode elsewhere.
Use Case Fit
Where this prompt works and where it does not. Use these cards to decide if the Eval Failure Root-Cause Triage Prompt is the right tool for your investigation.
Good Fit: Structured Trace Data Available
Use when: you have a production trace with step-level events, tool calls, retrieval results, and an eval score. Guardrail: The prompt requires structured trace input; it cannot reason from a final output alone. Ensure your observability pipeline captures the full request lifecycle before invoking this prompt.
Bad Fit: Pre-Release Regression Testing
Avoid when: you are running offline prompt regression tests against a golden dataset without production trace data. Guardrail: Use the sibling 'Golden Set Deviation Diagnosis Prompt' for pre-release QA. This prompt is for runtime production diagnosis, not pre-deployment validation.
Required Inputs
What you need: the failed eval score and rubric, the model's final output, the full trace log (retrieval steps, tool calls, context window contents), and the original user input. Guardrail: Missing any of these inputs will produce a weak hypothesis. Do not run this prompt on partial data; it will hallucinate a plausible but incorrect root cause.
Operational Risk: Blast Radius Misjudgment
What to watch: The prompt may identify a root cause that is specific to a single trace but not representative of a systemic issue. Guardrail: Never trigger a prompt rollback or model routing change based on a single triage result. Correlate findings across multiple traces using the 'Incident Trace Correlation' sibling prompt before taking action.
Operational Risk: Eval Rubric Drift
What to watch: The prompt assumes the eval rubric is correct. If the rubric itself has drifted or is poorly calibrated, the triage will produce a misleading root cause. Guardrail: If the triage repeatedly blames the model for correct behavior, run the 'LLM Judge Score Inconsistency Investigation Prompt' to validate the evaluator before trusting the triage output.
Human-in-the-Loop Requirement
What to watch: The prompt produces a hypothesis, not a definitive verdict. It can misattribute a retrieval gap to a tool-call failure or vice versa. Guardrail: The output must be reviewed by an engineer who can validate the causal chain against the raw trace data. Do not automate a rollback or model swap directly from this prompt's output.
Copy-Ready Prompt Template
A reusable prompt template for triaging eval failures by correlating eval scores, trace events, and model outputs into a structured root-cause hypothesis.
The template below is designed to be pasted directly into your investigation notebook or wired into an automated triage pipeline. It accepts a failed eval record, the corresponding production trace, and your quality rubric, then produces a structured root-cause hypothesis. Every placeholder is enclosed in square brackets and must be replaced with real data before execution. The prompt forces the model to rule out common failure categories before proposing a deep-dive investigation path, reducing the risk of premature conclusions.
textYou are an AI reliability engineer investigating a production eval failure. Your job is to produce a structured root-cause hypothesis by correlating the eval score, trace events, and model output. ## INPUT ### Failed Eval Record [EVAL_RECORD] ### Production Trace [TRACE_DATA] ### Quality Rubric [QUALITY_RUBRIC] ### Additional Context (optional) [ADDITIONAL_CONTEXT] ## CONSTRAINTS - Do not speculate beyond the evidence in the trace. - Rule out common failure categories before proposing a deep-dive path. - If the trace is incomplete, flag missing segments explicitly. - Distinguish between prompt defects, retrieval gaps, tool failures, model behavior changes, and context truncation. - Cite specific trace events, timestamps, or step IDs as evidence. ## OUTPUT SCHEMA Return a JSON object with the following fields: { "failure_summary": "One-sentence description of what failed and which eval dimension was violated.", "ruled_out_categories": [ { "category": "prompt_defect | retrieval_gap | tool_failure | model_behavior_change | context_truncation | format_drift | hallucination | other", "ruled_out": true, "evidence": "Trace evidence supporting exclusion." } ], "primary_hypothesis": { "category": "prompt_defect | retrieval_gap | tool_failure | model_behavior_change | context_truncation | format_drift | hallucination | other", "confidence": "low | medium | high", "trace_evidence": ["Specific trace event IDs, timestamps, or step descriptions that support this hypothesis."], "explanation": "How the identified root cause led to the eval failure." }, "alternative_hypotheses": [ { "category": "...", "confidence": "low | medium", "trace_evidence": ["..."], "explanation": "..." } ], "missing_trace_data": ["List any trace segments or metadata that would strengthen the diagnosis if available."], "recommended_investigation": "Concrete next step: which trace segment to deep-dive, which metric to check, or which comparison to run.", "severity": "critical | high | medium | low", "affected_eval_dimensions": ["List which rubric dimensions were violated."] } ## STEPS 1. Parse the eval record to identify which rubric dimensions failed and the severity of each failure. 2. Scan the trace for the step where the failure likely originated (retrieval, tool call, generation, routing, truncation). 3. For each common failure category, check whether trace evidence rules it out. 4. Identify the most likely root cause and cite specific trace events. 5. Note any alternative explanations that cannot be ruled out with available data. 6. Flag missing trace data that would improve diagnostic confidence. 7. Recommend a concrete next investigation step.
To adapt this template, replace each square-bracket placeholder with real data from your observability stack. The [EVAL_RECORD] should include the eval score, the dimension that failed, and the evaluator's output. The [TRACE_DATA] must contain step-level events with timestamps, tool-call arguments, retrieved documents, and the final model output. If your trace format differs, adjust the trace_evidence fields to reference your own event IDs or span IDs. The output schema is designed to be machine-readable so you can pipe results into an incident tracker or dashboard. Before shipping this prompt into an automated pipeline, validate that the JSON output parses correctly and that the model consistently populates ruled_out_categories before proposing a primary hypothesis.
Prompt Variables
Required inputs for the Eval Failure Root-Cause Triage Prompt. Validate each variable before calling the model to prevent misdiagnosis caused by missing or malformed trace data.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[EVAL_RESULT] | The full eval output including score, rubric dimensions, pass/fail status, and any per-dimension commentary | {"overall_score": 0.42, "dimensions": {"faithfulness": {"score": 0.1, "threshold": 0.7, "status": "FAIL"}}} | Must be valid JSON with at least one dimension score. Reject if score values are missing or not numeric. |
[TRACE_EVENTS] | Ordered list of trace events from the production request including timestamps, event types, and payloads | [{"step": 1, "type": "retrieval", "query": "...", "results": [...]}, {"step": 2, "type": "generation", "output": "..."}] | Must contain at least one event. Validate event types against known enum: retrieval, generation, tool_call, routing, truncation, refusal. Reject if empty or unparseable. |
[MODEL_OUTPUT] | The final model response that was evaluated, exactly as delivered to the user or downstream system | "Based on the provided documents, the quarterly revenue increased by 12%." | Must be a non-empty string. Preserve exact formatting including whitespace and special characters. Null or empty output is a valid failure signal but must be explicitly noted. |
[RUBRIC_DEFINITION] | The evaluation rubric used, including dimension names, descriptions, scoring scales, and pass/fail thresholds | {"faithfulness": {"description": "All claims must be supported by retrieved context", "scale": [0, 1], "threshold": 0.7}} | Must include at least one dimension with a defined threshold. Validate that threshold values are within the declared scale range. Reject if dimensions reference undefined scales. |
[SESSION_METADATA] | Context about the request: prompt version, model identifier, timestamp, user segment, and any feature flags active during the request | {"prompt_version": "v2.3.1", "model": "claude-sonnet-4-20250514", "timestamp": "2025-06-15T14:32:00Z", "feature_flags": ["new_retrieval_pipeline"]} | Prompt version and model identifier are required. Timestamp must be ISO 8601. Feature flags field can be empty array but must be present. Reject if version or model is missing. |
[GOLDEN_REFERENCE] | Optional known-good answer or expected output for comparison. Use null when no golden reference exists for this case | "Quarterly revenue grew 12% year-over-year according to the Q3 earnings report." | Null is allowed and must be handled gracefully. When present, must be a non-empty string. Do not fabricate a golden reference if none exists; null triggers comparison-free analysis mode. |
[CONTEXT_WINDOW_SNAPSHOT] | Full context window contents at generation time, including system prompt, retrieved documents, conversation history, and tool outputs | "System: You are a financial analyst...\n\nDocument 1: Q3 Earnings Report...\n\nUser: What was the revenue growth?" | Must be a non-empty string. Validate that the snapshot includes the system prompt prefix and at least one retrieved document or conversation turn. Truncated snapshots should be flagged with a warning but not rejected. |
Implementation Harness Notes
How to wire the Eval Failure Root-Cause Triage Prompt into an automated diagnostic pipeline or manual investigation workflow.
This prompt is designed to be the first step in a structured investigation, not a standalone report generator. It should be wired into a workflow that fetches the relevant trace data, eval rubric, and model output automatically. The prompt's primary job is to produce a structured hypothesis and a checklist of ruled-out categories, which then guides deeper, more expensive diagnostic steps. Avoid using this prompt in a vacuum; its value comes from correlating data that is often siloed in separate observability, evaluation, and logging systems.
To implement this, build a harness function that accepts an eval_failure_event as input. This function must first query your trace store (e.g., LangSmith, Arize, a custom OpenTelemetry collector) to retrieve the full trace for the specific trace_id associated with the failure. It must also fetch the exact evaluation rubric and scorecard from your evaluation platform. The harness then populates the prompt's placeholders: [EVAL_RUBRIC] with the specific criteria that failed, [TRACE_JSON] with a serialized, step-by-step trace including tool calls, retrieved documents, and intermediate outputs, and [MODEL_OUTPUT] with the final production response. The [CONSTRAINTS] placeholder should be pre-filled with a standard instruction to rule out common failure categories (e.g., context truncation, tool-call errors, source-citation gaps) before proposing a root cause.
The output of this prompt is a structured JSON object containing a root_cause_hypothesis, a confidence_score, and a ruled_out_categories list. Your harness must validate this JSON against a strict schema. If validation fails, implement a single retry with the validation error message fed back into the [PREVIOUS_OUTPUT_AND_ERROR] placeholder. Crucially, log the validated hypothesis back to the original eval event as a diagnostic tag. This closes the loop between monitoring and investigation, allowing you to track whether context_window_truncation is a recurring hypothesis across multiple failures. For high-stakes domains like healthcare or finance, the harness should route the final hypothesis to a human-in-the-loop review queue before any prompt or system changes are authorized based on its findings.
For model choice, a model with strong reasoning capabilities and a large context window is required, as the prompt must ingest a potentially massive trace. GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are suitable starting points. Do not use a lightweight model for this task, as it will likely fail to correlate events across a long trace. The primary failure mode of this harness is an incomplete trace: if your tracing infrastructure does not capture step-level inputs and outputs, the prompt will produce a low-confidence hypothesis. Your next step should be to instrument your application to capture the missing data, not to refine the prompt.
Expected Output Contract
Defines the structured JSON output the model must return when performing root-cause triage. Use this contract to validate responses before they enter downstream incident workflows or dashboards.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
triage_id | string (UUID v4) | Must be a valid UUID v4 string. Reject if missing or malformed. | |
eval_failure_summary | object | Must contain eval_name (string), score (float), threshold (float), and timestamp (ISO 8601). All sub-fields required. | |
root_cause_hypothesis | object | Must contain category (enum: PROMPT_DRIFT, RETRIEVAL_GAP, TOOL_ERROR, CONTEXT_TRUNCATION, MODEL_REGRESSION, HALLUCINATION, FORMAT_DRIFT, ROUTING_ERROR, UNKNOWN), confidence (float 0-1), and rationale (string). Rationale must be non-empty. | |
trace_event_correlation | array of objects | Each object must have event_id (string), event_type (string), relevance_score (float 0-1), and evidence_snippet (string). Array must not be empty. Reject if any event_id is null. | |
ruled_out_categories | array of strings | Each string must be a valid enum value from root_cause_hypothesis.category. Array may be empty but must be present. Reject if any value is not a recognized category. | |
recommended_action | object | Must contain action_type (enum: ROLLBACK_PROMPT, FIX_RETRIEVAL, FIX_TOOL_CALL, EXPAND_CONTEXT, ADJUST_ROUTING, HUMAN_REVIEW, NO_ACTION), priority (enum: P1, P2, P3, P4), and description (string). Description must be non-empty. | |
evidence_quality_assessment | object | Must contain trace_completeness (enum: FULL, PARTIAL, MINIMAL), confidence_in_correlation (float 0-1), and missing_evidence_notes (string or null). Null allowed for missing_evidence_notes only when trace_completeness is FULL. | |
human_review_required | boolean | Must be true if root_cause_hypothesis.confidence < 0.7 or root_cause_hypothesis.category is UNKNOWN. Otherwise false. Reject if inconsistent with confidence or category. |
Common Failure Modes
Root-cause triage fails when the investigation jumps to conclusions, ignores the trace, or treats every failure as a prompt problem. These cards help you avoid the most common missteps before you open a deep-dive.
Correlation Without Trace Evidence
Risk: Blaming the model or prompt because an eval score dropped, without inspecting the trace events that produced the output. The real cause is often a silent retrieval gap, a truncated context window, or a tool-call failure that the eval rubric correctly penalized. Guardrail: Require at least one trace-linked event as evidence before accepting any root-cause hypothesis. If no trace event explains the failure, mark the hypothesis as unconfirmed.
Treating the Eval as Ground Truth
Risk: Assuming the eval rubric is perfect and the model output is wrong. LLM judges hallucinate, rubrics drift, and golden sets become stale. A failing eval score may indicate a judge calibration problem or a contaminated reference, not a genuine quality regression. Guardrail: Spot-check at least three failing examples against a human review before committing to a prompt fix. Flag cases where the human disagrees with the eval for rubric recalibration.
Ignoring Context Window Truncation
Risk: Diagnosing a hallucination or missing fact as a generation failure when the evidence was retrieved but dropped from the context window. The model cannot cite what it never saw. Guardrail: Compare the retrieved documents list against the final packed context. If high-relevance documents were truncated, classify the root cause as a context budget problem, not a prompt or model problem.
Confusing Model Regression with Prompt Brittleness
Risk: After a model provider update, eval scores shift. The team rewrites the prompt to restore scores without determining whether the model's capabilities genuinely changed or the prompt overfit the previous model's quirks. Guardrail: Run the same prompt version against both the old and new model on a fixed eval set. If the old model still passes, the prompt is brittle. If both fail, investigate a genuine model regression.
Single-Failure Overgeneralization
Risk: Finding one trace that explains one failure and applying that fix globally. A retrieval gap that explains one bad answer may be irrelevant to 90% of other failures. Guardrail: Cluster failures by trace pattern before proposing fixes. A root-cause hypothesis must explain at least a meaningful fraction of the failure cluster, not just one convenient example.
Skipping the Tool-Call Audit
Risk: The eval says the output is wrong, so the team rewrites the generation prompt. But the model called the wrong tool, passed malformed arguments, or received an error that the generation step faithfully reported. The failure originated upstream. Guardrail: For any eval failure involving tool-derived data, inspect the tool-call sequence first. If the tool selection or arguments were wrong, classify the root cause as a tool-call failure before touching the generation prompt.
Evaluation Rubric
Use this rubric to test the output quality of the Eval Failure Root-Cause Triage Prompt before deploying it to your production triage pipeline. Each criterion maps to a specific failure mode that would make the triage output unreliable or unactionable.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Root-Cause Category Assignment | Output assigns exactly one primary root-cause category from the allowed taxonomy (e.g., Retrieval Gap, Context Truncation, Model Behavior Change, Tool-Call Error, Prompt Brittleness, Hallucination, Format Drift) | Missing category, multiple conflicting categories, or category not in the allowed taxonomy | Parse the output field [ROOT_CAUSE_CATEGORY] and validate against the allowed enum list. Fail if empty, null, or out-of-enum |
Trace Segment Attribution | Output links the root-cause hypothesis to at least one specific trace segment ID or step number from [TRACE_DATA] | Vague attribution like 'somewhere in retrieval' without a trace segment reference, or references a segment ID not present in the input trace | Extract all referenced segment IDs from the output and cross-reference against [TRACE_DATA] step IDs. Fail if no match or no segment referenced |
Eval Score Correlation | Output explicitly states which eval dimension(s) failed and maps the failure to the hypothesized root cause with a stated confidence level | Output describes the root cause without mentioning the specific eval dimension that failed, or claims correlation without evidence from [EVAL_RESULT] | Check that at least one field from [EVAL_RESULT] is cited by name in the root-cause reasoning. Fail if eval dimensions are absent |
Evidence Chain Completeness | Output provides a step-by-step evidence chain: eval failure → trace event → hypothesized cause, with no missing links | Skipped intermediate steps, e.g., 'eval failed because retrieval was bad' without showing which retrieval step, what was missing, and how that caused the eval failure | Manual review or LLM-as-judge check: does the output contain at least three linked statements forming a causal chain? Fail if fewer than three linked causal statements |
Alternative Hypothesis Exclusion | Output lists at least one ruled-out alternative root cause with a brief reason for exclusion | Output presents a single hypothesis without considering alternatives, or dismisses alternatives without reasoning | Check for presence of a dedicated 'Ruled-Out Alternatives' section or field. Fail if absent or if exclusion reasoning is empty |
Confidence Calibration | Output includes a confidence score (0.0-1.0) for the primary hypothesis that is consistent with the strength of trace evidence presented | Confidence score is 1.0 with weak evidence, or score is missing, or score contradicts the hedging language in the analysis | Parse [CONFIDENCE_SCORE] field. Fail if null, outside 0.0-1.0 range, or if score > 0.9 but evidence chain contains hedging words like 'possibly', 'may have', 'unclear' |
Actionable Next Step | Output recommends exactly one concrete next investigation step tied to the hypothesized root cause, not a generic suggestion | Vague next steps like 'investigate further' or 'check the model' without specifying what to check, where, or how | Validate that the next step references a specific trace segment, tool, query, or config to inspect. Fail if no actionable specificity |
Output Schema Compliance | Output strictly matches the [OUTPUT_SCHEMA] with all required fields present and correctly typed | Missing required fields, extra untyped fields, or type mismatches (e.g., string where array is expected) | Validate output JSON against [OUTPUT_SCHEMA] using a schema validator. Fail on any validation error |
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
Start with the base triage prompt but replace the full trace schema with a simplified input: paste the eval score, the model's final output, and a short description of the failure. Use a single-turn prompt without tool definitions.
code[EVAL_SCORE]: 0.2/1.0 [EVAL_DIMENSION]: factual_accuracy [FAILURE_DESCRIPTION]: Response claimed the API supports batch endpoints, but docs say otherwise. [MODEL_OUTPUT]: ...
Skip structured JSON output initially; accept a paragraph-form hypothesis. This lets you validate the reasoning pattern before investing in trace parsing.
Watch for
- Overly broad hypotheses that don't isolate a specific trace event
- Missing distinction between 'model hallucinated' and 'retrieval returned wrong doc'
- No confidence qualifier on the root-cause guess

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