Retries can happen because of: - model loops - HTTP timeouts - queue retries - orchestration restarts
If the tool triggers something irreversible you can end up with duplicate side effects:
retry → duplicate payment retry → duplicate email retry → duplicate ticket retry → duplicate trade
SafeAgent is a small Python guard that sits between the agent decision and the side effect.
Pattern:
agent decision → deterministic request_id generated → execution guard checks durable receipt → side effect executes once → future retries return cached receipt
The project started while experimenting with settlement logic for peer-to-peer tournament payouts where duplicate payouts would be catastrophic.
Repo:
https://github.com/azender1/SafeAgent
There are a few small demos in the repo:
- OpenAI-style tool example - LangChain wrapper - CrewAI example - a tournament settlement demo showing retry-safe payouts
Curious how other people building agent systems are handling this today.
Are most teams just rolling their own idempotency layer?
loading...