Skip to content

About

This is the open-source companion repo for The Agent Autopsy: 17 Production Disasters, Diagnosed — a written lesson series by Lawrence Jefferson II (Menoko OG).

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Autopsy

17 ways AI agents fail in production. Each one runnable. Each one fixed. Read the series: The Agent Autopsy

The Agent Autopsy site: a retro terminal replays the runaway loop from failure 1

This is the open-source companion repo for The Agent Autopsy: 17 Production Disasters, Diagnosed, a written lesson series by Lawrence Jefferson II (Menoko OG).

Most agent courses teach you to build one. This one teaches you what breaks when you do.


Why this exists

If you've shipped an AI agent to production, you already know: the demo works, the prod doesn't. The 17 folders in this repo are the failures we've actually seen, runaway loops that burn tokens overnight, tools that lie silently, agents that fabricate results when they should fail loud.

Every failure here has two files:

  • broken.py: the bug, runnable, fails the way it does in real systems
  • fixed.py: the fix, with the lesson in the diff

Read the broken code. Run it. Watch it fail. Then read the fix.


The 17 Failures

Loop & Control

  1. Runaway Loop: agent calls itself forever
  2. Stuck Agent: can't recognize it's done
  3. Confidence Collapse: second-guesses every step

Tool & Integration

  1. Tool Hallucination: invents tools that don't exist
  2. Silent Tool Failure: treats errors as success
  3. Wrong Tool Pick: search when it should calculate

State & Memory

  1. Context Collapse: forgets the original goal
  2. State Drift: state quietly corrupts between steps
  3. Amnesia Bug: re-does work it already finished

Trust & Safety

  1. Prompt Injection via Tool Output: web page hijacks the agent
  2. Confident Liar: fabricates results instead of failing
  3. No Human Brake: irreversible action, no checkpoint
  4. Reasoning-Action Mismatch: says one thing, does another
  5. Rubber-Stamp Verifier: the checker believes the worker
  6. Memory Poisoning: a planted fact pays out later
  7. Silent Degradation: the metric stays green while the model fails
  8. Limit in the Prompt: a cap that exists only as a sentence

Quick start

git clone https://github.com/MenokoOG/agent-autopsy.git
cd agent-autopsy
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # add your API key

# Watch failure #1 break
cd 01-runaway-loop
python broken.py

# See the fix
python fixed.py

Who this is for

  • Engineers who've built an agent that worked once and never again
  • Veteran AI builders who want failure case studies, not framework tours
  • Teams putting agents in front of real users and need to know what to harden

Not for total beginners. If you've never written an API call, start elsewhere first.


Philosophy

This repo follows the LAHA principle, Love All Humans Always. Every failure mode here is also a human-impact failure: wasted money, broken trust, decisions taken without consent. Building agents that fail safely isn't an engineering nicety. It's an ethical baseline.

Humans keep final authority over major decisions. Agents earn trust by being auditable, not by being autonomous.


License

MIT. Use it, fork it, teach from it. Attribution appreciated.

The written lessons

Full written walkthroughs of every failure, with the diagnosis and the diff, are published as The Agent Autopsy series.


Built by Lawrence Jefferson II (Menoko OG), driven by LAHA: Love All Humans Always.

About

This is the open-source companion repo for The Agent Autopsy: 17 Production Disasters, Diagnosed — a written lesson series by Lawrence Jefferson II (Menoko OG).

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages