A question for engineers building AI agents that actually change things.
Imagine this fictional workflow:
- An agent is approved to update an ERP record.
- The role, task scope, and review binding pass preflight.
- The tool definition changes before dispatch.
- The gateway forwards the operation, but the client times out.
- Another agent takes over and considers retrying.
What evidence would you need before trusting the result?
I'm exploring four possible ingredients for a minimal evidence chain:
- The exact approved task/action digest
- The authenticated executor and effective tool version
- The logical operation ID and retry identity
- A fresh, authoritative readback of the actual result
But every extra receipt has a cost: storage, implementation, maintenance, and operational complexity.
I maintain Agent Role Contracts (ARC), an open-source project that checks supplied role, scope, review, and task/action declarations offline. Runtime enforcement and independent verification of external effects are separate responsibilities.
We're investigating these boundaries through a research pilot, with the real-world validation stages explicitly tracked.
My question: What's the smallest evidence chain you would trust in production?
Have you solved this with database logs, idempotency keys, event sourcing, workflow engines, or something simpler?
A real example would be especially useful:
system | side effect | failure | trusted evidence | retry rule | cost
I'm collecting concrete engineering perspectives in this GitHub discussion as well.
Top comments (2)
@suirindo This scenario exposes two subtle traps that standard idempotency keys and generic entity readbacks fail to solve:
GET /record/42). If the status is already updated, there is no way to know whether Agent 1 did it or a concurrent operator touched it.In regulated biobanking LIMS and ERP systems (where duplicate specimen thawing or relocation is catastrophic), we solve this with a tripartite invariant:
UNKNOWN, neverFAILED)correlation_id,caller_role,tool_sha256,applied_at) commit within the exact same physical database transactioncorrelation_id. IfFOUND, it returns the committed state; ifNOT_FOUND, it evaluates the live rowversion before authorising a single idempotent re-submissionTwo architectural rules close the remaining loopholes:
HMAC(task_digest | tool_definition_sha256 | entity_id). If the tool definition changes between preflight and dispatch, the key changes, causing the gateway to reject the call immediately (STALE_TOOL_CONTRACT).correlation_id, not just the entity state. This proves that this specific approved action was the one that landed, distinguishing agent execution from concurrent operator mutations.Tom, this is a valuable production example. Your distinction between entity-state readback and correlation-attested commit evidence is especially important.
I agree with binding the approved action to a canonical tool-definition digest and verifying it at the authoritative dispatch boundary.
Two details seem worth testing explicitly:
Stale contract rejection: Changing the HMAC-derived idempotency key alone would not reject a stale contract. The gateway must compare the live trusted definition against the definition bound to the original approval. The logical operation identity should also remain stable across retries.
Recovery finality: An atomic mutation-and-audit transaction provides strong positive evidence when the correlation record is found. However,
NOT_FOUNDcould still race with an original attempt that remains in flight. A rowversion check alone may not resolve that ambiguity.These are good candidates for ARC's optional host-integration and ERP evaluation work. We would keep declaration validation, runtime enforcement, and independently verified effects as separate evidence layers.
One question about your LIMS implementation: What establishes that
NOT_FOUNDis final, rather than an observation made before the original transaction commits?That boundary seems crucial to making probe-before-dispatch safe under network partitions.