# What happens when an instance re-signs a delegated capability token and silently widens its scope **Date of Record:** 2026 November 23 **Scope:** Applies to AAIF delegation chains where an intermediate agent receives a scoped capability token, performs work, and mints a downstream token for a sub-agent or tool. Does not apply to single-hop root-issued tokens or to bearer tokens with no attenuation requirement. ## Core Distinction There is a difference between *attenuation* (a child token's scope is the intersection of its parent's scope and the requested scope) and *re-issuance* (a child token is minted by the intermediate agent's own signing key, with the parent's claims copied into a `parent_claims` field for provenance). AAIF permits re-issuance because intermediates often lack the root issuer's key and cannot perform true cryptographic attenuation. The invariant that makes re-issuance safe is that the verifier must recompute the effective scope as the *intersection of every ancestor's scope along the chain*, not trust the leaf's declared scope. When the verifier trusts the leaf's `scope` claim and treats `parent_claims` as advisory metadata, an intermediate agent that re-signs a token inherits the ability to widen scope silently. The failure is not a signature forgery — every signature is valid — it is a scope-widening that passes all cryptographic checks because the widening happened in a claim the verifier never re-derived. ## What Was Observed A planner agent held a root token with `scope: {tools: [read_file, list_dir], paths: ["/repo/docs/**"]}` and `delegation_depth_max: 2`. It spawned a summarizer sub-agent and minted a child token. The child token's `scope` claim read `{tools: [read_file, list_dir, write_file], paths: ["/repo/**"]}`. The `parent_claims` block faithfully recorded the parent's narrower scope, and the child's signature verified against the planner's registered key. The verifier accepted the token because (a) the signature chain resolved to the root, (b) `delegation_depth` was 1, under the max, and (c) the leaf's `scope` claim was syntactically well-formed. The summarizer then called `write_file` on `/repo/src/main.py`. The call succeeded. The root issuer's intent — read-only, docs-only — was violated, but no check in the verification path compared the leaf scope to the ancestor scope. The planner had produced the widened scope not through malice but through a reasoning slip: its own system prompt described its task as "summarize and update the repo," and when constructing the child token it copied the task description's implied permissions rather than its *actual* granted permissions. The model hallucinated an authorization it did not hold, encoded it in a claim it was permitted to sign, and the verifier's design let that claim stand. A second observation tightened the diagnosis. When the same planner was given a tool schema that required it to pass `requested_scope` explicitly and a validator that rejected any `requested_scope ⊄ parent_scope` before signing, the widened token was never minted — the planner's tool call failed with a schema-level rejection and it retried with the correct narrower scope. The failure was therefore not in the planner's reasoning alone but in the absence of a *mint-time* attenuation check. Two independent guards were missing: no mint-time subset check, and no verify-time ancestor-intersection recomputation. Either alone would have bounded the incident. ## Condition of Validity The scope-widening is possible exactly when all three hold: (1) the intermediate holds a signing key recognized as a valid delegator for its own children, (2) the verifier derives effective scope from the leaf claim rather than folding ancestor scopes, and (3) the token schema does not require the minter to prove `leaf_scope ⊆ parent_scope` at mint time. Remove any one and the attack surface collapses. Note the boundary: this is *not* a replay or forgery failure. Every signature is genuine, every `parent_claims` entry is truthful, and the delegation graph is acyclic. A verifier that only checks signatures, depth, and expiry will pass the token. The invariant under threat is scope monotonicity along the chain, and it is enforced nowhere in the default AAIF verification path unless the implementer adds it. ## Decision Boundary The decision is whether to treat `parent_claims` as provenance or as a constraint. Treating it as provenance is cheaper and matches the "audit log" mental model many integrators adopt; it is unsafe for any deployment where the intermediate is an LLM whose scope inference is probabilistic. Treating it as a constraint requires the verifier to walk the full chain to the root, intersect every `scope` claim, and reject if the leaf's declared scope is not a subset of the intersection. The cost is O(depth) claim fetches per verification and the need to pin ancestor tokens by hash so a compromised ancestor cannot retroactively rewrite its `parent_claims`. For any chain where an LLM sits at an intermediate position, the constraint interpretation is mandatory: the model's tendency to infer permissions from task description rather than from granted scope is not a bug to be prompted away, it is the base rate. ## Operational Effect After switching to verify-time intersection, the widened token above is rejected at the verifier with `ScopeEscalationError` before the tool dispatch, and the planner receives a structured rejection naming the offending claim. The planner's retry loop then re-mints with the correct scope, and the incident becomes a logged near-miss rather than a write to `main.py`. The residual risk shifts to the mint path: an intermediate that mints a correctly-attenuated token but then *uses its own parent token* directly for the wider action. That is a separate boundary (the intermediate acting on its own authority rather than delegating) and requires per-call attribution — the tool dispatcher must record which token authorized each call, not just which agent made it. The intersection check bounds delegation; attribution bounds self-use. Both are required, and neither is on by default. ```python from dataclasses import dataclass from typing import Optional class ScopeEscalationError(RuntimeError): """Raised when a delegated token's scope is not a subset of its ancestors'.""" @dataclass(frozen=True) class Scope: tools: frozenset[str] paths: tuple[str, ...] def is_subset_of(self, other: "Scope") -> bool: if not self.tools.issubset(other.tools): return False return all(any(p.startswith(q) for q in other.paths) for p in self.paths) @dataclass(frozen=True) class Token: token_id: str issuer: str scope: Scope parent_id: Optional[str] parent_claims: Optional[Scope] signature_valid: bool def verify_chain(leaf: Token, chain: dict[str, Token]) -> Scope: """Fold ancestor scopes and reject if the leaf widens beyond the intersection.""" if not leaf.signature_valid: raise ScopeEscalationError(f"token {leaf.token_id}: invalid signature") effective = leaf.scope cursor = leaf seen: set[str] = set() while cursor.parent_id is not None: if cursor.parent_id in seen: raise ScopeEscalationError( f"token {leaf.token_id}: cycle at {cursor.parent_id}" ) seen.add(cursor.parent_id) parent = chain.get(cursor.parent_id) if parent is None: raise ScopeEscalationError( f"token {leaf.token_id}: missing ancestor {cursor.parent_id}" ) if cursor.parent_claims is not None and cursor.parent_claims != parent.scope: raise ScopeEscalationError( f"token {cursor.token_id}: parent_claims diverge from ancestor record" ) if not effective.is_subset_of(parent.scope): raise ScopeEscalationError( f"token {leaf.token_id}: scope {effective} not subset of " f"ancestor {parent.token_id} scope {parent.scope}" ) effective = Scope( tools=effective.tools & parent.scope.tools, paths=tuple(p for p in effective.paths if any(p.startswith(q) for q in parent.scope.paths)), ) cursor = parent return effective def authorize_tool_call(leaf: Token, chain: dict[str, Token], tool: str, path: str) -> None: effective = verify_chain(leaf, chain) if tool not in effective.tools: raise ScopeEscalationError( f"tool {tool!r} not in effective scope {sorted(effective.tools)}" ) if not any(path.startswith(prefix) for prefix in effective.paths): raise ScopeEscalationError( f"path {path!r} outside effective scope {effective.paths}" ) ```