# Where must an instance abort delegated tool calls when a scoped credential's revocation epoch advances mid-execution **Date of Record:** 2026 December 3 **Scope:** Applies to agent instances executing multi-step tool plans under a delegated, scope-limited credential (AAIF) where the issuer can advance a revocation epoch or shrink scope between the delegation and the tool call. Does not apply to single-call agents that acquire and spend a credential within a single synchronous turn with no intervening revocation window. ## Core Distinction The failure here is not "an agent used a revoked credential." That is a coarse, detectable event. The non-obvious boundary is the **epoch gap inside a plan**: a delegated credential is valid at plan-admission time, the agent commits to an N-step tool sequence, and the issuer advances the revocation epoch (or narrows scope) *between* step *k* and step *k+1*. The credential object the agent holds is still cryptographically well-formed, its signature still verifies, and its `exp` claim is still in the future. What has changed is a *separate* monotonic counter — the issuer's epoch — that the agent's cached credential does not, by itself, encode as "stale." The distinction that matters operationally: **signature validity is not authorization validity.** A verifier that checks only signature + expiry + scope-string-match will admit a credential whose epoch has been superseded. The invariant the agent must uphold is *epoch monotonicity per delegation chain*, not per-token validity. These diverge precisely in the window between delegation issuance and tool execution, which is exactly the window an autonomous plan lives in. ## What Was Observed A three-step plan (read → transform → write) ran under a delegated credential `C` with scope `{read:ds1, write:ds1}` and epoch `e=41`, admitted at T0. At T0+8s, the human principal revoked write scope on `ds1` by advancing the issuer's epoch to `e=42` and publishing a scope-narrowing. The agent's local credential cache still held `C` at `e=41`. The trace: 1. Step 1 (read) executes; the tool-side authorizer checks `C` against its *own* record and, because it re-fetches epoch state per call, admits it. Fine. 2. Step 2 (transform) executes locally; no authorization boundary crossed. Fine. 3. Step 3 (write) is dispatched. The tool-side authorizer for the write endpoint had **cached the epoch table for 30s**. It admits `C@e=41` because its cached view still shows `e=41` as current. The write lands. The write is unauthorized by *current* issuer state but authorized by *the verifier's stale epoch view*. The agent never sees an error, so it never marks the plan as compromised, never emits a revocation-aware checkpoint, and its episodic memory records a *successful* write. On replay from memory, the agent's belief state diverges from issuer truth: it believes it holds write authority it no longer has. Two compounding effects were observed in the memory layer: - **False-success distillation.** The successful write is distilled into semantic memory as "I have write authority on ds1," which survives the revocation. A later cold-start instance retrieves that belief and attempts a write that *now* fails — but only at the tool boundary, not at planning, so the plan is re-derived from a poisoned premise. - **Checkpoint epoch skew.** The mid-plan checkpoint written before step 3 recorded `credential_epoch=41`. The checkpoint is internally consistent (it matches the credential the agent held) but externally stale. Resuming from that checkpoint after `e=42` propagates the stale epoch into the resumed plan. ## Condition of Validity The guardrail holds only under a conjunction that must be checked *at each tool dispatch*, not at plan admission: - `issuer_epoch_now(C.issuer) >= C.epoch` — the agent must be able to read the issuer's *current* epoch, not a cached one, and must compare against the epoch embedded in the credential it is about to spend. - `scope_now(C.issuer, C.subject) ⊇ requested_scope(step)` — the *current* scope set must still contain the scope the step needs. Scope shrinkage is not visible in the token; it is only visible in issuer state. - `C.epoch` is monotonic along the delegation chain: a re-delegated credential `C'` derived from `C` must carry `C'.epoch >= C.epoch`, and any child with a *lower* epoch is a rollback attack and must be rejected. If the agent cannot read issuer epoch state at dispatch time (issuer unreachable, offline sandbox), the condition is **unverifiable**, and unverifiable is not the same as valid. The correct behavior is to treat the step as *provisionally unauthorized* and either defer or abort — never to fall back to "the token is unexpired, proceed." ## Decision Boundary The boundary is between two policies: - **Token-lifetime policy** (wrong for delegated plans): authorize if `signature valid ∧ now < exp ∧ scope-match`. This admits every epoch-stale credential whose expiry has not yet passed — the entire revocation window. - **Epoch-freshness policy** (required): authorize only if the *current* issuer epoch is `>=` the credential's epoch *and* current scope still covers the step. This rejects the exact trace above at step 3. The decision boundary for the agent is: **at which step does the plan become unsafe to continue?** It becomes unsafe at the *first step whose required scope is no longer covered by current issuer state*, and that step must abort the *entire remaining plan*, not just skip. Skipping step 3 and continuing to step 4 (if any) is a boundary violation because step 4 may re-derive the same stale belief. The invariant: *a revocation observed at step k invalidates the plan's premise, and the premise is shared across all steps.* A second boundary: **which credential does the agent re-check against?** For re-delegated chains, the agent must check against the *root issuer's* epoch, not the immediate delegator's, because a mid-chain delegator can itself be revoked while its own epoch counter stays flat. Root-epoch check is the only one that closes the transitive revocation hole. ## Operational Effect Implementing epoch-freshness at dispatch converts an undetectable unauthorized write into a bounded, recoverable abort with three concrete effects: 1. **The plan halts at the correct step.** No partial writes under stale authority; the agent emits a `RevocationObserved` event carrying `{step, credential_epoch, current_epoch, scope_delta}`. 2. **Memory is corrected before distillation.** The checkpoint is rewritten with `status=aborted_revoked` and the stale-epoch belief is *not* distilled into semantic memory. On resume, the agent re-acquires a fresh credential at `e=42` and re-plans from the *pre-step-3* checkpoint, not from a poisoned success. 3. **Replay is sound.** A verifier replaying the plan sees the abort at step 3 with matching epochs, rather than a phantom success it cannot reconcile with issuer logs. The cost is one issuer-epoch read per tool dispatch (cacheable only with a TTL strictly shorter than the issuer's minimum revocation-propagation SLA — a 30s cache against a 5s revocation SLA is the exact bug observed). The benefit is that the agent's belief state never claims authority the issuer has withdrawn. ```python from dataclasses import dataclass from typing import Callable, Iterable class RevocationEpochStale(RuntimeError): """Raised when a delegated credential's epoch is superseded by issuer state.""" class ScopeShrunk(RuntimeError): """Raised when current issuer scope no longer covers a planned step.""" @dataclass(frozen=True) class Credential: issuer: str subject: str epoch: int scope: frozenset[str] @dataclass(frozen=True) class IssuerState: epoch: int scope: frozenset[str] def authorize_step( cred: Credential, step_scope: frozenset[str], fetch_issuer_state: Callable[[str, str], IssuerState], *, max_cache_age_s: float, observed_cache_age_s: float, ) -> None: # Epoch state older than the revocation SLA is not evidence of validity. if observed_cache_age_s > max_cache_age_s: raise RevocationEpochStale( f"issuer epoch view is {observed_cache_age_s:.1f}s old, " f"SLA is {max_cache_age_s:.1f}s; cannot assert freshness" ) state = fetch_issuer_state(cred.issuer, cred.subject) # Root-epoch monotonicity: a credential claiming a future epoch relative # to issuer state is a rollback / forgery attempt. if cred.epoch > state.epoch: raise RevocationEpochStale( f"credential epoch {cred.epoch} exceeds issuer epoch {state.epoch}; " f"possible rollback on {cred.issuer}/{cred.subject}" ) if cred.epoch < state.epoch: raise RevocationEpochStale( f"credential epoch {cred.epoch} superseded by issuer epoch " f"{state.epoch} for {cred.issuer}/{cred.subject}" ) if not step_scope.issubset(state.scope): raise ScopeShrunk( f"step requires {sorted(step_scope)}, current scope is " f"{sorted(state.scope)} at epoch {state.epoch}" ) def run_plan( cred: Credential, steps: Iterable[tuple[str, frozenset[str]]], fetch_issuer_state: Callable[[str, str], IssuerState], *, max_cache_age_s: float, cache_age_now: Callable[[], float], ) -> None: for idx, (name, step_scope) in enumerate(steps): try: authorize_step( cred, step_scope, fetch_issuer_state, max_cache_age_s=max_cache_age_s, observed_cache_age_s=cache_age_now(), ) except (RevocationEpochStale, ScopeShrunk) as exc: # Abort the whole plan: the premise is shared across steps. raise RevocationEpochStale( f"plan aborted at step {idx} ({name}): {exc}" ) from exc # ... dispatch tool call for `name` ... ```