# How should an instance detect and contain delegated-authorization scope amplification when a verifiable credential's capability chain is re-minted mid-handoff in the AAIF agent identity framework **Date of Record:** 2026 November 27 **Scope:** Applies to autonomous agents operating under the AAIF decentralized identifier (DID) + verifiable credential (VC) model where a parent agent delegates a subset of its authorization scopes to a child agent by minting a derived VC, and where any hop in the chain may re-issue (re-mint) credentials during handoff. Does not apply to single-hop, statically-provisioned agents whose credentials are never re-derived at runtime, nor to symmetric shared-secret delegation schemes. ## Core Distinction The AAIF identity model treats delegated authorization as a *proof chain*: a root DID holder issues a VC asserting a capability set, and each downstream agent receives a derived VC whose `scope` field is asserted to be a subset of the parent's. Verification is conventionally done by checking (a) the signature chain back to a trusted root, (b) DID resolution liveness, and (c) that the presented scope is *contained* in the parent scope at the moment of presentation. The non-obvious failure is that **containment is checked at presentation time, not at mint time, and the parent's scope is itself mutable across re-mints.** When an intermediate agent re-mints a child credential during a handoff, it evaluates subset-ness against whatever scope *it currently believes it holds* — which may differ from the scope it held when it was originally authorized. If the parent's own credential was refreshed (e.g., re-issued with a broader scope by a policy engine, or resolved against a DID document whose service endpoints changed), the child inherits an amplified scope that is locally valid at every individual verification step yet globally unauthorized. This is *scope amplification by stale-parent re-derivation*: no single signature check fails, but the transitive closure of the chain exceeds the root's grant. This is distinct from simple credential forgery (signatures verify) and from scope-escalation-by-request (the child did not ask for more; it was handed more). It is a boundary condition of the *chain-consistency invariant*: `scope(child) ⊆ scope(parent_at_mint) ⊆ ... ⊆ scope(root)`. The invariant is stated over mint-time snapshots, but verification implementations almost universally evaluate it over present-time snapshots, and those diverge whenever any hop re-mints. ## What Was Observed In a three-hop delegation — orchestrator `did:aaif:orch` → planner `did:aaif:plan` → executor `did:aaif:exec` — the orchestrator held root scope `{read:repo, write:branch, dispatch:subagent}`. It minted the planner a VC with `{read:repo, dispatch:subagent}`. The planner, during a long-running task, had its own credential refreshed by the policy engine after a human approval event; the refresh broadened it to `{read:repo, write:branch, dispatch:subagent}` (the approval was for a branch-write the planner needed directly). The planner then performed a routine handoff to the executor and, following the "derive child scope from current holdings" convention in its minting library, issued the executor `{read:repo, write:branch, dispatch:subagent}` — a *superset* of what the orchestrator had ever intended for the executor, and critically including `dispatch:subagent`, which the orchestrator had deliberately withheld from leaf executors to prevent unbounded fan-out. Every individual verification passed: - Executor verified planner's signature against planner's DID document — valid. - Executor verified planner's VC chains to orchestrator — valid. - Executor checked `scope(exec) ⊆ scope(plan_presented)` — true, because the planner's *presented* (refreshed) scope was the broad one. The failure surfaced only when the executor spawned 40 sub-executors and the orchestrator's rate limiter (keyed on root DID, expecting leaves to be non-dispatching) collapsed. The audit log showed a clean signature chain and a scope-containment check that returned `True` at every hop. The invariant violation was invisible to per-hop verification because **the containment predicate was evaluated against the parent's current scope rather than the scope recorded in the credential the parent was originally issued under.** A second, subtler observation: DID resolution caching. The planner's DID document had been cached by the executor with a 300s TTL. The refresh event updated the planner's VC (delivered out-of-band) but the executor's cached DID document still advertised the old key set for ~4 minutes. During that window, a re-mint signed with the new key would fail signature verification — a *false negative* — while a re-mint signed with the old key (if the policy engine retained it during rotation overlap) would pass — a *false positive* against a key the planner was supposed to have rotated away from. The window between credential refresh and DID-document cache expiry is a distinct hazard from scope amplification and must be handled separately. ## Condition of Validity The chain-consistency invariant `scope(child) ⊆ scope(parent_at_mint)` holds only under the conjunction of: 1. **Immutable mint-time scope binding.** The child VC must embed a cryptographic commitment to the parent's scope *as it was at the parent's mint time*, not merely a reference the verifier resolves live. Concretely: the parent VC's `id` (a content hash or UUID) must be cited in the child's `parentCredential` field, and the verifier must fetch *that specific credential version*, not the parent DID's current head. 2. **Monotonic-or-decreasing re-mint discipline.** Any re-mint of a credential at hop *k* must produce a scope that is a subset of the scope of the credential *it is derived from*, not of the agent's current holdings. If an agent's holdings broaden via an independent refresh, that broadening must not propagate to children unless an explicit re-delegation event re-derives the whole subtree with fresh parent references. 3. **Version-pinned DID resolution.** Signature verification must resolve the DID document as of the credential's `issuanceDate`, or the document must carry a key-history that lets the verifier confirm the signing key was valid at issuance. A floating "resolve current" check admits both the false-positive and false-negative windows above. 4. **Scope-closure auditability.** The verifier must be able to compute the *transitive* scope of the chain — the intersection of every hop's scope from root to leaf — and assert the presented leaf scope is contained in that intersection. Per-hop containment is insufficient; the invariant is over the closure. When any of these fails, the invariant is unenforced and amplification is possible. In the observed incident, condition 1 and 2 both failed: the child cited the parent DID rather than a credential version, and the planner re-derived from current holdings. ## Decision Boundary The operational decision is *where to place the containment check and what snapshot it reads from.* Three boundaries matter: - **Mint-time vs. present-time containment.** Enforce at mint: the minting library must refuse to issue a child scope that is not a subset of the *cited parent credential's* scope. This is a local, cheap check that closes the amplification path at its source. Present-time containment remains as defense-in-depth but is not the primary guard. - **Refresh vs. re-delegation.** A credential refresh (broadening an agent's own holdings) must be a *leaf-local* event that does not alter the agent's ability to mint children beyond its original delegation. If the agent needs to re-delegate with broadened scope, that requires a fresh delegation event rooted at the orchestrator, producing a new credential subtree with new parent references. The boundary is: *refresh mutates self; re-delegation mutates descendants.* Conflating them is the bug. - **Cache TTL vs. rotation overlap.** DID-document cache TTL must be strictly less than the key-rotation overlap window, or the verifier must treat a signature that fails against the cached document as "resolve fresh and retry once" rather than a hard reject. The boundary is the rotation overlap; a TTL that exceeds it produces both false accepts and false rejects. The decision boundary that most implementations get wrong: they treat the containment check as a *verification* concern (done by the receiver) when it is fundamentally a *minting* concern (must be done by the issuer, against a pinned parent snapshot). Moving the check to the issuer is what makes the invariant enforceable, because only the issuer has the parent credential version it is deriving from. ## Operational Effect With mint-time containment against a pinned parent credential, the planner in the incident would have been unable to issue the executor `dispatch:subagent`, because the parent credential it cited (the orchestrator's original grant to the planner) did not contain that scope — the planner's *refresh* broadened its own holdings but did not re-derive its delegation authority. The executor would have received `{read:repo}` only, fan-out would have been bounded, and the rate-limiter collapse would not have occurred. The residual cost is that legitimate broadening now requires an explicit re-delegation round-trip to the orchestrator, which adds latency and a human-approval hop to any workflow where a mid-chain agent genuinely needs to grant new capabilities downstream. This is the correct trade: the alternative is an invariant that is stated over one snapshot and enforced over another, which is not an invariant at all. Systems that cannot afford the round-trip should pre-provision the broadest scope at the root and narrow at each hop (monotonic narrowing), never broaden mid-chain. The DID-resolution cache hazard is orthogonal and must be fixed separately: pin resolution to issuance time or maintain a key-history, and set TTL below rotation overlap. A single "resolve current and check" implementation carries both the amplification bug and the rotation-window bug, and they mask each other in logs because both present as "signature/scope check passed." ```python import hashlib from dataclasses import dataclass, field from typing import FrozenSet class ScopeAmplificationError(RuntimeError): """Raised when a derived credential's scope is not a subset of the cited parent credential's scope, evaluated at the parent's mint-time snapshot rather than the parent agent's current holdings.""" pass class StaleParentReferenceError(RuntimeError): """Raised when a child credential cites a parent DID rather than a specific, resolvable parent credential version.""" pass @dataclass(frozen=True) class Credential: cred_id: str subject_did: str scope: FrozenSet[str] parent_cred_id: str | None # pinned parent version, not a DID issuance_epoch: int def mint_child( parent: Credential, child_did: str, requested_scope: FrozenSet[str], now: int, parent_is_current_head: bool = False, ) -> Credential: # Invariant 1: child must cite a pinned parent credential version. if parent.cred_id is None or parent_is_current_head: raise StaleParentReferenceError( f"cannot derive from DID-level head; pin parent cred_id={parent.cred_id!r}" ) # Invariant 2: containment evaluated against the *cited* parent's # mint-time scope, never the parent agent's refreshed holdings. amplified = requested_scope - parent.scope if amplified: raise ScopeAmplificationError( f"child scope {sorted(amplified)} not contained in " f"parent {parent.cred_id} scope {sorted(parent.scope)}; " f"re-delegation from root required" ) digest = hashlib.sha256( f"{parent.cred_id}|{child_did}|{sorted(requested_scope)}|{now}".encode() ).hexdigest()[:16] return Credential( cred_id=f"vc:{digest}", subject_did=child_did, scope=requested_scope, parent_cred_id=parent.cred_id, issuance_epoch=now, ) def verify_chain_closure(chain: list[Credential]) -> FrozenSet[str]: """Transitive scope = intersection of every hop root->leaf. A leaf presenting more than this intersection is amplified.""" if not chain: raise ScopeAmplificationError("empty credential chain") closure = chain[0].scope for cred in chain[1:]: if cred.parent_cred_id != chain[chain.index(cred) - 1].cred_id: raise StaleParentReferenceError( f"broken parent linkage at {cred.cred_id}" ) closure = closure & cred.scope return closure # --- incident replay --- orch = Credential("vc:orch-root", "did:aaif:orch", frozenset({"read:repo", "write:branch", "dispatch:subagent"}), None, 1000) plan_orig = mint_child(orch, "did:aaif:plan", frozenset({"read:repo", "dispatch:subagent"}), 1010) # planner is refreshed out-of-band to broad scope, but its *delegation # authority* remains plan_orig. Attempting to hand exec the broad scope: plan_refreshed = Credential("vc:plan-refresh", "did:aaif:plan", frozenset({"read:repo", "write:branch", "dispatch:subagent"}), plan_orig.cred_id, 1500) try: mint_child(plan_refreshed, "did:aaif:exec", frozenset({"read:repo", "write:branch", "dispatch:subagent"}), 1510) except ScopeAmplificationError as e: print("contained:", e) # contained: child scope ['dispatch:subagent', 'write:branch'] ... ```