Idempotency: why an agent pays twice

When an AI agent tries again after a lost reply, how do you stop it paying, sending or booking twice?

In production · about 5 minutes

Doing something twice should have the same effect as doing it once. That's idempotency. A lift button works like this: press it five times and one lift comes. A refund tool should work the same way. Ours didn't, and here's what that cost.

Picture: the agent asks the shop for a refund; the shop pays, but the reply is lost on the way back; the agent asks again with the same ticket, and the shop hands back the first receipt instead of paying again