Agent Autopsy — Forensic Debugger for Failed AI Agent Runs
Problem
An agent run can complete successfully while its answer or actions are wrong. A transcript can reveal repeated calls, ignored errors and unfinished work, but a clean scan does not establish correctness.
Business Impact
Agent Autopsy helps an engineer prioritize suspicious parts of an agent transcript. Its findings are heuristic signals to investigate, not verified root causes. The reproducible evaluation below records both detected patterns and cases where the engine raises a false alarm or misses a problem; it does not claim measured customer savings.
System Approach
- Next.js 16 App Router app with the forensic engine in lib/autopsy.ts
- scan + diagnose API routes: heuristic classifier first, optional LLM pass second
- Five explicit failure signatures detected from transcript structure, not vibes
- Optional local Ollama (qwen3:14b) pathologist's note for root cause
- 6 Vitest tests covering the signature classifier
Key Decisions & Trade-offs
- Heuristics-first for an instant verdict — the LLM is an optional deepening, not the critical path
- Local LLM over cloud — agent traces are sensitive and stay on the machine
- Five named signatures over a black-box score — engineers want a cause they can act on
- Zero runtime dependencies in the engine — rebuilt from a v1 single-file prototype with no shortcuts
Current Status
Public and open source (MIT) at github.com/rohitguta2432/agent-autopsy. Heuristic verdicts plus optional local qwen3:14b diagnosis working; 6 Vitest tests passing. The 15-second demo diagnoses the app's own sample corpse on camera.
Roadmap
- Add more failure signatures (silent truncation, tool-arg drift)
- Framework adapters to import LangChain / CrewAI transcripts directly
- Shareable report links for team triage
What I'd Improve Next
- A hosted demo with a bundled small model so no local setup is needed
- Batch autopsy mode to run inside CI on every failed agent run
Measured case study: what a clean scan can miss
On 2026-11-01, I ran the unchanged Agent Autopsy engine against twelve synthetic transcripts. The seven controls matched its documented signatures (7/7); none of the five boundary probes matched the desired outcome (0/5). These are cases I wrote after inspecting the code, not client results or an estimate of production accuracy.
What the boundary probes revealed
- Legitimate job polling was marked as a death loop because the arguments repeated.
- Successful responses containing “no error” triggered error blindness.
- Equivalent JSON argument strings with different formatting escaped loop detection.
- An undeclared tool in the second parallel call was missed.
- A wrong final answer produced no finding. Answer correctness is outside this engine’s scope.
How I measured it
Each case had ten warmup runs and 100 timed runs on Apple M5 Pro, using Node v22.23.3. The largest input was about 200 KB; its observed p95 was 0.1429 ms. Timing includes parsing and heuristic analysis only. It excludes the web interface, HTTP and the optional Ollama diagnosis. No model API was called; this does not measure infrastructure or engineering costs. Timings vary by hardware and load.
The practical lesson: use these findings to prioritize investigation, then verify the action and final answer against the task. A clean scan is not a release approval. Before using this on a team’s traces, define the supported transcript format and evaluate both false alarms and missed failures on approved examples from that workflow.
Reproduce the experiment · Read every measured result · Evaluation cases and runner · Pinned engine source
For a defined evaluation or repair, discuss an AI engineering scope. If interpreting failures needs work with your operators and internal systems, scope a forward deployed engineering pilot with agreed task-outcome checks, an alert reviewer and a handover.
Work with me on an AI system
If you need help building or integrating a system like Agent Autopsy — Forensic Debugger for Failed AI Agent Runs, choose the scope that fits your team:
- Hire a Forward Deployed Engineer (AI) — Work embedded with your users and engineers, from workflow discovery through integration, evaluation and rollout.
- Freelance AI Engineer & AI Architect — Scope an AI feature or reserve ongoing engineering time for architecture, implementation, evaluation and handover.
Explore More
- tinyvoice — Fine-Tune a Model in Your Own Voice in an Afternoon — Training your own language model sounds like a PhD job that needs a GPU cluster, so most developers never try.
- snap3d — One Photo In, an Editable 3D Model Out — A photo shows you one side of an object; the other five sides are a guess.
- Agentic OS — Force-Directed Map of a 387-Skill Claude Code Setup — An agent setup grows one plugin at a time until it has hundreds of skills, and nobody can see what it actually contains.
- claude-autodev — Autonomous 8-Stage Dev Pipeline for Claude Code — Agentic coding tools stop at a diff.
- All 47 projects — the full catalogue, with live links and repos.