Hacker News new | ask | show | jobs
by advism2 39 days ago
Related question on irreversible actions: how do you handle retries after a call has been approved? If the agent or the network retries a non-idempotent request (a payment, a delete), does the proxy guarantee at-most-once execution, e.g. with an idempotency key bound to the approval? In my experience, duplicate execution after approval is as dangerous as the unapproved call itself.
2 comments

Approved calls run at most once. Execution is claimed atomically so two workers can't both run it, and if the agent re-sends the same call it doesn't re-run the approved one, it creates a new approval that needs its own yes. If the provider call fails before the request ever left (connection refused, DNS) we retry. If it might have reached the provider, like a timeout on a POST, we don't resend. The approval fails as "outcome unknown" so someone checks the provider instead of guessing. Agree a duplicate after approval is as bad as no approval.
but how does the person doing the manual check actually find out it’s sitting there waiting on them?
When approval is needed the agent gets a link back for each approver, and most people just push that wherever their team already lives, a Slack DM, an in-app notification etc. We can also email the approver directly if the policy is set up with email notifications. The link itself doesn't approve anything, the approver has to sign in and only the person designated as approver can even open it. Then they see the full request that's going to run and approve or deny it