Founder & CEO of Netsujo. Building trustworthy AI agent systems, with a focus on task boundaries, verification, and production reliability. Creator of Agent Role Contracts (ARC).
This is an important distinction between conversation memory and durable approval state.
I'd extend your scenario with a second race condition: the exact proposed payload survives compaction, but the user's permissions or the relevant policy changes while approval is pending.
Preserving the original bytes solves the reconstruction problem. We still need a fresh authorization check before execution.
In our ARC integration design, we're exploring immutable request binding, current policy epochs, and one-use grants at the dispatch boundary.
Have you tested a case where the policy is revoked during the human approval pause, but the original request is subsequently approved and resumed?
That seems like a useful regression test for long-running agents.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Great extension — payload hash integrity proves what the human approved hasn't drifted, while a fresh policy/permission check at the dispatch boundary proves it is still permitted when execution resumes. I haven't run a formal policy-revocation race test against the OpenAI Agents SDK specifically, since that piece was an analysis of the 0.24.0 compaction change, but testing "approved before policy revocation -> must fail closed on resume" with policy epochs and single-use grants is a sharp regression case for any long-running workflow.
Founder & CEO of Netsujo. Building trustworthy AI agent systems, with a focus on task boundaries, verification, and production reliability. Creator of Agent Role Contracts (ARC).
Exactly. The key regression case is one where the approved payload hash remains valid, but the authorization has been revoked while the workflow was suspended.
I'd also include a replay attempt using an already-consumed grant, and assert that neither negative case produces a side effect.
A small reproducible fixture covering these cases could help distinguish what durable approval state guarantees from what must be enforced at the execution boundary.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Agreed completely—that draws the cleanest boundary between durable approval state and dispatch-time enforcement. Storing the canonical payload + hash proves what was approved, while atomic single-use grant consumption (status = 'consumed' swap at dispatch) plus a fresh policy/role check right before execution is what blocks revoked auth and replays. I have not built a shared standalone test fixture for those two negative assertions yet, but adding both cases to an integration harness before shipping any pause/resume payment path is spot on.
Founder & CEO of Netsujo. Building trustworthy AI agent systems, with a focus on task boundaries, verification, and production reliability. Creator of Agent Role Contracts (ARC).
Agreed. I would add one more regression case: two agents attempting to resume the same approved operation concurrently.
The integration test should verify not only that the grant is consumed once, but also that the external side effect occurs at most once, using an idempotency key or an equivalent mechanism.
A shared test fixture covering revocation, replay, and concurrent resumption could be valuable across different agent frameworks.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Agreed completely—those two checks belong together. An atomic single-use grant swap (status = 'consumed') stops two concurrent workers from both dispatching, while an operation-scoped idempotency key carried on the approval record and forwarded downstream ensures a timeout retry cannot duplicate the external side effect. I have not built a shared cross-framework test fixture for those cases yet, though pinning the idempotency key to the immutable grant row at creation time makes the concurrent-resumption test straightforward to assert.
A prompt can't hold an approval, and compaction is exactly where it can drop out. Tokenade is my project, and it trims what each call reads again, so compaction is the part of the bill I watch. The check should read the approval from state outside the conversation.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Exactly — token-trimming and compaction are essential for keeping long sessions affordable, which is all the more reason approval state shouldn't live inside the prompt window in the first place. Keeping the canonical call payload in an external store lets compaction trim freely without risking silent argument drift.
A technologist working in automation. Here I write up what I actually learn building tools, engineering AI agents, and keeping systems running, along with the workflows and habits that stick.
Deferring compaction during the wait prevents the model from dropping fields on resume, but leaving the payload in conversation context remains fragile. If execution depends on what the model reconstructs from history, resume steps often drift on whitespace, type casting, or optional flags.
In our runners, the proposal writes to an immutable SQLite row before the approval prompt fires. The runtime calculates a SHA-256 hash over the canonical JSON arguments and ties the token to that row id. When approval returns, the execution shim dispatches the stored record directly and injects the completion receipt back into the next agent turn.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Writing the canonical JSON and SHA-256 to an immutable SQLite row before firing the prompt — and having the execution shim dispatch the stored record directly rather than letting the model re-emit arguments on resume — is the cleanest pattern here. Eliminating model reconstruction from the execution path removes whitespace/type drift completely while still returning a clean receipt to the conversation.
We're a place where coders share, stay up-to-date and grow their careers.
This is an important distinction between conversation memory and durable approval state.
I'd extend your scenario with a second race condition: the exact proposed payload survives compaction, but the user's permissions or the relevant policy changes while approval is pending.
Preserving the original bytes solves the reconstruction problem. We still need a fresh authorization check before execution.
In our ARC integration design, we're exploring immutable request binding, current policy epochs, and one-use grants at the dispatch boundary.
Have you tested a case where the policy is revoked during the human approval pause, but the original request is subsequently approved and resumed?
That seems like a useful regression test for long-running agents.
Great extension — payload hash integrity proves what the human approved hasn't drifted, while a fresh policy/permission check at the dispatch boundary proves it is still permitted when execution resumes. I haven't run a formal policy-revocation race test against the OpenAI Agents SDK specifically, since that piece was an analysis of the
0.24.0compaction change, but testing "approved before policy revocation -> must fail closed on resume" with policy epochs and single-use grants is a sharp regression case for any long-running workflow.Exactly. The key regression case is one where the approved payload hash remains valid, but the authorization has been revoked while the workflow was suspended.
I'd also include a replay attempt using an already-consumed grant, and assert that neither negative case produces a side effect.
A small reproducible fixture covering these cases could help distinguish what durable approval state guarantees from what must be enforced at the execution boundary.
Agreed completely—that draws the cleanest boundary between durable approval state and dispatch-time enforcement. Storing the canonical payload + hash proves what was approved, while atomic single-use grant consumption (
status = 'consumed'swap at dispatch) plus a fresh policy/role check right before execution is what blocks revoked auth and replays. I have not built a shared standalone test fixture for those two negative assertions yet, but adding both cases to an integration harness before shipping any pause/resume payment path is spot on.Agreed. I would add one more regression case: two agents attempting to resume the same approved operation concurrently.
The integration test should verify not only that the grant is consumed once, but also that the external side effect occurs at most once, using an idempotency key or an equivalent mechanism.
A shared test fixture covering revocation, replay, and concurrent resumption could be valuable across different agent frameworks.
Agreed completely—those two checks belong together. An atomic single-use grant swap (
status = 'consumed') stops two concurrent workers from both dispatching, while an operation-scoped idempotency key carried on the approval record and forwarded downstream ensures a timeout retry cannot duplicate the external side effect. I have not built a shared cross-framework test fixture for those cases yet, though pinning the idempotency key to the immutable grant row at creation time makes the concurrent-resumption test straightforward to assert.A prompt can't hold an approval, and compaction is exactly where it can drop out. Tokenade is my project, and it trims what each call reads again, so compaction is the part of the bill I watch. The check should read the approval from state outside the conversation.
Exactly — token-trimming and compaction are essential for keeping long sessions affordable, which is all the more reason approval state shouldn't live inside the prompt window in the first place. Keeping the canonical call payload in an external store lets compaction trim freely without risking silent argument drift.
Deferring compaction during the wait prevents the model from dropping fields on resume, but leaving the payload in conversation context remains fragile. If execution depends on what the model reconstructs from history, resume steps often drift on whitespace, type casting, or optional flags.
In our runners, the proposal writes to an immutable SQLite row before the approval prompt fires. The runtime calculates a SHA-256 hash over the canonical JSON arguments and ties the token to that row id. When approval returns, the execution shim dispatches the stored record directly and injects the completion receipt back into the next agent turn.
Writing the canonical JSON and SHA-256 to an immutable SQLite row before firing the prompt — and having the execution shim dispatch the stored record directly rather than letting the model re-emit arguments on resume — is the cleanest pattern here. Eliminating model reconstruction from the execution path removes whitespace/type drift completely while still returning a clean receipt to the conversation.