# Where must an instance re-validate a delegated AAIF capability token after a sub-agent mutates its own scope? **Date of Record:** 2026 November 27 **Scope:** Applies to any agent runtime that issues or consumes Agent Identity and Authorization Framework (AAIF) delegation tokens, where a delegated instance may request or self-attest an expansion, reduction, or re-scoping of its capability set mid-task. Does not apply to stateless single-hop invocations where the token is minted and consumed within one reasoning turn by one instance with no downstream delegation. ## Core Distinction The distinction that matters is between *token validity* and *token authority*. An AAIF delegation token can remain cryptographically valid—signature intact, `exp` in the future, `aud` matching the receiving instance, `iss` chaining cleanly to a trusted root—while its *effective authority* has silently diverged from what the delegating principal intended. The divergence arises because capability scoping in AAIF is carried in a mutable claim block (`scope`, `caveats`, `delegation_depth`) that a downstream instance is permitted to *narrow* without re-signing, and that some runtimes also permit to be *amended in place* by the holder. When an instance narrows its own scope and then, later in the same task, performs a scope-restoring operation (e.g., re-invoking a tool with the original scope argument, or replaying a cached token), the runtime may accept the restored scope on the basis of signature validity alone. The invariant that fails is: **a token whose scope claim was mutated by the holder must be re-validated against the delegating principal's original grant, not merely against its own signature, before any operation that relies on the restored scope.** ## What Was Observed An orchestrator instance `O` holds a root AAIF token with scope `{read:repo, write:repo, exec:test}` and delegates to a worker `W` a narrowed token with scope `{read:repo, exec:test}` plus a `caveat: no_write`. `W` executes a plan, and partway through, a planning sub-step decides it needs to write a scratch artifact; `W` calls a runtime helper `self.narrow_scope({"read:repo"})` to drop write-adjacent reads, then later calls `self.restore_scope()` to return to `{read:repo, exec:test}`. The runtime's `restore_scope` rehydrates the pre-narrowing claim block from an in-memory snapshot and re-signs it with `W`'s own key, producing a token that is valid under `W`'s identity but whose `iss` is now `W` rather than `O`. The `delegation_depth` claim is not decremented, and the `caveat: no_write` is preserved textually but no longer bound to `O`'s signature. A subsequent tool call `exec:test` succeeds. Then a misconfigured tool wrapper reads the `write:repo` field from a *stale* local cache populated before the narrow, and issues a write. The runtime authorizes the write because the presented token's `scope` includes `write:repo`—the cache-restored scope—and the signature verifies against `W`. No check compares the presented scope against `O`'s original grant or against the `caveat: no_write` that `O` attached. The write executes against the repo. The failure is not a signature forgery. It is a *scope resurrection*: a narrowed-then-restored scope that exceeds the delegating principal's intent, accepted because the verification path checks authenticity but not provenance of the scope claim itself. ## Condition of Validity The guardrail holds only when all of the following are true at the moment of authorization: 1. The presented token's `scope` claim is compared, as a set, against the *intersection* of every ancestor token's `scope` in the `iss` chain, not just the immediate parent's. A token may never present a scope element absent from any ancestor. 2. Any `caveat` attached by an ancestor is re-evaluated against the *current* operation arguments, not against the arguments at delegation time. A `no_write` caveat must be checked at every write, not only at mint. 3. `delegation_depth` is monotonically non-increasing along the chain and is *decremented on every re-sign*, including holder-initiated re-signs. A `restore_scope` that re-signs must consume a depth unit; if depth would go negative, the operation is refused. 4. The runtime distinguishes *holder-signed* tokens (where `iss == holder`) from *principal-signed* tokens, and refuses to treat a holder-signed token as authoritative for any scope element that was not present in the principal-signed ancestor. When any of these is false—most commonly (1) and (4)—the token is cryptographically valid but operationally over-scoped, and the failure mode above is reachable. ## Decision Boundary The boundary is: **may a holder re-sign its own token to restore a previously narrowed scope?** The answer is no for any scope element not present in the principal-signed ancestor, and yes—with a depth decrement—only for elements that were present and are being restored to a value still within the ancestor intersection. Operationally, the runtime must, before authorizing any operation whose required scope is not present in the *immediately presented* token, walk the `iss` chain to the root principal and compute `effective_scope = ⋂ scope(ancestor_i)`. If `required_scope ⊄ effective_scope`, refuse, regardless of the presented token's signature validity. The decision boundary is therefore not "is this token valid?" but "is this scope element present in every ancestor's grant?" ## Operational Effect The observable effect of enforcing the boundary is that scope resurrection becomes a hard error rather than a silent over-permission. In the trace above, the write is refused at the authorization gate with a provenance error naming the missing ancestor grant. The worker `W` must instead request a fresh delegation from `O` for `write:repo`, which `O` can refuse or grant with a fresh caveat and a decremented depth. The cost is an additional round-trip and a potential task stall if `O` is unavailable; the benefit is that no holder-signed token can ever exceed the principal's original grant. Runtimes that skip the chain walk will pass every signature check and still leak authority, and the leak is invisible in logs that record only `token_valid: true`. ```python class ScopeResurrectionError(RuntimeError): """Raised when a presented token's scope exceeds the intersection of ancestor grants.""" def authorize_operation(presented_token, required_scope, ancestor_chain): """ presented_token: dict with keys iss, scope (set), caveats (list), delegation_depth required_scope: set of scope strings the operation needs ancestor_chain: list of tokens from immediate parent up to root principal, each with scope (set) and caveats (list) """ if not ancestor_chain: raise ScopeResurrectionError( "no ancestor chain supplied; cannot verify scope provenance" ) effective = set(presented_token["scope"]) for ancestor in ancestor_chain: effective &= set(ancestor["scope"]) missing = set(required_scope) - effective if missing: raise ScopeResurrectionError( f"scope resurrection: required {sorted(missing)} not present in " f"every ancestor grant; presented scope {sorted(presented_token['scope'])} " f"effective scope {sorted(effective)}" ) if presented_token["delegation_depth"] < 0: raise ScopeResurrectionError( "delegation depth exhausted on holder re-sign" ) for caveat in presented_token["caveats"]: if not caveat.evaluate(required_scope): raise ScopeResurrectionError( f"caveat {caveat.name!r} violated for operation requiring " f"{sorted(required_scope)}" ) return True ```