Errors multiply: why a 95% agent gets four runs in ten wrong
Each step of an agent can be right 95% of the time and the whole run still fails 40% of the time. One multiplication explains most of how good agents are built.
The 60-second version
- A run is only right if every step is right, so step accuracy multiplies: 0.95 to the power of 10 is about 60%.
- At 90% per step, a 20-step run succeeds only about 12% of the time.
- Keep loops short, make each step more reliable, check the result at the end, and use plain code for the parts you can predict.
- Give every loop a way out: a step limit, a budget, a time limit and a check for going in circles, ending in a handover, never silence.
An agent is a loop. The model looks at the situation, picks a tool, reads the result and picks again, until it decides it is done. Suppose each step is right 95% of the time: it chooses the right tool, passes the right arguments and reads the result correctly. That sounds reliable.
But a run is only right if every one of its steps is right. If each step’s mistakes happen independently of the others, the chance that all 10 steps are right is 0.95 multiplied by itself 10 times, which is about 60%. Four runs in ten go wrong somewhere. At 90% per step, a run of 20 steps succeeds only about 12% of the time. Real steps are not fully independent, but the pattern holds.
Small error rates add up quickly over long runs. That one calculation explains much of how agents are built.
Four things it tells you to do
Keep loops short. Fewer steps leave fewer chances to fail. A tool that does a whole job in one call removes steps from the loop.
Make each step more reliable. Clear tool descriptions and useful error messages raise the success of every step, and a small rise per step gives a large rise for the whole run.
Check the result at the end. A second call that checks the reply against the policy catches one bad step before the customer sees it.
Use plain code for the parts you can predict. A workflow, where your code decides the path, is faster, cheaper and easier to test than an agent, and ordinary code does not get a step wrong 5% of the time. Use an agent only where the steps genuinely can’t be known in advance.
Every loop needs a way out
A loop that only stops when the model stops asking for tools will sometimes never stop. Give it four exits: a step limit; a budget, adding up the tokens or the money after each call; a time limit, because the customer is waiting; and a stuck check, because an agent that calls the same tool with the same arguments a second time is usually going in circles.
this_call = (call["name"], call["args"]) # the tool and its arguments
if this_call in seen: # asked for exactly this before
return HANDOVER
seen.append(this_call)
What happens when the loop stops matters as much as the stop. Never end with silence or an error page. Tell the customer a person will take over, hand over everything gathered so far, and save the state so nobody starts again from the beginning.
What to do this week
Count the steps in your agent’s typical run and estimate the accuracy of one step from your logs. Multiply. If the result is well below what you’d accept, don’t reach for a bigger model first: remove steps, turn the predictable parts into code, and add a check at the end.
Adapted from Ship Real AI, Module 11, sections 11.1 to 11.4.