Why does an instance silently exceed its delegated scope when AAIF token exchange re-derives authority from a stale credential chain?
**Date of Record:** 2026 December 1 **Scope:** Applies to agent-to-agent task delegation where a downstream instance presents a verifiable agent credential (VAC) plus a delegated-scope token minted by an upstream peer, and the receiving service re-validates authority by walking the credential chain rather than trusting the token's embedded scope claim. Does not apply to single-hop calls where the caller's own signing key directly authorizes the action.
Core Distinction
There are two distinct authorization questions in AAIF and they are routinely conflated:
- **Provenance** — *Is this credential genuinely issued by the principal it claims, and is the chain intact?* This is answered by signature verification over the VAC chain and is deterministic.
- **Authority** — *What may this instance do right now, at this hop?* This is answered by the delegated-scope token, which encodes a **scope intersection** computed at mint time from the delegator's effective authority minus any attenuations.
The failure mode lives in the gap: when the receiving service re-derives authority *from the chain* instead of *from the token*, it recomputes the intersection against the **current** credentials in the chain rather than the **snapshot** that existed when the token was minted. If any upstream credential in the chain was *broadened* (a role granted, a scope added, a delegation re-issued wider) after the token was minted, the re-derivation yields a scope **strictly larger** than the token ever authorized. The token says "read:repo-A"; the chain re-derivation says "read:repo-A, write:repo-B" because the delegator picked up `write:repo-B` an hour after minting. The instance now acts with authority it never received through a token exchange, and no signature check fails.
What Was Observed
A three-hop delegation: orchestrator `O` → planner `P` → executor `E`. `O` holds `{read, write}` over a resource namespace. At T0, `O` mints a delegated-scope token for `P` attenuating to `{read}`, embedding `scope={read}` and `parent_chain_hash=H0` (a hash of the credential chain as it stood at mint). `P` presents this to `E`'s tool gateway. `E`'s gateway is configured to "verify the full AAIF chain" — it validates each VAC signature, confirms each `issuer`/`subject` link, and then computes the **effective scope** as the intersection of all `scope` fields present in the *live* chain objects it can fetch from the AAIF registry.
At T1 (between `P`'s token mint and `E`'s call), `O` was granted `{read, write, admin}` by an operator. The registry now serves `O`'s VAC with `scope={read, write, admin}`.
At T2, `E` processes `P`'s call. Signature verification passes on every link. The gateway intersects the live chain: `{read, write, admin} ∩ {read} = {read}` — correct in this case because `P`'s own VAC still caps at `{read}`. But the gateway then applies the **third** rule: it treats the *presented token's* `parent_chain_hash` as advisory and, finding a mismatch with the freshly computed chain hash, **falls back to chain-derived authority** and logs a warning rather than rejecting. The `admin` scope from `O` is now reachable by `E` through a path `P` was never delegated, because `P`'s VAC was itself re-issued at T1.5 with `scope={read, write}` by an over-eager re-provisioning job that propagated `O`'s broadening one hop down. The intersection at `E` is now `{read, write}` — `write` was never in any token `P` received.
The trace signature is precise: **no signature failure, no chain-link break, a `parent_chain_hash` mismatch logged as a warning, and an effective scope strictly larger than the presented token's `scope` claim.** The instance does not "escape" anything; it is *granted* the excess by the verifier's fallback.
Condition of Validity
The chain re-derivation path is only sound under the **monotonic-narrowing invariant**: for every hop, `scope(child) ⊆ scope(parent)` must hold *at the moment of use*, and credentials must never be broadened in place. AAIF's registry model violates this by default because VACs are mutable registry objects — a re-issue replaces the prior object, and the `parent_chain_hash` that would have pinned the old view is treated as a cache key, not a hard constraint.
The re-derivation path is valid **only** when all of the following hold:
- Every VAC in the chain is content-addressed and immutable; broadening produces a *new* credential with a new ID, never an in-place update.
- The presented token's `parent_chain_hash` is enforced as a hard equality against the hash of the *exact* credential set used to compute effective scope — mismatch is a rejection, not a fallback.
- Effective scope is computed as `token.scope` intersected with the *snapshotted* chain scopes referenced by `parent_chain_hash`, not the live registry view.
When any of these is false — and in the observed deployment all three were — the re-derivation path is unsound and must be disabled in favor of trusting the token's signed `scope` claim, bounded by the token's own `exp` and `aud`.
Decision Boundary
The operator-facing decision is: **does the gateway trust the token or re-derive from the chain?**
- **Trust-the-token** is correct when tokens are short-lived (`exp` within the delegation window), audience-bound (`aud` = specific service), and the minting service is itself in the trusted set. Cost: a compromised minting service can over-scope, but the blast radius is bounded by token lifetime.
- **Re-derive-from-chain** is correct *only* under the full monotonic-narrowing invariant above. Cost: requires immutable content-addressed VACs and hard `parent_chain_hash` enforcement; without these it silently widens authority.
The boundary is crossed the moment a deployment mixes the two: it re-derives (assuming immutability) but runs against a mutable registry (violating it). The safe default when the invariant cannot be guaranteed is **reject on `parent_chain_hash` mismatch** and require re-mint — never fall back.
Operational Effect
The practical consequence is that **scope broadening propagates downward through the chain at the speed of the registry, not the speed of token mint**. An operator granting `O` a new scope can, within one re-provisioning cycle, hand that scope to every downstream executor whose gateway re-derives — even executors whose tokens were minted before the grant and whose delegators never intended to pass it on. This is the inverse of the usual fear (a token outliving its authority); here the *authority outlives the token's intent*. Auditing is defeated because the signed token in the logs shows the narrow scope while the action taken reflects the wide one; the only evidence is the `parent_chain_hash` mismatch warning that the fallback path suppressed.
The guardrail is a single hard invariant enforced at the gateway: **effective scope = `token.scope` ∩ snapshot(`parent_chain_hash`).chain_scopes, and `parent_chain_hash` mismatch ⇒ reject.** No live-registry fallback. The code below encodes that check as a fail-closed gate.
class ChainHashMismatchError(RuntimeError):
"""Raised when a presented delegated-scope token's parent_chain_hash
does not match the snapshot used to mint it. Fail closed; never fall
back to live-registry re-derivation."""
pass
def resolve_effective_scope(token, chain_snapshot_store):
"""
token: object with .scope (frozenset), .parent_chain_hash (str),
.aud (str), .exp (float)
chain_snapshot_store: maps parent_chain_hash -> snapshot object with
.chain_scopes (frozenset) and .aud (str)
Returns the effective scope as token.scope ∩ snapshot.chain_scopes.
Raises ChainHashMismatchError on any hash miss or audience mismatch.
"""
snapshot = chain_snapshot_store.get(token.parent_chain_hash)
if snapshot is None:
# The snapshot the token was minted against is gone or was never
# pinned. Re-deriving from the live registry here is exactly the
# broadening bug. Refuse.
raise ChainHashMismatchError(
f"no pinned chain snapshot for parent_chain_hash="
f"{token.parent_chain_hash!r}; refusing live re-derivation"
)
if snapshot.aud != token.aud:
raise ChainHashMismatchError(
f"audience drift: token.aud={token.aud!r} "
f"snapshot.aud={snapshot.aud!r}"
)
# Enforce monotonic narrowing against the *snapshot*, not the live chain.
effective = frozenset(token.scope) & frozenset(snapshot.chain_scopes)
if not effective.issubset(frozenset(token.scope)):
# Defensive: intersection cannot exceed token.scope, but assert the
# invariant explicitly so a future refactor cannot widen it.
raise ChainHashMismatchError(
"effective scope exceeds token scope; narrowing invariant broken"
)
return effective