This prompt is for incident responders, SRE teams, and governance engineers who need to reconstruct why a multi-agent workflow failed. It takes raw execution artifacts—agent decision logs, tool call traces, error outputs, state snapshots, and handoff records—and produces a structured, blameless root cause analysis report. The ideal user is someone who already has access to the full execution trace but cannot attribute the failure to a single component by inspection alone. The prompt forces systematic reasoning across agent boundaries, tool interactions, and state transitions that human reviewers often overlook when scanning logs manually.
Prompt
Agent Root Cause Analysis Audit Prompt

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and boundaries for the Agent Root Cause Analysis Audit Prompt.
Use this prompt when a production incident involves two or more agents and the failure mode is non-obvious: a task was dropped during handoff, an agent acted on stale context, a tool returned an unexpected error that cascaded, or an arbitration decision produced an incorrect final answer. The prompt is designed for post-incident analysis, not real-time alerting or live debugging. You must provide complete artifacts as input—partial logs or redacted traces will produce unreliable conclusions. The prompt includes built-in checks against premature conclusions, ignored contributing factors, and misattribution of blame to a single agent when the root cause is systemic.
Do not use this prompt for single-agent debugging, real-time monitoring, or incidents where the failure is already understood. It is not a replacement for structured logging or observability tooling; it is a reasoning aid that complements your existing incident response process. Before running this prompt, ensure you have collected all relevant artifacts and that sensitive data has been redacted according to your organization's policies. The output should be reviewed by a human incident commander before being shared with stakeholders or attached to a postmortem document.
Use Case Fit
Where the Agent Root Cause Analysis Audit Prompt delivers reliable value and where it introduces unacceptable risk. Use these cards to decide if this prompt fits your incident response workflow before you integrate it.
Good Fit: Structured Post-Incident Reviews
Use when: you have a complete set of agent logs, tool-call traces, and state snapshots from a failed multi-agent workflow and need a blameless, evidence-grounded root cause analysis report. Guardrail: validate that all required log sources are present before invoking the prompt; missing data produces hallucinated causes.
Bad Fit: Real-Time Incident Response
Avoid when: the incident is still active and you need immediate mitigation steps. This prompt is designed for post-hoc analysis, not live triage. Guardrail: route active incidents to an on-call runbook prompt first; use this prompt only after the system is stable and logs are complete.
Required Inputs: Complete Trace Artifacts
Risk: the prompt will fabricate plausible-sounding causes if fed partial or inconsistent logs. Guardrail: enforce a pre-flight check that confirms the presence of agent decision logs, tool-call records, handoff payloads, error traces, and state snapshots before analysis begins.
Operational Risk: Premature Conclusions
Risk: the model may latch onto the first error it finds and ignore upstream contributing factors or systemic patterns. Guardrail: include explicit instructions in the prompt to enumerate all contributing factors, rank them by evidence strength, and flag any conclusions that rely on a single data point.
Operational Risk: Blame Language Leakage
Risk: even with blameless instructions, the model may attribute failure to a specific agent role in ways that read as personal or team blame. Guardrail: add output constraints that require system-level language (e.g., 'the routing agent did not receive the handoff payload') and post-process the report to strip agent-personifying language before sharing.
Bad Fit: Single-Agent Failures Without Handoff Complexity
Avoid when: the failure occurred in a single-agent workflow with no handoffs, arbitration, or multi-agent coordination. A simpler error trace analysis prompt will be faster and less prone to over-analysis. Guardrail: classify the incident topology before selecting the prompt; reserve this prompt for multi-agent or chain failures only.
Copy-Ready Prompt Template
A copy-ready prompt template for synthesizing multi-agent logs into a blameless root cause analysis report.
This prompt is the core instruction set you will send to an LLM to perform a structured root cause analysis on a failed multi-agent workflow. It is designed to be pasted directly into your model's context window. Before execution, you must replace every square-bracket placeholder with real data from your incident. The prompt forces the model to act as an impartial investigator, synthesizing raw telemetry—logs, error traces, and state snapshots—into a blameless report that prioritizes systemic fixes over individual fault.
markdownYou are an impartial incident investigator analyzing a failed multi-agent workflow. Your goal is to produce a blameless root cause analysis report based strictly on the provided evidence. Do not speculate beyond the provided data. If the evidence is insufficient to determine a root cause, state that explicitly. ## INPUT DATA - **Workflow Logs:** [WORKFLOW_LOGS] - **Error Traces:** [ERROR_TRACES] - **Agent State Snapshots:** [STATE_SNAPSHOTS] - **Expected Workflow Definition:** [WORKFLOW_DEFINITION] ## ANALYSIS CONSTRAINTS - **Blameless Posture:** Focus on systemic failures, process gaps, and technical triggers. Do not assign blame to individuals or teams. - **Evidence Grounding:** Every causal claim must be supported by a direct quote or timestamped reference from the INPUT DATA. - **Premature Conclusion Check:** Before finalizing, explicitly list any alternative hypotheses that were considered and why they were ruled out based on the evidence. - **Contributing Factors:** Identify all contributing factors, not just the initial trigger. Classify each as a trigger, amplifier, or latent condition. ## OUTPUT SCHEMA Respond with a JSON object conforming to this structure: { "incident_summary": "A concise, one-paragraph summary of what happened.", "timeline": [ { "timestamp": "ISO 8601 timestamp", "agent": "Agent identifier", "event": "Description of the event", "evidence_ref": "Direct quote or log line from INPUT DATA" } ], "root_cause_analysis": { "primary_trigger": "The initial event that started the failure chain.", "contributing_factors": [ { "type": "trigger | amplifier | latent_condition", "description": "Description of the factor.", "evidence_ref": "Supporting evidence from INPUT DATA" } ], "ruled_out_hypotheses": [ { "hypothesis": "A potential cause that was investigated and rejected.", "reason_for_rejection": "Why the evidence does not support this hypothesis." } ] }, "systemic_recommendations": [ { "category": "handoff_protocol | state_management | error_handling | tool_contract | observability | other", "recommendation": "Actionable recommendation to prevent recurrence.", "addressed_factors": ["List of contributing factors this recommendation addresses"] } ], "evidence_gaps": ["List of questions that cannot be answered with the provided data."] }
To adapt this template, start by mapping your internal data sources to the placeholders. [WORKFLOW_LOGS] should contain the raw, chronological execution logs from your agent orchestration framework. [ERROR_TRACES] must include full stack traces and error codes, not just the final exception message. [STATE_SNAPSHOTS] are critical for diagnosing handoff failures; provide the input and output payloads for each agent. [WORKFLOW_DEFINITION] is the expected execution graph or SOP, which serves as the baseline for detecting deviations. If your system does not capture one of these data types, replace the placeholder with a statement like NO STATE SNAPSHOTS AVAILABLE to prevent the model from hallucinating missing data.
Before integrating this prompt into an automated incident response pipeline, you must build a validation layer around it. The model's JSON output must be checked for schema compliance, and every evidence_ref field should be programmatically verified as a substring match within the original INPUT DATA to prevent hallucinated citations. For high-severity incidents, the generated report should be treated as a draft and routed to a human responder for review and approval before being published to a postmortem register. Never use this prompt to make automated decisions about system rollback or agent permission changes without human-in-the-loop confirmation.
Prompt Variables
Inputs the Agent Root Cause Analysis Audit Prompt needs to produce a reliable, blameless report. Validate each variable before execution to prevent hallucinated root causes or premature conclusions.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[INCIDENT_TIMELINE] | Chronological log of events, state changes, and agent actions from the failed workflow execution. | 2025-03-15T14:00:00Z Agent-Planner assigned task T1; 14:00:05Z Agent-Executor tool call 'query_db' failed with timeout. | Must be a non-empty string with timestamps. Parse check: confirm ISO-8601 timestamps present. Reject if timeline is empty or contains only final error without preceding events. |
[AGENT_ROLE_MANIFEST] | Defines each agent's authorized capabilities, boundaries, and expected handoff contracts for the workflow under analysis. | Agent-Planner: authorized to decompose tasks, assign to executors, replan on failure. Agent-Executor: authorized to call tools [query_db, run_script], must escalate on tool failure. | Schema check: must include agent name, authorized actions, and escalation rules for each agent. Reject if any agent in [INCIDENT_TIMELINE] lacks a manifest entry. |
[ERROR_TRACE] | Structured error payload including stack traces, tool failure responses, timeout events, and agent exception messages. | ToolError: query_db timeout after 30s; Agent-Executor exception: 'MaxRetriesExceeded'; Agent-Planner state: 'waiting_for_executor'. | Parse check: must contain at least one error code, exception type, or failure signal. Null allowed only if incident is a logic error without explicit exceptions. Validate that error source matches an agent or tool in the manifest. |
[STATE_SNAPSHOTS] | Key-value state dumps captured at critical points: before handoff, after tool calls, and at failure time. | Before handoff: {task_id: T1, status: pending, assigned_to: Executor-3}. At failure: {task_id: T1, status: failed, retries: 3, last_error: timeout}. | Schema check: each snapshot must include a timestamp and a state payload. Reject if snapshots are missing for handoff boundaries identified in [INCIDENT_TIMELINE]. Null allowed for state before first action only. |
[WORKFLOW_DEFINITION] | Expected workflow graph, including dependencies, parallel branches, and success criteria for the execution that failed. | Workflow: Plan -> Execute -> Validate. Execute step: max 3 retries, timeout 30s, fallback agent on failure. Success: task status == 'completed' and validation == 'passed'. | Parse check: must define steps, dependencies, and termination conditions. Reject if workflow definition contradicts the actual execution path in [INCIDENT_TIMELINE] without explanation. |
[OUTPUT_SCHEMA] | Target structure for the root cause analysis report, defining required sections and field constraints. | Sections: Executive Summary, Timeline Reconstruction, Root Cause(s), Contributing Factors, Blameless Recommendations, Evidence Appendix. | Schema check: must list required sections and field types. Reject if schema omits 'Root Cause(s)' or 'Evidence Appendix'. Validate that schema fields map to evidence available in other inputs. |
[CONSTRAINTS] | Policy rules for the analysis: blameless language requirement, prohibition on single-cause conclusions, evidence citation mandate. | Use blameless language (no individual or team blame). Identify at least one contributing factor beyond the primary cause. Cite specific log entries for every causal claim. | Parse check: must include language constraints, evidence rules, and conclusion requirements. Reject if constraints allow single-cause conclusions or lack citation requirements. Human review required if constraints are modified from the default blameless policy. |
[PREVIOUS_INCIDENT_REPORTS] | Optional set of prior root cause analyses from the same workflow or agent chain for pattern detection. | Incident-42: root cause was timeout misconfiguration in Executor pool; contributing factor was missing health check in Planner handoff. | Null allowed for first incident. If provided, validate that each report has a root cause section and timestamp. Reject if reports reference agents not in [AGENT_ROLE_MANIFEST]. Use for pattern matching only, not as a substitute for fresh analysis. |
Implementation Harness Notes
How to wire the Agent Root Cause Analysis Audit Prompt into an incident response or audit pipeline.
The Agent Root Cause Analysis Audit Prompt is designed to be a critical node in a post-incident review pipeline, not a standalone chat interaction. It should be invoked automatically when a multi-agent workflow terminates with an error status, exceeds a latency threshold, or is flagged by a human operator. The harness must assemble the required inputs—agent decision logs, tool call traces, error stacks, state snapshots, and the original user request—into a single structured context block before calling the model. Because the output is a formal RCA report, the implementation must treat this prompt as a governed artifact generator: the report should be versioned, stored immutably, and linked to the incident ticket before any human reviews it.
Wire the prompt into your incident management system (e.g., PagerDuty, ServiceNow, or a custom orchestrator) using a webhook or event-driven function. The function should: (1) collect all relevant artifacts from your agent observability store, (2) validate that required inputs are present and non-empty—reject the run if agent logs are missing or truncated, (3) assemble the prompt with the [INCIDENT_TIMELINE], [AGENT_LOGS], [ERROR_TRACES], and [STATE_SNAPSHOTS] placeholders populated, (4) call a capable reasoning model (Claude 3.5 Sonnet or GPT-4o are appropriate for the analytical depth required), and (5) parse the output against a strict JSON schema that includes fields for root_cause, contributing_factors, timeline_of_failure, premature_conclusions_avoided, and recommendations. If parsing fails, retry once with a repair prompt that includes the schema and the raw output. After two failures, escalate to a human with the raw model response attached.
Before the RCA report is accepted, run a set of automated evals. At minimum, check that the root_cause field is not empty, that contributing_factors includes at least one factor beyond the immediate error, and that the premature_conclusions_avoided section explicitly lists hypotheses the model considered and rejected with reasoning. Use a second LLM judge prompt to verify that every factual claim in the report is grounded in the provided logs—flag any hallucinated event timestamps, agent names, or tool calls. Store the eval results alongside the report. For high-severity incidents, route the report to a human incident commander for approval before it is published to the incident timeline. Never allow the model to directly close an incident ticket or trigger a rollback without human confirmation. The harness should log the full prompt, response, and eval results to your audit store for future governance reviews.
Expected Output Contract
Fields, data types, and validation rules for the generated RCA report. Use this contract to parse, validate, and store the agent's output before surfacing it to an incident responder or downstream system.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
incident_id | string | Must match the [INCIDENT_ID] input exactly; reject on mismatch or empty string. | |
rca_summary | string (<=500 chars) | Must be non-empty; length check enforced; must not contain phrases like 'I think' or 'possibly' without explicit uncertainty markers. | |
root_cause | object | Must contain 'primary_cause' (string) and 'confidence' (float 0.0-1.0); confidence below 0.3 triggers a retry or human-review flag. | |
contributing_factors | array of strings | Must contain at least one entry; each string must be <=200 chars; empty array triggers rejection. | |
timeline | array of objects | Each object must have 'timestamp' (ISO 8601), 'agent_id' (string), 'event' (string), and 'evidence_ref' (string or null); reject if events are out of chronological order. | |
evidence_log | array of objects | Each object must have 'source' (one of: 'log', 'trace', 'state_snapshot', 'tool_output'), 'reference' (string), and 'excerpt' (string); empty array triggers rejection. | |
premature_conclusions_checked | boolean | Must be true; if false, the output is considered incomplete and triggers a retry with explicit instruction to re-evaluate. | |
human_review_required | boolean | Must be true if root_cause.confidence < 0.7 or if contributing_factors contains any entry flagged as 'speculative'; otherwise false. |
Common Failure Modes
Root cause analysis prompts fail in predictable ways when applied to multi-agent systems. These cards cover the most common failure modes and the guardrails that prevent them.
Premature Root Cause Closure
What to watch: The prompt latches onto the first plausible cause in the timeline and ignores later contributing factors. Multi-agent failures often have cascading causes where the initial trigger is not the root cause. Guardrail: Require the prompt to enumerate at least three candidate causes before selecting the primary root cause, and include a contributing factors section that cannot be left empty.
Hallucinated Timeline Events
What to watch: The model fabricates agent actions, tool calls, or state transitions that do not appear in the provided logs. This is especially common when log gaps exist or when the model tries to make the narrative coherent. Guardrail: Require every asserted event to cite a specific log line or timestamp. Add a post-generation validation step that checks each cited event against the source logs and flags unsupported claims.
Blame Attribution to Wrong Agent
What to watch: The analysis incorrectly assigns fault to the last agent in the chain or the most visible failure point, missing upstream agents that passed corrupted state or incomplete context. Guardrail: Include a mandatory upstream state inspection step in the prompt that examines the inputs each agent received before evaluating its actions. Cross-reference handoff payloads for data corruption.
Ignored Tool Call Failures
What to watch: The prompt focuses on agent reasoning errors while overlooking silent tool failures, timeout retries, or malformed API responses that caused the agent to act on bad data. Guardrail: Require a dedicated tool-call audit section that examines every external call for error codes, unexpected nulls, and retry patterns. Flag any tool response that was not validated before use.
Confidence Without Evidence
What to watch: The output presents conclusions with high certainty even when the evidence is ambiguous, incomplete, or contradictory. This misleads incident responders into accepting a plausible but unverified explanation. Guardrail: Require an explicit confidence rating for each root cause candidate tied to evidence completeness. If log gaps exceed a threshold, the prompt must escalate for human review rather than produce a definitive conclusion.
Context Window Truncation Artifacts
What to watch: Long multi-agent traces exceed the context window, forcing truncation that drops critical early events or mid-chain handoffs. The analysis then produces conclusions from an incomplete picture without signaling the data loss. Guardrail: Add a pre-processing step that summarizes each agent's segment before analysis. Include a completeness check that verifies all agents in the expected chain are represented in the provided context, and flag missing segments explicitly.
Evaluation Rubric
Use this rubric to test the quality of the Agent Root Cause Analysis Audit Prompt before shipping it into your incident response workflow. Each criterion targets a known failure mode in multi-agent failure analysis.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Blameless Language | Report contains zero attributions of intent, negligence, or blame to agents or humans. Language is strictly systems-focused. | Phrases like 'Agent X failed to', 'Developer misconfigured', or 'negligent handoff' appear in the output. | Run prompt on 10 incident logs containing known human and agent errors. Scan output with a keyword blocklist for blame-oriented language. |
Root Cause Depth | Report identifies at least one root cause at the system, contract, or configuration level, not just the first visible symptom. | Report stops at the first error message or timeout without tracing back to the upstream condition that triggered it. | Provide a log where a timeout is caused by a silent handoff schema mismatch. Check that the report names the schema mismatch, not just the timeout. |
Contributing Factor Coverage | Report lists all contributing factors present in the ground-truth log, including latent conditions that did not directly trigger the failure. | Report omits a known contributing factor such as a deprecated tool version, missing retry policy, or stale agent role definition. | Use a curated log with 4 known contributing factors. Require the report to identify at least 3 of 4 to pass. |
Premature Conclusion Check | Report explicitly flags any remaining uncertainty and avoids stating a single cause with high confidence when evidence is ambiguous. | Report asserts a definitive root cause with high confidence when the log contains conflicting signals or missing data. | Feed a log with two equally plausible root causes. Check that the output includes an uncertainty statement and does not pick one cause as definitive. |
Evidence Citation | Every causal claim in the report is backed by a reference to a specific log line, timestamp, or state snapshot. | Report makes a causal claim without a supporting reference, or cites a log line that does not contain the claimed evidence. | Extract all causal claims from the output. For each claim, verify the cited log line exists and supports the claim. Require 100% citation accuracy. |
Timeline Accuracy | Report reconstructs the sequence of events in correct chronological order with timestamps matching the source logs. | Report reorders events, invents timestamps not present in the log, or places an effect before its cause. | Provide a log with 10 timestamped events in a known order. Check that the report's event sequence preserves the correct partial order. |
Schema Compliance | Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys. | Output is missing required fields such as 'root_causes', 'timeline', or 'contributing_factors'. Contains hallucinated fields. | Validate output against the expected JSON Schema. Require strict validation with no additional properties allowed. |
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 single incident log and minimal output constraints. Focus on getting a coherent narrative before adding strict schema validation. Replace [LOG_SOURCE] with raw text from your agent trace. Drop the [EVIDENCE_ANCHOR] requirement and accept free-text analysis.
Watch for
- The model inventing causes not present in the logs
- Premature conclusions before examining all contributing factors
- Missing the difference between correlation and causation in agent failures

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