The most common incident in an agent stack is not a wrong answer. It is a duplicate: a refund issued twice, a ticket opened three times, an email sent on every retry of a step that timed out after delivery (Rajat Pandit). Idempotency keys exist for exactly that failure. A request with the same key produces the same result no matter how many times it arrives, so a retry after a timeout cannot create a second effect (Google Cloud).
That protection is real, and it stops at a specific boundary. The key guarantees that repeated attempts converge on one business operation. It says nothing about whether that one operation was the right thing to do. Once the tool call commits, the record exists, the money moved, or the email left the building. Asking the key to undo it is asking a lock to become a time machine.
The finance pattern guide draws the same line: idempotency makes repeat requests converge on one operation, while compensation applies a controlled business action when completed work must be corrected (bitbibit). These are different tools with different jobs.
So the design question splits in two. First: did the write happen once, despite retries? That is the idempotency key's job. Second: was the write correct, and if not, what takes it back? That is the reversal plan, and it has to be chosen per write type, before the agent runs.
A useful way to see the gap is a simple timeline. An agent calls a refund tool with key refund:run-41:step-7:order-882. The provider accepts it. The HTTP response is lost. The platform retries with the same key, the provider returns the stored success, and no second refund happens. The key did its job perfectly. But if the reviewer later realizes order 882 was the wrong order, the key is finished. Nothing in the idempotency record can take back money that already moved. Only a new action can.



