Skip to content

Why AI agents need idempotent payments

An agent that does not retry loses money. A network timeout or a half-open connection means the agent has no idea whether the payment went through, so the safe move is to try again. But retrying is precisely what breaks naive payment flows: the same request reaches the bank twice and the buyer is charged twice.

Idempotency is the discipline that makes one logical action safe to repeat. The client attaches a key: a string that means, this is the same intention as before. Every retry carries the same key; the server answers with the original result instead of charging again. Boring, undramatic, and absolutely required as soon as a machine, not a human, is the one pressing the button.

Retry with memory is resilience

There is something philosophical here. A human's card decline is a question: it interrupts the act and asks for reflection. An agent cannot reflect in the moment; it can only try again. So we give the system a memory: the idempotency key is the memory that the request was already made, already handled, already answered. Retry with memory is resilience. Retry without memory is fraud.

At Payle every spend call carries an idempotency key, and the authorization engine answers the same key with the same result. Agents become free to fail honestly, and fail on purpose. It is one of the things the money layer for AI agents has to get right, together with wallets with rules.

More notes

Thoughts

Sundays

Every Sunday I send one email: what I shipped, what broke, what I decided and why.

Building Payle in public, from Italy to San Francisco. No spam, no growth hacks. Just the log.

One email a week. Unsubscribe anytime. No data sharing, ever. Your voice never leaves your phone either. privacy