Your agent was asked to pay an invoice. The payment call hung for thirty seconds and the tool returned a timeout. The agent did what every agent loop is built to do with an error: it tried again. The second call went through in two hundred milliseconds. The agent reported success, the task closed, and everyone moved on.
Three days later the vendor emailed to ask why they had been paid twice.
Nothing in that story is a bug in the usual sense. The model reasoned correctly from what it was told. The tool reported honestly that it had stopped waiting. The payment provider processed two valid requests. The failure sits in the gap between those three facts, and it is the most ordinary failure in agent systems today: AI agent retries treat "I don't know what happened" as "it didn't happen."
A timeout tells you one thing
When a call times out, the caller learns exactly one fact: it stopped waiting. It does not learn whether the request reached the other side, whether the other side acted on it, or whether the action completed and only the response was lost. All three are common. The last one, where the work is done and the acknowledgement dies on the way back, is the one that produces the second charge.
Distributed-systems engineers have a name for this. A request with an unknown outcome is in doubt, and the only safe moves are to find out what happened or to make the second attempt harmless. HTTP itself draws the line: RFC 9110 defines which methods are idempotent, meaning the effect of sending the request twice is the same as sending it once, and notes that only those can be automatically retried after a communication failure. A POST that creates a payment is not one of them.
Payments learned this the hard way, which is why mature payment APIs accept an idempotency key. Stripe's documentation describes the arrangement plainly: the client generates a unique key, sends it with the request, and if the connection fails it can repeat the request with the same key without creating a second object. The server remembers the first outcome and returns it again.
That fix exists because people had already been burned, one duplicate charge at a time. Agents are now reproducing the original burn across every tool that has not yet learned the lesson.
Why agents make it worse
Retrying an ambiguous request is not new. What agents change is who does the retrying, and how little they know when they do it.
The retry moved up a layer. In a hand-written integration, a developer decides per endpoint whether a retry is safe, and usually decides wrong only once. In an agent, the retry decision is made by a loop that sees an error string. The loop does not know whether the tool behind it charges cards or reads files. "Error, try again" is a reasonable default for reading a web page and a dangerous one for sending money, and the loop applies it to both.
The model can retry by rephrasing. Even when the framework does not retry, the model often will. It reads "request timed out," concludes the action failed, and issues the same action again with slightly different arguments. Those different arguments defeat whatever duplicate detection the downstream service had, because to the service it is a new request. An agent that helpfully adds "(resending)" to an email subject has just guaranteed that no deduplication will catch it.
Retries stack. The HTTP client retries. The tool layer retries. The framework retries the tool call. The model retries the step. Each layer is individually sensible and nobody owns the product of them. Four layers of three attempts each is up to eighty-one requests for one intended action, and the logs for each layer show a single, well-behaved retry.
The record says success. The final, successful attempt is the one that gets reported. The first attempt, the one that also succeeded, appears nowhere in the agent's account of what it did. This is why the silent retry is silent: the system's own story of the task is internally consistent and wrong. We wrote about the general version of this in what "completed" means; the retry is its sharpest case, because the agent is not hiding anything. It genuinely does not know.
The incidents you will recognize
The payment is the canonical one, but the shape repeats wherever an action changes the world:
- The second email. A send times out, the agent sends again, the customer receives two copies of a message that was supposed to be delicate.
- The double ticket. An issue-creation call hangs, the retry succeeds, and the team now has two tickets whose comment threads slowly diverge.
- The overlapping deploy. A deploy command times out at the edge while the pipeline is still running. The agent triggers it again. Two rollouts race.
- The doubled order. A procurement agent re-submits a purchase order. The supplier, reasonably, ships both.
- The quiet duplicate row. An insert times out; the retry inserts again. Nobody notices until a report sums the column.
None of these needs a malicious prompt or a confused model. They need one slow network call and a loop that equates silence with failure.
What the arrangement should be
The fix is not "never retry." Networks fail, and an agent that gives up on the first timeout is useless. The fix is to stop letting the retry decision be made by the component that knows the least. A correct arrangement has a few properties, and none of them depends on the model being smarter.
Every consequential action has an identity before it runs. The intent to pay this invoice, once, is a thing with a name that exists before the first attempt and survives every subsequent one. Attempts are attempts of that action, not new actions. This is the idempotency key generalized: not a header one API happens to support, but a property every world-changing action carries regardless of which tool performs it.
"Unknown" is a first-class outcome. An action is not in two states, succeeded or failed. It is in at least three: done, not done, and in doubt. A timeout produces in doubt. In doubt is not an error to be retried; it is a question to be answered, and the answer comes from the world, not from trying again.
Resolving doubt means reconciling, not re-issuing. The correct response to "I don't know if the payment went through" is to look: query the payment, search the sent folder, list open tickets with that title. Only when the check says the action did not happen is a new attempt safe, and the new attempt carries the same identity as the first. If the check cannot be done, the right move is to stop and tell a person that the outcome is in doubt, rather than guessing in the expensive direction.
Retry policy depends on the kind of action, not on the error string. Reading is retryable. Writing a file to a known path is usually retryable. Sending, paying, deploying and deleting are not, unless the target provably deduplicates. That classification belongs to the action, decided once, and it must not be overridable by a model that read "timed out" and felt it should try harder.
Every attempt is on the record. Not just the one that succeeded. If the first attempt left no trace in the agent's account of the task, the task's history is fiction. Receipts for agent actions only work if the duplicate gets a receipt too.
Why this is not a framework fix
Each of these properties can be bolted onto one framework, for its own tools. Plenty of good teams are doing exactly that, and it helps. But the silent retry is a cross-layer problem, and a fix that lives in one layer inherits the blind spots of that layer.
A framework can deduplicate its own tool calls. It cannot see that the model shelled out to a script that called the same API. A tool can carry an idempotency key. It cannot stop the model from calling a different tool that achieves the same effect. A model provider can tell the model to be careful with retries. As we argued in the sandbox piece, an instruction is not a control, and "be careful" is the softest instruction there is.
The place where action identity, outcome state, and retry policy can be enforced for every action, whichever app, framework or model produced it, is the layer that every action passes through. That is the operating-system layer. Not because the OS is a magical place for logic to live, but because it is the only place that sees the second attempt and can recognize it as the first one again.
What to do on Monday
You do not need a new operating system to stop the worst of this. Today:
- Inventory your agent's world-changing tools and mark which ones are safe to retry. Most teams have never written this list down.
- Turn off automatic retries on the unsafe ones at every layer you control, and make a timeout on those surface as "in doubt," not as an error.
- Use idempotency keys wherever the downstream service supports them, and generate the key once per intended action, not once per attempt.
- Give the agent a way to check before it re-tries: a read tool for every write tool that matters.
- Log every attempt, including the ones that look like failures.
These are patches, and they will drift as tools get added. That is the argument for moving the guarantee down a layer. But a patch that stops the second invoice this quarter is worth more than an argument.
Where we are with it
We are building an operating system in which every action has an identity and an honest outcome, and in which "in doubt" is a state the system tracks rather than a string the model interprets. We are in alpha, and we are not going to claim we have closed every path to a duplicate. What we are sure of is the shape of the problem. A timeout tells you that you stopped waiting. Any system that treats it as more than that will, eventually, pay twice.
Originally published at magenticos.com/blog/the-silent-retry-ai-agents. Drafted with AI assistance and reviewed by the author before publication.
Top comments (0)