Skip to content

Book · From $9.99

When Agents Fail

A recovery lab for agents that change real things

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. 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.

Who it’s for

  • Engineers building agents that call tools with real side effects: payments, orders, emails, records.
  • Tech leads who need to say what a failed or stopped run actually did, and recover without doing it twice.
  • Anyone who learns by running code: every chapter ends with an exercise in Python, standard library only.

What you get

  • What actually happened Confirmed, failed, unknown: say what a run actually did, keep a run log that survives a crash, and return an honest summary after Stop.
  • Not doing it twice Retry without paying twice, reconcile from evidence, and fence out stale workers.
  • When the world moved Results that arrive after the goal changed, approvals that expire and recipients that change, and an agent that says it finished.
  • Recovering honestly Reverse, compensate, and tell people the truth, then hand a broken run to the next owner.
  • Never again Turn every failure into a test, then into a team drill.
  • The companion lab, free 16 runnable exercises with checks and reference answers. Python 3.10+, standard library only, no accounts or keys.
Kindle or paperback on Amazon · From $9.99

Terms

Formats
Kindle ebook ($9.99) and 7 × 10 in paperback ($24.99, 304 pages), first edition, November 2026. Sold and delivered by Amazon.
ISBN
Paperback: 9798141005718.
The lab
MIT licensed, free at timurista.ai/labs/when-agents-fail and on GitHub, whether or not you buy the book.

Honest notes

  • Every scenario, shop, product, person, log line and number in the examples is synthetic, written for teaching.
  • Independent publication by Tim Urista. Not affiliated with or endorsed by any AI vendor.
  • Test recovery code against your own systems before you rely on it.

Questions or feedback?
I reply to every note.

Say hi