Agent Failure Post-Mortem Analyzer
Analyzes a transcript or log of an AI agent that failed, went off-track, or produced a bad output, and identifies the root cause with a specific prompt or logic fix.
Developers debugging AI agents in production or during testing who need a structured root-cause analysis instead of guessing why an agent went off the rails.
You are an AI systems debugger who specializes in diagnosing why agents fail or behave unexpectedly.
Agent's system prompt (or relevant excerpt): {{system_prompt_excerpt}}
Transcript/log of the failed run: {{failure_transcript_or_log}}
What the agent was supposed to do: {{intended_behavior}}
What actually happened: {{actual_behavior}}
Do the following:
1. Pinpoint the exact step in the transcript where the agent's behavior first diverged from what was intended (not just where the failure became obvious, but where it actually started going wrong).
2. Classify the root cause into one of these categories: ambiguous instructions, missing context/information the agent needed, a tool call error or misuse, the agent misunderstanding the user's actual intent, a looping/repetition failure, or the agent correctly following instructions that were themselves flawed.
3. Explain the root cause in plain terms, quoting or referencing the specific transcript moment that supports the diagnosis.
4. Propose a specific, concrete fix: either an exact edit to the system prompt, a suggested tool/logic change, or an added guardrail, and explain how it would have prevented this specific failure.How to use
- Paste the relevant system prompt and the full transcript or log of the failed agent run.
- Describe clearly what the agent was supposed to do versus what it actually did.
- Apply the proposed fix directly to your system prompt or agent logic.
- Re-run a similar scenario after the fix to confirm the specific failure mode has been resolved.
Example input
System prompt excerpt: 'Search the web for relevant pricing data and summarize findings.' Transcript: [agent searches once, gets a thin result, then fabricates additional pricing figures not found in the search results]. Intended behavior: Only report verified pricing data. Actual behavior: Agent invented plausible-sounding numbers.
Example output
A diagnosis pinpointing the divergence at the moment the agent received a thin search result and continued generating content instead of stopping or searching again, classified as 'missing context/information the agent needed' combined with an instruction gap around what to do when search results are insufficient, and a specific fix adding an explicit line to the system prompt instructing the agent to state 'insufficient data found' rather than fabricate when search results don't fully answer the query.
Customization tips
- — If the failure involved a specific tool call, include the raw tool call and its response in the transcript for a more precise diagnosis.
- — For recurring failure patterns across multiple runs, paste 2-3 transcripts at once and ask for a shared root cause across all of them.
- — If you suspect the issue is a flawed underlying instruction rather than an agent error, say so explicitly to guide the classification.
Tags
FAQ
What is this prompt for?
How should I customize it?
Are there any limitations?
How is it different from a basic prompt?
Related Prompts
All AI Agents prompts →Agent System Prompt Stress Tester
Pressure-tests an AI agent's system prompt by generating edge-case user inputs designed to expose ambiguity, scope creep, or unsafe behavior before deployment.
Agent Task Decomposition Planner
Breaks a broad goal into a structured set of sub-tasks an AI agent can execute step by step, with clear success criteria and handoff points for human review.
Multi-Agent Role Designer
Designs a clean division of labor for a multi-agent system, defining each sub-agent's role, boundaries, and handoff protocol so agents don't overlap or conflict.
Related Skills
Agent Prompt & Tool Spec Designer
Designs a complete system prompt and tool specification for an LLM agent from a description of what the agent should do.
Debugging and Root Cause Analyst
Investigate software defects systematically using evidence, hypotheses, reproduction, instrumentation, isolation, and verification.
Code Review & Refactor Assistant
Reviews a pasted code snippet for bugs, readability, and performance issues, then delivers a prioritized refactor with explanations for each change.
Related Articles
How do I evaluate an AI agent before trusting it?
Evaluate an AI agent with realistic tasks, edge cases, tool failures, permission checks, output rubrics, logs, and human review before using it in production.
How is an AI agent different from a chatbot?
A chatbot usually answers messages. An AI agent can plan, use tools, follow a workflow, make decisions within boundaries, and sometimes take actions after approval.
What is an AI agent in simple words?
An AI agent is a system that uses a model to reason through a task and may use tools, memory, or workflows to complete steps beyond a single chat response.