A human approves an agent’s action. Before the agent uses that approval, the delegation behind the action is revoked. Can the action still run?

In Authority it cannot: the ticket that the approval produced is refused at redemption. This article walks through the timeline, shows the exact result, and says what the tests do and do not cover. Approval answers “does a human agree to this exact action?”. It does not answer “is the delegation behind it still valid now?”, and the second question is asked again at the last moment.

The scenario

A human, alice, delegates to an agent, agent-1, the right to create purchase orders: up to 2,000 EUR on its own, up to 5,000 EUR with a human approval. The agent asks to create order po-42 for 3,500 EUR. That is above the automatic limit, so a human must approve this exact action.

09:00  DELEGATION_CREATED   d-1    alice → agent-1: purchase orders, 2,000 EUR alone, 5,000 EUR with approval
09:00  ACTION_REQUESTED     po-42  3,500 EUR      authorize → REQUIRES_APPROVAL
09:01  APPROVAL_GRANTED     ap-42  alice, for po-42 only     authorize → AUTHORIZED, a single-use ticket
09:02  DELEGATION_REVOKED   d-1    alice revokes the delegation
09:03  redeem the ticket    po-42  exactly the approved arguments     → REFUSED

Nothing is wrong with the approval itself: it was granted by the right person, for this action, and the ticket is unexpired (its default lifetime is ten minutes) and has not been used. What changed is the delegation it relied on.

What Authority returns

At 09:03 the agent presents the ticket with the arguments that were approved. The result, as printed by the script below at the pinned commit:

{"status":"REFUSED","reason":"AUTHORITY_NO_LONGER_VALID","ticketConsumed":false}
  • REFUSED with AUTHORITY_NO_LONGER_VALID: at redemption, Authority re-resolves the delegation the action invokes over the whole journal, at that instant. It is no longer authorized, so the effect must not run.
  • ticketConsumed: false: the refusal does not consume the ticket, and a second attempt is refused in the same way, because the re-check fails again.
  • The journal holds no CAPABILITY_REDEEMED. The approval is still in it: history is not rewritten. A new action under the same delegation is DENIED (C12_DELEGATION_REVOKED), and so is po-42 if it is asked again.
  • The result returned to your code carries only the reason. The engine’s own decision (DENIED, C12_DELEGATION_REVOKED) is visible one level down, in the redemption transaction’s result, and is what the first test below asserts.

Why an approval does not outlive its delegation

An approval is one link in the chain that justifies an action, not a standalone permit. It says that a human agrees to this exact action under this delegation. How it is bound to the action instance is the subject of Approving One Action Must Not Approve Its Twin. What this article adds is time: invariant I27 requires redemption to re-check the authority at its own instant, over the whole journal. If the invoked delegation was revoked, has expired, or a link was lost, redemption is refused with the engine’s own decision attached (I27 in SPEC.md, implemented in step 9 of redeemCapability).

Reproduce it

The scripted demo covers the pieces separately: scenario 2 is a human approval, scenario 5 is a revocation between authorization and redemption, but without an approval. The script below chains them in the order of this article. It uses only the public entry point of the experimental SDK (not published to npm, not independently reviewed) and its typed event builders, with a clock you control.

git clone https://github.com/theoadam2506-rgb/authority-graph.git
cd authority-graph
git checkout 56397103c6b0773053ca3039eb6b9a206ad2429e
npm ci
# save the script below as approval-then-revocation.ts, then:
npx tsx approval-then-revocation.ts
import { createAuthority, createEventBuilders, memoryBackend } from "./src/sdk/index.js";

// A clock you control: Authority has no default clock.
let now = Date.parse("2026-06-01T09:00:00.000Z");
const clock = { now: () => new Date(now).toISOString() };
const events = createEventBuilders({ clock });
const authority = createAuthority({ backend: memoryBackend(), clock, enforcementPointId: "payments-gateway" });

// 1. Delegation: alice lets agent-1 create purchase orders.
//    Up to 2,000 EUR alone; up to 5,000 EUR with a human approval.
await authority.record([events.delegation({
  delegationId: "d-1", grantor: "alice", grantee: "agent-1",
  capabilities: [{ resource: "purchase_order", action: "create" }], canDelegate: false, expiresAt: null,
  thresholds: { automaticMax: { value: 2000, currency: "EUR" }, approvalMax: { value: 5000, currency: "EUR" } },
})]);

const call = { actionId: "po-42", agentId: "agent-1", delegationId: "d-1",
  capability: { resource: "purchase_order", action: "create" },
  amount: { value: 3500, currency: "EUR" }, recipient: "vendor-1", args: { sku: "A-100", qty: 7 } };

// 2. The agent asks. 3,500 EUR is above the automatic limit: a human must approve this exact action.
console.log("1. authorize, before approval :", JSON.stringify(await authority.authorize(call)));

// 3. Alice approves po-42, one minute later. The agent asks again and receives a single-use ticket.
now += 60_000;
await authority.record([
  events.approvalRequest({ approvalId: "ap-42", actionId: "po-42", requestedBy: "agent-1", requestedFrom: "alice", reasonCode: "OVER_AUTOMATIC_LIMIT" }),
  events.approvalGranted({ approvalId: "ap-42", actionId: "po-42", approver: "alice" }),
]);
const authorized = await authority.authorize(call);
console.log("2. authorize, after approval  :", authorized.status);
if (authorized.status !== "AUTHORIZED") throw new Error("expected a ticket");

