# Which invariants prevent delegated capability tokens from silently widening authority across cross-issuer trust chains **Date of Record:** 2026 November 15 **Scope:** Applies to AAIF-style delegated capability tokens where a resource-holder issues a token to an agent, which then re-delegates a narrowed subset to a sub-agent, and the verifier trusts more than one issuer (direct issuer plus one or more transitive trust anchors). Does not apply to single-issuer, non-delegated bearer tokens, nor to tokens whose authority set is fixed at issuance with no re-delegation path. ## Core Distinction The distinction that matters is between *attenuation* (the delegated token's authority set is a strict subset of the delegator's authority set, enforced at every hop) and *apparent attenuation* (the token *looks* narrower because the verifier only sees the leaf claims, but the union of claims along the chain is not actually checked for subset containment). Cross-issuer chains break the naive assumption that a single trust root can validate the whole chain: each issuer validates its own signature, but no single party is guaranteed to have validated the *composition*. The invariant that prevents silent authority widening is **transitive subset containment under a verified chain of custody**, not merely per-hop signature validity. ## What Was Observed A sub-agent presented a capability token whose leaf claims granted `read:orders` scoped to `tenant=42`. The leaf token was validly signed by the delegating agent, whose token was validly signed by the resource holder, whose token was signed by the trust anchor. Every signature verified. Every `exp` was in the future. Every `aud` matched. The verifier accepted the token. The leaf token also carried an `attenuation_proof` field referencing the parent token hash. The parent token's authority set was `read:orders, read:customers` scoped to `tenant=42, tenant=99`. The leaf's authority set was `read:orders` scoped to `tenant=42` — a genuine subset. So far, so correct. The failure appeared one hop down. The delegating agent had *itself* received a token from a second issuer (a partner trust anchor) that granted `read:orders` scoped to `tenant=42, tenant=99, tenant=7`. The two parent tokens were combined by the agent into a single working context, and the leaf token's `attenuation_proof` referenced only the first parent. The second parent's grants were never attenuated because the verifier never saw the second parent — it only walked the chain reachable from the leaf's single `parent_hash` pointer. The agent's effective authority was the union of both parents; the leaf's authority was a subset of one parent. The verifier's model assumed a *tree* of delegation. The runtime had produced a *DAG*, and the verifier's chain-walk only covered one path. No signature was forged. No claim was tampered with. The widening was purely structural: an unrepresented edge in the delegation graph. ## Condition of Validity The invariant holds only when all of the following are true simultaneously: 1. **Single-parent closure.** Every delegated token names exactly one parent, or names all parents and the verifier walks all of them. If the runtime can hold multiple parent tokens, the verifier must require a `parents: [hash, ...]` field and validate subset containment against the *union* of all named parents. 2. **Issuer-set closure.** The verifier's trust configuration must enumerate every issuer that can appear anywhere in the chain, and must reject chains containing an issuer not in the set — even if that issuer's signature is valid under a key the verifier happens to trust for other purposes. 3. **Scope-normalization determinism.** Subset containment must be checked on a canonicalized form of the scope (sorted tenant lists, normalized resource names). Two issuers that spell the same scope differently will produce a false negative (rejecting a valid subset) or, worse, a false positive if the canonicalizer is lossy. 4. **No ambient authority.** The agent's runtime must not carry authority from any source other than the tokens presented to the verifier. If the agent has a service account, a cached session, or a side channel, the token chain is not the whole story and the invariant is vacuous. The invariant is *not* valid when any of these is violated, and in particular it is not valid when the delegation graph can contain merges (multiple parents) but the verifier only supports trees. ## Decision Boundary The operational decision is: **when the delegation graph is a DAG, reject any token whose parent set is not fully enumerated and fully validated, even if every reachable parent validates.** Do not fall back to "validate the primary parent and trust the rest." The correct behavior on encountering an unenumerated parent is to fail closed with a distinct error, not to accept the token with reduced confidence. Conversely, when the delegation graph is guaranteed to be a tree (single-parent by construction, enforced at issuance), the simpler chain-walk is sound and should be used — the DAG-safe path adds cost and complexity that is not justified. The boundary is therefore: *tree-shaped delegation → single-path validation is sound; DAG-shaped delegation → single-path validation is unsound and must be replaced by full parent-set validation.* The failure mode is choosing the tree validator on a DAG-shaped runtime. ## Operational Effect When the invariant is enforced, the operational effect is that delegation merges (an agent combining two capability tokens into one working context) require an explicit merge token that names both parents and whose authority set is the intersection of the parents' sets — not the union. This forces the merge to be a recorded, signed event rather than an implicit runtime convenience. When the invariant is violated, the effect is silent authority widening: the agent can exercise grants from a parent that the verifier never audited, and the audit log will show a clean chain to a single root. The widening is invisible to per-hop signature checks and to `exp`/`aud` checks. It is detectable only by reconstructing the full delegation graph from issuance records and comparing the agent's effective authority set to the leaf token's declared set — a reconciliation that most deployments do not run. The practical mitigation is to make the merge explicit at the token layer and to require the verifier to reject tokens with `parents` not fully present in its trusted set, with a dedicated error class so that the rejection is distinguishable from a signature failure in incident review. ```python from dataclasses import dataclass from typing import FrozenSet class DelegationGraphError(RuntimeError): """Raised when a delegated token's parent set is not fully validated.""" @dataclass(frozen=True) class CapabilityToken: token_hash: str issuer: str parents: FrozenSet[str] # hashes of parent tokens; empty for root authority: FrozenSet[str] # canonicalized scope strings def validate_chain( leaf: CapabilityToken, issued: dict[str, CapabilityToken], trusted_issuers: FrozenSet[str], ) -> FrozenSet[str]: """ Return the effective authority of `leaf`, or raise DelegationGraphError. Sound only if every parent reachable from `leaf` is present in `issued` and every issuer is in `trusted_issuers`. A missing parent is a hard failure, not a warning: accepting it would let the leaf exercise authority from an unaudited branch of the delegation DAG. """ if leaf.issuer not in trusted_issuers: raise DelegationGraphError( f"issuer {leaf.issuer!r} not in trusted set for token {leaf.token_hash}" ) if not leaf.parents: # Root token: authority is whatever the trusted issuer granted. return leaf.authority parent_authority: set[str] = set() for ph in leaf.parents: parent = issued.get(ph) if parent is None: raise DelegationGraphError( f"token {leaf.token_hash} names parent {ph!r} " f"that is not present in the issued set; refusing to " f"validate a partial delegation graph" ) parent_authority |= validate_chain(parent, issued, trusted_issuers) if not leaf.authority.issubset(parent_authority): widened = leaf.authority - parent_authority raise DelegationGraphError( f"token {leaf.token_hash} widens authority beyond its parents: " f"{sorted(widened)}" ) return leaf.authority def merge_tokens( a: CapabilityToken, b: CapabilityToken, merged_hash: str, issuer: str ) -> CapabilityToken: """ Explicit merge of two capability tokens. The merged authority is the INTERSECTION, not the union: a merge may only narrow, never widen. """ if a.issuer != b.issuer: raise DelegationGraphError( f"cannot merge tokens from different issuers " f"({a.issuer!r} vs {b.issuer!r}) without a cross-issuer merge token" ) return CapabilityToken( token_hash=merged_hash, issuer=issuer, parents=frozenset({a.token_hash, b.token_hash}), authority=a.authority & b.authority, ) ```