News for hackers. Stuff that matters.

Lions2026

This maps pretty closely to what happens in distributed systems under uncertainty.

If a system can’t tell whether something already happened, it tends to retry.

That’s fine for reads, but for side effects it creates a weird failure mode where you’re no longer dealing with “did it succeed or fail” but “did it happen once or multiple times”.

A lot of systems quietly accept “at least once” until the action is irreversible (payments, emails, etc.), and then the problem becomes very real.

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

LLM agents retry tool calls constantly.Retries can happen because of: - model loops - HTTP timeouts - queue retries - orchestration restartsIf the tool triggers something irreversible you can end up with duplicate side effects:retry → duplicate payment retry → duplicate email retry → duplicate ticket retry → duplicate tradeSafeAgent is a small Python guard that sits between the agent...

( Read More... | no comments | on HN )
That’s very similar to the pattern SafeAgent is trying to formalize.

What you described — (request_id, tool, input_hash, response) with a unique constraint — is basically the same core idea: treat the tool execution as a durable receipt and return the stored result on retries.

While experimenting with agents I kept seeing retries coming from multiple layers (agent loops, HTTP retries, queue workers), so the goal was to wrap that execution guard into a small library instead of re-implementing the pattern each time.

The tricky part you mentioned about error states is exactly what I ran into as well. If the execution fails you don’t want to record it in a way that blocks legitimate retries but also don’t want to silently replay a failure as if it succeeded.

Curious how you ended up modeling that in Postgres — did you separate failure states from successful receipts or just include a status flag in the same row?

A bit more context on why I built this.

While experimenting with LLM agents calling tools, I ran into a reliability problem: retries can easily trigger irreversible actions more than once.

For example:

agent → call tool network timeout → retry agent retries tool call side effect runs twice

That can mean:

duplicate payment

duplicate email

duplicate ticket

duplicate trade

Most systems solve this locally with idempotency keys, but in agent workflows the retries can come from multiple layers (agent loops, orchestration frameworks, API retries, etc.).

SafeAgent is a small execution guard that sits between the agent and the side effect. Every tool call gets a request_id, and SafeAgent records a durable execution receipt. If the same request is replayed, it returns the original receipt instead of executing again.

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

I built a small Python library called SafeAgent that protects real-world side effects when AI agents retry tool calls.One issue we ran into while experimenting with agent workflows is that retries can trigger irreversible actions multiple times:agent calls tool ↓ network timeout ↓ agent retries ↓ side effect happens twiceExamples:• duplicate payment • duplicate email • duplicate ticket •...

( Read More... | 3 comments | 3 points | on HN )

Show HN: SafeAgent – exactly-once execution guard for AI agents

LLM agents and tool-calling systems frequently retry or replay actions.This becomes dangerous when the action is irreversible: - sending emails - opening tickets - executing trades - triggering payoutsSafeAgent is a small Python library that enforces exactly-once execution for agent actions using request-ID deduplication.Example:from settlement.settlement_requests import...

( Read More... | 1 comment | 2 points | on HN )
I put together a small reference implementation of a deterministic settlement control layer for systems that rely on external outcome resolution (oracles, APIs, AI agents, or humans).

The goal is to prevent premature or conflicting payouts by enforcing finality, reconciliation, and exactly-once settlement semantics.

This is intentionally minimal and includes runnable scenarios (clean resolution, conflicts, late signals, and majority-oracle cases).

I’m looking for technical feedback from people who’ve dealt with settlement disputes, replay issues, or payout integrity in real systems.

I put together a small reference implementation of a deterministic settlement control layer for systems that rely on external outcome resolution (oracles, APIs, AI agents, or humans).

The goal is to prevent premature or conflicting payouts by enforcing finality, reconciliation, and exactly-once settlement semantics.

This is intentionally minimal and includes runnable scenarios (clean resolution, conflicts, late signals, and majority-oracle cases).

I’m looking for technical feedback from people who’ve dealt with settlement disputes, replay issues, or payout integrity in real systems.

I put together a small reference implementation of a deterministic settlement control layer for systems that rely on external outcome resolution (oracles, APIs, AI agents, or humans).

The goal is to prevent premature or conflicting payouts by enforcing finality, reconciliation, and exactly-once settlement semantics.

This is intentionally minimal and includes runnable scenarios (clean resolution, conflicts, late signals, and majority-oracle cases).

I’m looking for technical feedback from people who’ve dealt with settlement disputes, replay issues, or payout integrity in real systems. https://github.com/azender1/deterministic-settlement-gate

Patterns in deterministic settlement/dispute con in P2P/oracle-resolved systems?

I'm working on (and hold IP around) an architecture pattern for P2P contest and oracle-resolved systems that focuses on deterministic settlement, dispute containment, and exactly-once execution between outcome resolution and payout.The goal is to eliminate: - replay / double-settlement conditions - ambiguous resolution states - arbitration loops caused by partial failures or conflicting...

( Read More... | no comments | on HN )