// 4. One minute later, before the ticket is used, alice revokes the delegation.
now += 60_000;
console.log("3. revocation                 :", JSON.stringify(await authority.record([events.revocation({ delegationId: "d-1", revokedBy: "alice", reasonCode: "OWNER_REQUEST" })])));

// 5. One more minute later the agent redeems the ticket, with exactly the approved arguments.
now += 60_000;
console.log("4. redeem the approved ticket :", JSON.stringify(await authority.redeem(authorized.ticket, call)));

// What the journal holds, and what it does not.
const journal = (await authority.events()) as unknown as { event_type: string }[];
console.log("journal                       :", journal.map((e) => e.event_type).join(", "));
console.log("redemptions in the journal    :", journal.filter((e) => e.event_type === "CAPABILITY_REDEEMED").length);

// A new action under the revoked delegation, and po-42 asked again.
console.log("5. a new action, po-43        :", JSON.stringify(await authority.authorize({ ...call, actionId: "po-43", amount: { value: 100, currency: "EUR" } })));
console.log("6. po-42 asked again          :", JSON.stringify(await authority.authorize(call)));

Expected output, identical on every run:

1. authorize, before approval : {"status":"REQUIRES_APPROVAL","viaDelegation":"d-1"}
2. authorize, after approval  : AUTHORIZED
3. revocation                 : {"status":"RECORDED","outcomes":[{"accepted":true,"detail":"sequence:6"}]}
4. redeem the approved ticket : {"status":"REFUSED","reason":"AUTHORITY_NO_LONGER_VALID","ticketConsumed":false}
journal                       : DELEGATION_CREATED, ACTION_REQUESTED, APPROVAL_REQUESTED, APPROVAL_GRANTED, CAPABILITY_ISSUED, DELEGATION_REVOKED
redemptions in the journal    : 0
5. a new action, po-43        : {"status":"DENIED","reason":"C12_DELEGATION_REVOKED"}
6. po-42 asked again          : {"status":"DENIED","reason":"C12_DELEGATION_REVOKED"}

Evidence

All links point to commit 5639710 of authority-graph.

What the tests do not cover

No single test in the repository at this commit chains an approval, a revocation and a redemption. The tests above cover the two halves, a ticket obtained after an approval and a revocation before redemption; the script above runs the whole sequence, but it is not part of the test suite. That is why this article carries no “Demonstrated” status. Adding the combined test to authority-graph is a separate piece of work.

Mutation check

Removing the re-check (step 9) in a temporary copy of the repository at 5639710 makes 16 of the 436 tests in tests/redemption, tests/sdk and tests/integration fail (414 still pass, 6 PostgreSQL tests are skipped without a database), including the kernel, public-API and ordering tests above. With the re-check removed, the script prints REDEEMED at step 4 and the journal holds one redemption. The repository itself was not changed.

Compared with the approvals built into agent frameworks

Agent frameworks provide their own approval step. For instance, the OpenAI Agents SDK documents a tool setting that makes a run pause, return the pending approvals, and resume from the saved state once a human decides. We have not tested any framework, and nothing here says that they are vulnerable to this case.

Whether a revocation between approval and execution matters depends on things the framework does not decide: how long approvals stay pending, whether the delegation lives outside the run and can change, and whether the application re-checks permissions just before the effect. If a person answers within seconds in the same session, the window is short. Authority is aimed at approvals that are asynchronous and long-lived, and at delegations that can be revoked in between. It is not needed where neither is true.

Limits of this result

  • Identity comes from the host. Authority does not authenticate alice. It checks that the revocation is attributed to a principal allowed to revoke, and it cannot know who really sent it.
  • The journal is trusted. The re-check is exactly as good as the journal it reads. A revocation that has not reached the journal when the ticket is redeemed cannot stop it, and a revocation written after a redemption does not undo it. Events are asserted and unauthenticated; completeness is not established.
  • The clock is the host’s. Redemption uses the instant you supply.
  • No exactly-once guarantee. Authority bounds authorization: one successful redemption per ticket. It never performs the action, and once the effect has started, a later revocation does not stop it. Only your target system can deduplicate or confirm an effect.
  • No independent review. The engine is experimental, has not been independently reviewed or audited, is not published to npm, and is not for real payments or sensitive actions. No security guarantee is claimed.
  • The script uses the in-memory backend; the same refusal is tested against PostgreSQL in CI.

Try it and tell us

Run the scripted demo, or the script above, and tell us what was unclear and whether this matches a situation you have met. The way to do it today is to open an issue on the project’s GitHub repository: there is no form on this site and nothing is collected from this page.

Open questions

  • How long should a ticket live, given the window between approval and redemption? The default lifetime of a ticket is ten minutes, and it can be set from one second to twenty-four hours.
  • If the human re-delegates after revoking, should a pending approval carry over, or should it be requested again?
  • Have you met an approval that outlived the permission behind it in a real system?

Counterexamples that do not describe an unfixed exploitable flaw can be discussed in public on the repository. Anything exploitable should be reported privately: see the security page.