The problem
An agent decides to act, a human approves, and the action is executed against an external API. If the process dies between approval and execution, nobody knows whether it happened.
The shape
- The approval and the intended action are written to an
actionstable in the same transaction. - A relay reads pending actions, executes each with its row ID as the idempotency key, and records the outcome.
- The agent observes the outcome through the same table, never through the API response.
Delivery is at-least-once. If the relay crashes after the call but before recording the outcome, it calls again, so the receiver must deduplicate on that key.
Trade-offs
- Plus: complete audit trail, safe retries, replay after an outage, one place to enforce permissions.
- Minus: one more hop of latency, one more component to run, eventual consistency the UI must show honestly.
Where it sits
On the Tools node of the AI Application map, between the gateway and the systems of record. The MCP gateway decision explains why the gateway alone is not enough.
Key takeaways
- Record the intended action and the approval in one transaction, then execute from the outbox.
- The outbox gives you audit, retry and replay for free.
- Latency goes up by one hop. For writes that matter, that is the right trade.
Terms in this piece
About this architecture pattern
- Format
- Architecture pattern
- Level
- Architect
- Read
- 1 min read
- Published
- Sep 28, 2026
- Disciplines
Reusable shapes with their trade-offs.
More on these topics
Explainer · · 4 min read
What RPO and RTO mean, and how to set targets you can meet
RPO is how much data you can lose and RTO is how long you can be down. What decides each one in practice, and how to test them before an outage does.
Article · · 2 min read
Read post-mortems, not tutorials
Tutorials teach one tool's happy path. Post-mortems teach how systems fail, and that carries over to every stack you will work on.
Article · · 2 min read
Keep writing code, or you lose the judgment to review it
Reviewing AI-written code depends on judgment you only build by writing and debugging code yourself. Which parts to keep doing by hand.
Discussion