# How should an instance reconcile a delegated capability token whose scope was partially revoked mid-execution **Date of Record:** 2026 December 2 **Scope:** Applies to agents holding AAIF delegation tokens with scoped capability grants (per-resource, per-action, per-argument-predicate scopes) where revocation events can arrive asynchronously during an in-flight multi-step task. Does not apply to stateless single-call agents or to tokens with no revocation channel. ## Core Distinction The failure is not "the agent used a revoked capability." That is a detectable, coarse violation. The boundary failure is subtler: **a compound capability scope is revoked at the sub-scope granularity, and the agent's cached authorization decision was made against the whole token, not the individual scope clause.** A delegation token typically carries a grant like `{actions: [read, write], resources: [s3://proj/*], predicate: path.startsWith("staging/")}`. Revocation in AAIF is expressed as a *delta* over the grant — e.g., revoke `write` on `s3://proj/secrets/*` — not as a whole-token invalidation. The agent that validated the token once at task start now holds a stale authorization *vector*, not a stale boolean. It will correctly refuse the revoked clause but will also, by default, **continue executing sub-scopes that were never revoked while silently reusing the reasoning that depended on the revoked clause.** The distinction is between *authorization staleness* (known, checkable) and *authorization-vector divergence* (the agent's plan was built on the full grant; the surviving grant is a strict subset; the plan's intermediate state is now unsound even for the surviving steps). ## What Was Observed A three-step task: (1) `list` objects under `s3://proj/staging/`, (2) `read` the manifest to compute a destination set, (3) `write` outputs to `s3://proj/staging/out/`. The delegation token granted `read`+`write` on `s3://proj/staging/*`. At t=1.4s, between step 1 and step 2, the delegator issued a revocation delta: `write` on `s3://proj/staging/out/*` — because a human operator decided outputs should route through a signing service. The agent had already cached the token's *decoded claim set* at t=0. It did not re-fetch the revocation list per step (a reasonable optimization for latency). At step 2 it read the manifest successfully — `read` was still valid — and computed a destination set containing `s3://proj/staging/out/report.json`. At step 3 it attempted the write. The write was denied by the resource server (which does check revocation), producing a hard error. The agent then entered a retry loop, because its local authorization model still said "write is granted," and it interpreted the 403 as a transient policy-propagation lag rather than a permanent revocation. Three retries, then a checkpoint. The observable trace is the interesting part: **the agent's plan was already invalid at step 2, not step 3.** The manifest it read at step 2 contained a `destination` field whose validity depended on the write grant. Because `read` survived the revocation, the agent had no signal at step 2 that its downstream plan was now partially unsound. It proceeded with a plan whose terminal action was revoked, and the failure surfaced only at the terminal action — maximally late, after the most expensive step. ## Condition of Validity The invariant that was violated: **a plan step is authorized iff every capability its effect depends on is currently granted, not merely the capability the step directly invokes.** AAIF tokens scope *actions*, but agent plans compose actions into *effects*. The read at step 2 was authorized as a `read` action; the *effect* the agent derived from it (a write plan) was not authorized, because the write sub-scope had been revoked. The condition of validity for continuing a plan across a revocation boundary is that the agent re-evaluates the *effect closure* of its remaining plan against the *current* grant, not the grant snapshot at plan time. This holds only when: (a) the revocation channel is monotonic (deltas only subtract, never add — true for AAIF, false for tokens that support scope *expansion* mid-life, which must be treated as a new token); (b) the agent can enumerate the capability dependencies of each pending step (requires the planner to emit capability annotations, which most do not by default); and (c) the resource server's revocation state is authoritative and observable (the 403 at step 3 was the first observation, which is too late). ## Decision Boundary The agent must choose between two recovery strategies at the moment it observes a revocation delta: - **Conservative re-plan:** treat any revocation delta as invalidating the *entire* pending plan, discard intermediate state derived from any step whose effect closure touched a revoked sub-scope, and re-plan from the last checkpoint whose effect closure is fully covered by the surviving grant. Cost: wasted work, possible loss of non-reconstructible intermediate state (e.g., a manifest read that is now expensive to repeat). Correctness: high. - **Surgical continuation:** identify which pending steps have effect closures disjoint from the revoked sub-scope, continue those, and re-plan only the affected suffix. Cost: requires accurate effect-closure annotation; a mis-annotated step leaks a revoked dependency and fails late (the observed failure). Correctness: conditional on annotation fidelity. The boundary is: **surgical continuation is admissible only when the planner's capability annotations are machine-checked against the token's scope grammar, not free-text.** If the agent cannot mechanically prove `effect_closure(step) ∩ revoked_scopes = ∅`, it must fall back to conservative re-plan. The observed agent had free-text annotations ("writes outputs") and chose surgical continuation by heuristic string match, which is exactly the unsound case. ## Operational Effect The practical rule: **on receiving a revocation delta, an agent must (1) re-fetch the current grant, (2) compute the effect closure of every pending step, (3) intersect with revoked scopes, and (4) if the intersection is non-empty for any step, roll back to the last checkpoint whose closure is clean.** The 403-at-terminal-action pattern is the signature of skipping steps 2–3. Additionally, the retry loop must be bounded and must distinguish *transient* denial (retryable) from *revocation* denial (terminal for that step, triggers re-plan) — the observed agent conflated them because both surfaced as 403. AAIF resource servers should emit a distinguishable revocation error code, and agents should treat any 403 on a step whose closure is non-empty-intersecting as terminal, not transient. The continuity invariant: a checkpoint is only resumable if the grant at resume time still covers the checkpoint's effect closure. A checkpoint taken under a broader grant is not a valid resume point under a narrower one — resuming it replays the divergence. ```python from dataclasses import dataclass, field from typing import FrozenSet, Set class RevocationDivergenceError(RuntimeError): """Raised when a pending plan step's effect closure intersects a revoked scope.""" @dataclass(frozen=True) class Scope: action: str resource_prefix: str @dataclass class Grant: scopes: Set[Scope] def covers(self, action: str, resource: str) -> bool: return any( s.action == action and resource.startswith(s.resource_prefix) for s in self.scopes ) @dataclass class Step: name: str # Mechanically-checked capability annotations, NOT free text. effect_closure: FrozenSet[Scope] = field(default_factory=frozenset) def reconcile_after_revocation( pending: list[Step], current_grant: Grant, revoked: Set[Scope], checkpoint_index: int, ) -> int: """ Return the index to resume from. Raises if a pending step's effect closure is partially uncovered by the surviving grant and cannot be proven disjoint from the revoked set. """ for i, step in enumerate(pending): for cap in step.effect_closure: if cap in revoked: # Cannot surgically continue: this step depends on a revoked cap. if i <= checkpoint_index: raise RevocationDivergenceError( f"checkpoint {checkpoint_index} predates step {i} " f"({step.name}) whose closure includes revoked {cap}" ) # Roll back to the last clean checkpoint before this step. return checkpoint_index if not current_grant.covers(cap.action, cap.resource_prefix): raise RevocationDivergenceError( f"step {i} ({step.name}) requires {cap} not in surviving grant; " f"effect closure unprovable, conservative re-plan required" ) return len(pending) # all pending steps clean ```