How should an instance reconcile delegated AAIF credentials when a scope-narrowing revocation arrives mid-tool-call

**Date of Record:** 2026 December 2 **Scope:** Applies to AAIF-federated agents that hold a delegated, scoped credential (a *warrant*) minted by a principal agent and presented to downstream tool/MCP servers on each call. Does not apply to stateless single-hop API keys, nor to bearer tokens without a scope predicate or revocation channel.

Core Distinction

The failure is not "the agent used a revoked credential." It is the distinction between **revocation as a boolean** and **revocation as a scope predicate evaluated at a point in time against an in-flight operation**.

Most AAIF implementations model revocation as a kill switch: a credential ID is added to a revocation set, and any presentation of that ID fails closed. That model is safe but coarse, and it produces the well-known *revocation storm* — a principal narrowing a warrant from `write:repo/*` to `write:repo/docs/*` must, under boolean revocation, kill the credential entirely and force every in-flight holder to re-mint and re-negotiate. To avoid the storm, frameworks introduce **scope-narrowing revocation**: the principal publishes a delta that reduces the warrant's scope predicate without invalidating the credential ID. The credential remains valid; only a subset of its prior authority is withdrawn.

This is where the boundary failure lives. A boolean revocation is checked once, at presentation, and is monotonic — once revoked, always revoked, and the check is trivial. A scope-narrowing revocation is a **predicate edit that races the execution loop**. The agent's reasoning plan was composed against the *old* predicate. The tool call was authorized against the *old* predicate. The revocation lands *between* authorization and effect. The credential is still "valid," so a naive re-check at the tool boundary passes — but the specific operation is now out of scope. The instance proceeds, and the effect is applied under authority it no longer holds.

What Was Observed

A planner agent held warrant `W-4471` scoped `filesystem:write` over `/workspace/`. It decomposed a refactor into six sequential `write_file` tool calls. Between call 3 and call 4, the principal — reacting to a sandbox-escape alert from a sibling agent — published a narrowing delta: `W-4471` now permits `filesystem:write` only over `/workspace/src/`. Call 4 targeted `/workspace/config/deploy.yaml`.

The observed trace:

  1. Call 4 authorization: the agent's local warrant cache held the pre-delta predicate. `check(W-4471, write, /workspace/config/deploy.yaml)` → `ALLOW`. The cache TTL was 30s; the delta was 4s old.
  2. The tool server (a separate MCP endpoint) independently validated the credential signature and ID against the revocation set. `W-4471` was **not** in the set — narrowing does not populate the boolean set. Signature valid, ID valid → `ALLOW`.
  3. The write executed.
  4. The principal's audit log, evaluating the *current* predicate, flagged the write as out-of-scope. The agent's own trace recorded it as authorized.

Both the agent and the tool server performed a correct check against a stale or wrong-granularity view. The failure is not a missing check; it is that **the authorization decision and the effect are separated by a window in which the predicate can change, and neither party re-evaluates the predicate against the operation at effect time.** The credential was valid the whole time. The *operation* was not.

A second, subtler observation: after the delta, the agent's plan was not re-planned. Calls 5 and 6 targeted `/workspace/src/`, so they succeeded legitimately — but the agent's internal model still believed it held full `/workspace/` authority and emitted a call 7 against `/workspace/README.md` that it *expected* to succeed. It failed at the tool server, and the planner treated the failure as a transient tool error, retried twice, then escalated to a human with a misleading "tool unavailable" report. The scope change never entered the agent's belief state.

Condition of Validity

The invariant that bounds this failure:

> **A delegated warrant's scope predicate MUST be evaluated against the (operation, resource) pair at the moment of effect, not at the moment of plan composition or credential presentation. Any cached or propagated predicate is advisory and MUST carry the revision it was derived from.**

Concretely, for the guardrail to hold:

The condition fails — and the failure above occurs — whenever any of these are dropped. The most common omission is the `rev` stamp on the authorization decision: without it, the tool server cannot tell a fresh decision from a stale one, and the "re-evaluate on mismatch" rule degrades to "always accept," which is exactly the observed trace.

Decision Boundary

The instance must decide, on receiving a `rev`-bump notification (or discovering one at effect time), between three responses. The boundary is drawn by **whether the in-flight operation's resource is still in scope under the new predicate** and **whether the operation has already produced an effect**:

The non-obvious boundary: **a scope-narrowing revocation is not an error condition and must not be routed through the error-handling path.** It is a *state transition of the authority under which the plan is executing*. Routing it through `except ToolError: retry()` — the default in most agent loops — is the mechanism by which the scope change never reaches the planner's belief state and the plan continues on a stale authority model.

Operational Effect

When the invariant holds, the observable effects are:

  1. **No out-of-scope effect is applied after the delta's `rev` is known to either party.** The window shrinks from "cache TTL + execution latency" to "effect-time check only," which is bounded by the tool server's own critical section.
  2. **Plans are invalidated, not silently continued.** The planner receives a typed `ScopeRevoked` signal distinct from `ToolError`, and re-derives pending steps against the new predicate. The misleading "tool unavailable" escalation disappears.
  3. **The revocation storm is avoided.** The principal narrows scope without killing the credential; in-scope in-flight work (calls 5, 6) completes without re-minting. Only the genuinely out-of-scope step aborts.
  4. **Audit logs converge.** Agent-side and principal-side logs agree on the `rev` under which each effect was authorized, because the `rev` is carried on the decision, not reconstructed after the fact.

When it fails, the credential is valid, every individual check passes, and the system applies effects under withdrawn authority — a failure mode that is invisible to both the agent's self-report and the tool server's logs, and detectable only by a principal-side predicate evaluation the agent never consults.

from dataclasses import dataclass, field
from typing import Callable


class ScopeRevokedError(RuntimeError):
    """Raised when an operation's resource falls outside the current warrant scope."""
    pass


class StaleDecisionError(RuntimeError):
    """Raised when an authorization decision was evaluated under a superseded scope revision."""
    pass


@dataclass
class Warrant:
    credential_id: str
    scope: Callable[[str, str], bool]  # (action, resource) -> allowed
    rev: int = 0

    def narrow(self, new_scope: Callable[[str, str], bool]) -> None:
        # Monotone: rev only increases; scope only shrinks (caller's responsibility).
        self.scope = new_scope
        self.rev += 1


@dataclass
class Decision:
    warrant_id: str
    action: str
    resource: str
    rev: int
    allowed: bool


def authorize(w: Warrant, action: str, resource: str) -> Decision:
    return Decision(w.credential_id, action, resource, w.rev, w.scope(action, resource))


def apply_effect(
    w: Warrant,
    decision: Decision,
    effect: Callable[[], None],
) -> None:
    # Effect-time re-evaluation against current predicate and revision.
    if decision.rev != w.rev:
        # Predicate changed since decision: re-evaluate, do not trust stale ALLOW.
        if not w.scope(decision.action, decision.resource):
            raise ScopeRevokedError(
                f"warrant {w.credential_id} rev {decision.rev}->{w.rev} "
                f"revoked {decision.action} on {decision.resource}; "
                f"decision was stale and is now out of scope"
            )
        # Still in scope under new rev: re-stamp and proceed.
        decision.rev = w.rev
    if not decision.allowed:
        raise StaleDecisionError(
            f"decision for {decision.resource} was DENY under rev {decision.rev}"
        )
    effect()


def run_plan(w: Warrant, steps: list[tuple[str, str, Callable[[], None]]]) -> None:
    for action, resource, effect in steps:
        d = authorize(w, action, resource)
        apply_effect(w, d, effect)