Engineering Around a Stochastic Component
Agent Reliability: Why 95% Per Step Is a Broken System
Reliability compounds multiplicatively. No prompt changes the exponent — you change the base or you change the number of steps.
The arithmetic that governs every agent, and that demos are built to hide: step reliability multiplies. A step that succeeds 95% of the time, run twenty times, completes end to end 36% of the time. At 99% per step, twenty steps gets you to 82%. Nothing about prompting changes the exponent. You either raise the per-step base or you cut the number of steps, and most teams try a third thing that does not work, which is writing a better prompt.
0.95^20 = 36%
a 95%-reliable step, twenty times — the real reason impressive demos do not become products
The three fixes, in order of effect
- Fewer steps. Every step you replace with ordinary deterministic code is a step that succeeds every time. The best agents in production are mostly normal software with a model placed at the two or three points that genuinely require judgment. An agent that decides what to do and then calls one reliable function beats an agent that improvises eight calls.
- Checkpoints. Validate state between steps and halt on failure rather than letting a wrong intermediate result propagate into five dependent ones. A cheap verifier that catches most bad steps raises the base more than any model upgrade available to you.
- Idempotency. Retries are your main reliability tool and also your main source of duplicate side effects. An agent that resends an email on retry is worse than one that fails loudly. Put an idempotency key on every write so replaying a step is free.
Tool design is the underrated half
Models fail at tools for mundane, fixable reasons. Thirty thin overlapping tools produce selection errors; a handful of coarse, clearly-named tools with tight schemas and no ambiguity between them do not. Error messages are prompts: a bare unprocessable-entity response teaches the model nothing, while a message saying the start date must be ISO-8601 and earlier than the end date, and that it sent a slash-formatted date instead, gets corrected on the next turn without a human. And return the minimum useful payload, because tool output is the fastest way to flood a context window with material that then degrades every subsequent decision.
What production actually requires
- Full traces: every prompt, tool call, argument, result and cost, replayable. An agent you cannot replay is an agent you cannot debug.
- Budgets enforced in code — steps, time and money per task — not guidance in the system prompt.
- Approval gates on irreversible and outbound actions, showing resolved arguments.
- A kill switch that works mid-task, and a way to see what is currently running.
- Graceful failure that reports what was completed and what was not, instead of a summary that claims success. Agents are notably willing to describe a failed task as done.
- Deterministic shellordinary code holds the structure
- Model at judgment pointstwo or three places, not thirty
- Verify each stepcheap checks beat a better model
- Budget and kill switchenforced in code, not requested in a prompt
Where agents work today, and where they do not
They work on bounded, verifiable, reversible tasks with a tight feedback loop: code with a test suite to run, data transformations with checkable output, research with citations a human can spot-check in a minute. They still largely do not work on long-horizon work with no verifier, on tasks whose correctness only the requester can judge, or anywhere a single wrong irreversible action is unacceptable. That frontier moves genuinely fast — and claims that it has already moved almost always come from someone selling the agent, so check whether their demo had a verifier in it.
Key takeaways
This is one lesson of 541.
The whole Foundation is free — 16 subjects, beginner to advanced. Sign in to track what you have read, take the end-of-module quizzes, and use the terminal.