Show HN: SafeAgent – exactly-once execution guard for AI agent side effects

1 points by Lions2026 ↗ HN
LLM agents retry tool calls constantly.

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?

0 comments

[ 4.3 ms ] story [ 7.0 ms ] thread

No comments yet.