Agent Approvals: When a Deny Leaves the Grant Live
A replayed approval resumed work a second time, and a deny overwrote the audit while the grant stayed live. Tole v0.12.0 makes the first decision final.
An approval in an agent runtime is not interface state. It is the control that stands between a model and your machine, and the record of who pulled it. While wiring approval webhooks for tole v0.12.0, we found the endpoint behind that control could not keep its own record straight: a replayed approval resumed the agent's work a second time, and a deny that arrived after an allow overwrote the audit entry while the original grant stayed live.
This is not a tole-only problem. The same week the release shipped, gVisor pitched itself as the sandbox kernel for agents, a policy-gate project called aaf-gate surfaced on Hacker News, and a LessWrong post showed models coordinating through inference servers while sandboxed. The conversation covered confinement, policy gates, and side channels. What almost none of it covers is the approval record itself: whether a decision can fire twice, and whether the log tells the truth afterwards.
What the endpoint got wrong
Tole is our Rust agent runtime, MIT licensed, a young project with a small user base: chat, missions, cron, a server. Every model-initiated action in it is untrusted until something approves it. Through v0.11, approvals came from a human at a terminal, where duplicate decisions are rare. Duplicates are normal input for v0.12.0, which adds signed webhooks for approval requests: queue redeliveries, client retries, the same button clicked from two machines. The old POST /approvals/{id}/decision endpoint had three failure modes under exactly that traffic, which is why the fix and the webhooks landed in the same release.
A repeat of the same verdict wrote a second audit entry and resumed the work again, answering 202, the old success code, each time. A deny after an allow overwrote the audit with the deny while the one-shot permission stayed granted. And an allow for a session the server had already evicted answered 202 with "resuming": true while nothing actually resumed.
Each failure damages something different. The double resume repeats side effects: deploys run twice, messages send twice. The phantom resume tells the operator work is running when nothing is. The last one is the dangerous one. After a deny-over-allow, an auditor reading the log believes access was revoked. The process still holds the grant. The log and the machine disagree, and the log is the thing everyone trusts.
One rule fixes it
v0.12.0, released November 20, collapses all of this into a single rule: the first decision wins. Repeating the same verdict returns 200 with "resuming": false, writes no audit entry, and starts no resume. The opposite verdict, or a decision on an expired entry, returns 409 with the current status. The audit keeps exactly the shape the first decision left it.
There is one deliberate exception. If the first decision's audit write failed with a 500, retrying the same verdict still writes the audit and resumes the work. A transient storage failure should not eat a legitimate approval. Everything else refuses.
The principle underneath: the audit log is the trust anchor of the runtime. Once approvals cross a network, retries are normal traffic, and an endpoint that double-resumes or rewrites history turns the log into fiction. One-shot decisions make the log append-only in practice, which is the property an auditor actually needs.
Confinement tightened in the same release
Approval is authorization. Confinement is a second layer, and v0.12.0 moved that layer too: the mission verify command and the on_turnend stop gates now run in a bubblewrap sandbox by default. The workspace stays writable. .git and .tole are read-only. $HOME is not mounted, and there is no network.
The release notes are blunt about what breaks. A verify step that needs cargo test against a toolchain under ~/.cargo exits 127 on every run. Git commits fail because .git is read-only. Anything needing the network fails. On hosts with no sandbox at all, the default degrades loudly instead: the command runs unsandboxed with a warning on stderr and a fallback entry in the plugin ledger. A written optional or required setting refuses rather than degrades.
A sandbox never replaces an approval, and an approval without confinement trusts every bug in whatever it approved.
Four rules for approval state
Build an approval system and these four are cheap to adopt early, expensive to retrofit.
- Make decisions one-shot. Same verdict twice is a success with no action. A flip is a 409, never a rewrite.
- Keep the audit append-only. If the record can be overwritten, the deny-after-allow bug is one retry away.
- Test the endpoint with replayed traffic. Redeliveries, retries, and expired entries are normal input the moment approvals cross a network.
- Default confinement on, and degrade loudly where it cannot work. A silent fallback is how a sandbox stops being a sandbox.
Where tole stands
v0.12.0 is live: the GitHub release went out November 20, and crates.io is serving 0.12.0 for both tole-cli and tole-core. cargo install tole-cli upgrades. If you build against the approvals API, the migration is one line on the client: accept 200 for a repeated allow, handle 409 for a flip.
The repo has one GitHub star. The bug class does not need a star count to matter: anywhere an approval crosses a network, a replay will arrive, and the runtime has to decide, once, what the first verdict means.