Without transactional thinking, your agent leaves a half-finished mess

Make the agent's actions idempotent and group them with transactional semantics, and an interrupted run leaves a consistent state. Skip it and a retry double-charges, double-ships, or leaves the world half-changed.

B

Balagei G Nagarajan

3 MIN READ


An interrupted agent leaving a half-finished, inconsistent set of actions
Make individual actions idempotent: performing one twice has the same effect as once.
— from “Without transactional thinking, your agent leaves a half-finished mess”

Key facts.

  • MCPTox shows tool calls can fail or be subverted through tool-description poisoning, so an agent that retries without idempotency can duplicate or corrupt an action.source
  • Carlini's work illustrates the cost of treating systems rigor as optional, the same gap that leaving out transactional semantics creates.source

Why do agents leave inconsistent state?

Tool calls fail and get poisoned, per MCPTox, so a non-idempotent retry double-ships; a more capable agent repeats the side effect just as reliably. (arXiv:2508.14925)

An agent performs a sequence of side-effecting actions: charge the card, reserve the inventory, send the confirmation. If the run is interrupted or a step times out and retries, the world ends up in a state nobody planned for. Card charged, inventory not reserved. Confirmation sent twice. Agents are especially prone to this. They retry on failure. And their tools can fail or be subverted, MCPTox shows how. A single intended action becomes a duplicated or corrupted one. The agent that looks like it's recovering is sometimes making the inconsistency worse.

The fixes are the ones databases and payment systems settled decades ago. Make individual actions idempotent: performing one twice has the same effect as once. Retries are safe. Group related actions with transactional semantics: either all take effect or none do. No half-changed state. Where a true transaction across external systems isn't possible, use compensating actions to undo partial work on failure. None of this is novel. It's standard consistency engineering that agent architectures skip. Carlini is a reminder of what that costs. An agent built with idempotency and transactional thinking fails cleanly. One without leaves a mess someone reconciles by hand.

A transaction grouping agent actions so they commit together or roll back on failure

What keeps outcomes consistent?

PropertyWithout itWith it
IdempotencyRetry duplicates the effectRetry is safe
Transaction groupingHalf the steps take effectAll or none
On failureInconsistent stateCompensating rollback
RecoveryManual reconciliationClean and automatic

Knowing which actions are side-effecting and must be made idempotent or grouped is a pattern-level judgment the Pattern Intelligence Layer supports. VibeModel makes the agent's consequential actions explicit, so idempotency and transactional grouping are applied exactly to the actions that change the world and an interrupted or retried run leaves a consistent state instead of the half-finished mess that blind retries produce.

Frequently asked questions

Why is idempotency the foundation?
Because agents retry on failure and without idempotency a retry repeats the side effect, double-charging or double-shipping. Idempotency makes retry safe.

Can you always use a real transaction?
Not across external systems. Where you cannot, use compensating actions to undo partial work, so a failure does not leave a half-changed state.

Is this not just standard engineering?
It is and that is the point. Agent architectures routinely skip it, then pay in inconsistent outcomes that databases solved decades ago.


Share this post

Join the discussion

Have a take, a war story, or a question? Sign in with GitHub to comment and react. Comments are powered by GitHub Discussions, ad-free and yours to moderate.

Continue Reading

Find where your agent breaks, before you build it

Faultmap maps where your agent will fail from the goal and your data, then hands you the first test suite it has to pass.