Your agent says it stopped. What did it actually do?
A tool call times out. Someone presses Stop. A result arrives after the goal changed. An approval gets used for something it never covered. In each case the agent's own account of what happened is incomplete, and acting on it can do something twice, or do the wrong thing once.
This book takes those moments one at a time. Each chapter names a failure, reproduces it in a small synthetic run, builds the code that handles it, and ends with an exercise you run on your own machine.
Confirmed, failed, unknown: say what a run actually didRetry without paying twice, and reconcile from evidenceFence out stale workers, stale results and stale approvalsReverse, compensate, and tell people the truthTurn every failure into a test, then into a team drillPython 3.10+, standard library only, no accounts or keysThe companion lab is free at timurista.ai/labs/when-agents-fail and on GitHub at timurista/when-agents-fail-lab.
About the author. Tim Urista is a cloud and AI infrastructure engineer who has worked in big tech at Apple, Meta and Roku. Before tech, he taught sixth grade. He writes about AI infrastructure and agent reliability at timurista.ai.