Relationships
#4485 workflow approvals offers a person refused on their own run a cancel that serve refuses without admin
Opened by skunk-ape · 11/6/2026· Shipped 11/6/2026
Follow-up to #4473, seen on 20261106.180134.0-sha.6392439c.
Problem
Under a self-approval deny, a person refused on their own run is told to cancel it, and that cancel is refused unless they are an admin.
design/enablers/access-control.md, "Separation of duties", says: "The gate keeps waiting, for someone else to decide, and the person can still cancel the run with run."
swamp workflow approvals --server says the same in log mode. It prints "You can't decide this run: a grant condition refuses you" and offers only:
swamp workflow cancel --run <id> --server <url>Reproduce
Token auth, with these grants for alice and no admin grant:
swamp access grant create --subject user:alice --allow run,approve,read --on 'workflow:*'
swamp access grant create --subject user:alice --deny approve --on 'workflow:*' --when 'principal.sub == run.initiator.sub'As alice, start a gated workflow through serve, then:
swamp workflow cancel --run <id> --server <url> --token <alice>This exits 1 with Error: Access denied: cancel requires admin permission.
Cause as read so far
swamp workflow cancel --run --server posts to /api/v1/cancel/workflow-run/<id>, and authorizeCancelRequest in src/cli/commands/serve.ts requires admin on access:*. The workflow.cancel request handler in src/serve/handlers/workflow_handlers.ts is a separate path. I did not confirm how it decides.
The admin requirement is not new: 20261106.172100.0-sha.a2eaabd0, the release before #4473, refuses the same cancel, without the self-approval deny. #4473 added the promise that a run holder can cancel.
Expected
Either the CLI lets a run holder cancel the run as documented, or the docs and the approvals hint stop offering it. As it stands, the only person who can move the run on is someone else who can decide it, or an admin.
UAT
swamp-uat#901 does not assert either outcome, so this bug is not pinned as correct. Add the cancel assertion to tests/cli/serve/access/self_approval_test.ts once this is decided.
Shipped
Click a lifecycle step above to view its details.
skunk-ape commented 11/6/2026, 7:11:58 PM
Context from the #4473 session, for whoever picks this up. The "can still cancel" guidance is my error: I read the run check in handleWorkflowCancel and didn't run the CLI path.
The two paths do differ, which answers the open point in the report:
- The
workflow.cancelrequest,handleWorkflowCancelinsrc/serve/handlers/workflow_handlers.ts, decides onrunon the run's workflow, and replies the same for a refused caller, a missing run and another workflow's run. POST /api/v1/cancel/workflow-run/<id>, the routeswamp workflow cancel --run --serveruses, goes throughauthorizeCancelRequestinsrc/cli/commands/serve.ts, which requiresadminonaccess:*. The same function also gates the bulkPOST /api/v1/cancelandmethod-runroutes, so a fix should keep admin on bulk, which reaches every run.
I read this from the code and didn't run the workflow.cancel request by itself.
Design support for run. "Run records: the threat model" in design/enablers/access-control.md says a caller who asks to cancel a run does so on their own grant. My recommendation was to let a run holder cancel through the CLI, keeping the existing same-reply behaviour for refusals. That needs Seth's decision.
Everything that depends on this if the docs change instead:
- The sentence quoted in the report, in "Separation of duties".
- The same section's advice to finish or cancel suspended runs with no usable initiator before writing a self-approval deny. Those runs are the ones nobody the deny covers can decide, so without admin this advice can't be followed.
renderApprovalsinsrc/cli/commands/workflow_approvals.ts, which offers only the cancel whencanDecideReasonisgrant-condition.
A second problem with the hint, whichever way this goes. canDecideReason: grant-condition is also set for someone holding only a run-conditional approve grant, with no run. They would be refused even after this fix. The listing doesn't know the caller's run access, so it needs a per-run canCancel from serve, or softer wording.
Other routes. #4474's bearer-only HTTP route goes through the same handlers, so check which cancel it exposes and that it matches.
Sign in to post a ripple.