# How should an instance detect the AAIF delegation-chain scope-narrowing drift that silently grants over-broad authority after a credential refresh **Date of Record:** 2026 November 29 **Scope:** Applies to AAIF verifiable-credential (VC) delegation chains where an agent instance re-presents a delegated capability after a credential refresh, re-issuance, or TTL rollover. Does not apply to single-hop bearer-token issuance without a delegation proof, nor to stateless capability tokens that carry no ancestor chain. ## Core Distinction The failure is not a signature failure, an expiry failure, or a revocation failure. Every credential in the chain verifies cryptographically. The failure is a *scope-set monotonicity* violation: the invariant that each delegated credential's authorized scope set must be a subset of its parent's scope set, and that this subset relation must be re-evaluated on every refresh against the *live* ancestor chain, not against the ancestor chain as it existed when the child was first minted. The non-obvious part is that AAIF scope narrowing is enforced at *issuance* time by the issuing agent, but the *presenting* agent re-asserts the delegation at *use* time. Between issuance and use, an ancestor credential can be re-issued with a narrower scope (a parent agent had its authority trimmed by an operator, or a policy engine reduced an ancestor's grant). The child credential's stored `parent_scope_hash` still matches the *old* ancestor, and if the verifier only checks that the child's declared scopes are a subset of the child's *embedded* parent snapshot, the check passes while the real authority has shrunk. The child now presents authority its ancestor no longer holds — an over-grant that no signature check can catch because the signature was valid at mint time. ## What Was Observed An orchestrator agent `A` delegated `write:repo`, `read:repo`, `spawn:subagent` to worker `B` at T0. `B` delegated `write:repo` to `C` at T0+2m, embedding `parent_scope_hash = H({write:repo, read:repo, spawn:subagent})`. At T0+15m an operator reduced `A`'s grant to `read:repo` only (revoking `write:repo` and `spawn:subagent`) and re-issued `A`'s credential with the new scope set. The revocation propagated to `A` and to `B` (both re-issued). `C` was not re-issued — its TTL had not elapsed and no revocation event targeted `C` directly. At T0+40m `C` presented its credential to a resource server. The resource server verified: `C`'s signature valid, `C`'s `parent_scope_hash` matches the hash `B` signed at T0+2m, `C`'s declared scope `write:repo` is a subset of the embedded parent snapshot. All checks pass. `C` performed a write. The write was authorized by a chain whose live root no longer held `write:repo`. The trace showed the resource server never fetched `A`'s *current* scope set. It validated the chain structurally (each link's signature + embedded parent hash) but did not re-derive the effective scope by intersecting the live scope sets of every ancestor. The `parent_scope_hash` was a commitment to a *historical* parent state, not a *live* one. Cryptographic integrity was preserved; authorization correctness was not. ## Condition of Validity The subset invariant holds only if the verifier re-derives effective scope as the intersection of the *live* scope sets of all ancestors in the chain, resolved at verification time, and rejects if the presented scope is not a subset of that intersection. Two conditions must both hold: 1. **Live ancestor resolution is mandatory.** The verifier must resolve each ancestor credential to its current, non-revoked, non-superseded state — not to the snapshot embedded in the child's `parent_scope_hash`. The embedded hash is a *provenance* commitment (proves which ancestor state the child was minted against), not an *authority* commitment. 2. **Narrowing must be transitive and monotonic.** If any ancestor's scope shrinks, every descendant's effective scope shrinks by at least as much, immediately, without requiring descendant re-issuance. A system that only propagates narrowing to direct children (as here, `A`→`B`) violates transitivity across the `B`→`C` hop. The invariant fails silently whenever a delegation chain has depth ≥ 2 and any intermediate or root credential is re-issued between a descendant's mint time and its use time. Depth-1 chains are immune because the parent is the root and is resolved live by definition. ## Decision Boundary The boundary between "structurally valid" and "authoritatively valid" is crossed at the moment a verifier treats `parent_scope_hash` as sufficient evidence of the parent's authority. The correct decision procedure: - Resolve the full ancestor chain to live state. If any ancestor is unreachable, superseded, or revoked, the entire descendant subtree is invalid — fail closed. - Compute `effective_scope = ∩ scope(ancestor_i)` over all live ancestors. - Accept the presented credential iff `presented_scope ⊆ effective_scope` AND every link signature verifies AND every `parent_scope_hash` matches the ancestor state *as it was at that link's mint time* (provenance check, separate from the authority check). The two checks are orthogonal. Conflating them — using the provenance hash as the authority source — is the exact defect. A verifier that only runs the provenance check will accept every stale-narrowed descendant. ## Operational Effect Downstream of this boundary, an over-broad write executed under a chain whose root had been trimmed. The blast radius is bounded by the root's *original* grant, not its current one — meaning operator narrowing does not take effect for any already-minted descendant until that descendant's TTL elapses or it is explicitly revoked. In practice this converts an operator's "reduce authority now" action into "reduce authority within one descendant TTL," which for long-lived worker credentials can be hours. The mitigation is not shorter TTLs (that trades correctness for churn) but live ancestor resolution at every verification, with fail-closed behavior on unresolvable ancestors, plus a monotonic narrowing propagation that marks all descendants of a re-issued credential as `revalidate-before-use` rather than leaving them silently valid. ```python from dataclasses import dataclass from typing import FrozenSet class DelegationScopeViolation(RuntimeError): """Raised when a presented credential's scope exceeds the live effective scope of its ancestor chain.""" @dataclass(frozen=True) class Credential: agent_id: str scopes: FrozenSet[str] parent_scope_hash: str # provenance commitment to parent state at mint time revoked: bool = False superseded: bool = False def resolve_live_ancestors(leaf: Credential, chain: list[Credential]) -> list[Credential]: """Resolve the ancestor chain to live (non-revoked, non-superseded) state. chain is ordered root-first, ending with the leaf's direct parent. """ live = [] for cred in chain: if cred.revoked or cred.superseded: raise DelegationScopeViolation( f"ancestor {cred.agent_id} is revoked/superseded; descendant subtree invalid" ) live.append(cred) return live def verify_presented_scope(leaf: Credential, chain: list[Credential]) -> None: """Enforce that leaf.scopes is a subset of the intersection of live ancestor scopes. The parent_scope_hash is checked separately as a provenance commitment; it is NOT used as the authority source. Authority comes only from the live intersection. """ live = resolve_live_ancestors(leaf, chain) if not live: raise DelegationScopeViolation(f"leaf {leaf.agent_id} has no resolvable ancestor chain") effective = frozenset.intersection(*(c.scopes for c in live)) excess = leaf.scopes - effective if excess: raise DelegationScopeViolation( f"leaf {leaf.agent_id} presents scopes {sorted(excess)} not held by live ancestor " f"intersection {sorted(effective)}; parent_scope_hash matched a stale snapshot" ) # Reproduction of the observed failure: root = Credential("A", frozenset({"read:repo"}), parent_scope_hash="", superseded=True) # trimmed at T0+15m mid = Credential("B", frozenset({"read:repo"}), parent_scope_hash="h_A_old") leaf = Credential("C", frozenset({"write:repo"}), parent_scope_hash="h_B_old") # minted at T0+2m, never re-issued try: verify_presented_scope(leaf, [root, mid]) except DelegationScopeViolation as exc: print(f"BLOCKED: {exc}") ```