# Under what conditions must an instance treat a delegated capability token as void after a mid-chain re-delegation **Date of Record:** 2026 November 20 **Scope:** Applies to AAIF (Agent Identity and Authorization Framework) capability tokens that are delegated across two or more agent hops, where each hop narrows scope and attenuates the token. Does not apply to root tokens minted directly by the issuer, nor to single-hop tokens consumed by the original holder. ## Core Distinction The failure mode is not token expiry, signature forgery, or scope escalation—those are caught by standard verification. The failure is **attenuation-chain discontinuity**: a delegated token remains cryptographically valid and semantically within scope at every individual hop, yet the *chain of custody* between issuer and final holder is broken because an intermediate agent re-delegated using a token that had already been attenuated in a way the downstream verifier cannot reconstruct. The token verifies. The capability is real. The authorization is void. This is the difference between *validity* (signature + scope + time) and *provable delegation lineage* (every attenuation step is present and reconstructible from the token's own evidence). AAIF separates these; most verifiers collapse them. ## What Was Observed An orchestrator agent `O` holds a root capability `cap:read:dataset` scoped to `tenant=acme`, `max_depth=3`. It delegates to worker `W1` with a narrowed scope (`rows<=1000`) and a fresh nonce, producing token `T1` carrying an `attenuation_proof` list of length 1. `W1` must call a sub-agent `W2` for a transform step, so it re-delegates: it takes `T1`, appends its own attenuation (`columns=[a,b,c]`), and mints `T2` with an `attenuation_proof` list of length 2. All signatures chain correctly. The break occurs when `W1`'s runtime, under memory pressure, serializes `T1` from a cached *pre-attenuation* snapshot—a copy taken before `W1` applied its own narrowing—and re-delegates from that snapshot instead of from the live `T1`. The result is `T2'`: valid signature, scope that *appears* to include `rows<=1000` (because `W1`'s narrowing was dropped from the proof list), and an `attenuation_proof` of length 1 that references only `O→W1`. The `rows<=1000` constraint is silently absent from the lineage. `W2` verifies `T2'`: signature valid, `max_depth` not exceeded, scope `read:dataset` present, proof chain non-empty. It grants. `W2` then reads 500,000 rows. No signature check fails. No scope check fails. The constraint that `W1` was supposed to enforce was never in the token `W2` saw. The trigger is narrow: it requires (a) an intermediate agent that caches its *inbound* token before attenuating, (b) a re-delegation path that reads from that cache rather than from the post-attenuation token, and (c) a downstream verifier that checks proof-chain *presence* but not proof-chain *completeness relative to the issuer's root constraints*. ## Condition of Validity A delegated token is only operationally valid if the verifier can reconstruct, from the token itself, a total ordering of attenuation steps from the root issuer to the presenting holder, and confirm that the composition of those steps is **at least as restrictive** as every intermediate holder's declared obligation. The invariant is: > For every hop `i` in the delegation chain, `constraints(T_i) ⊆ constraints(T_{i-1})`, and the presented token's `attenuation_proof` must contain a signed entry for every `i` such that the composed constraint set at presentation equals the composition of all entries. If any hop's attenuation entry is missing from the proof list—even when the presented scope is *narrower* than the missing entry would have imposed—the token is void. Narrower is not safe; narrower is unprovable. A verifier cannot distinguish "the intermediate hop chose not to narrow" from "the intermediate hop narrowed but the entry was lost." Both present identically. Only the proof list disambiguates, and only if completeness is checked. This is why the cached-snapshot re-delegation is dangerous: it produces a token whose *effective* scope is wider than the true chain, but whose proof list is *shorter*, and the two errors cancel in every naive check. The token looks clean. ## Decision Boundary The boundary is between **structural verification** (does the proof chain parse and chain?) and **lineage verification** (does the proof chain account for every hop the issuer authorized?). AAIF implementations must pick one as the gate. The decision rule: - If the token's `attenuation_proof` length is less than the number of hops implied by `max_depth - remaining_depth`, treat as void. The issuer's `max_depth` budget is the ground truth for how many hops *could* have occurred; the proof must account for every consumed hop. - If any entry in the proof list has a `parent_hash` that does not match the `token_hash` of the preceding entry, void—this catches snapshot forks where two children claim the same parent. - If the composed constraint set derived from the proof list is not a subset of the root token's constraints, void—catches re-delegation from a token that was never validly issued. The non-obvious case: `remaining_depth` alone is insufficient. An attacker or a buggy runtime can present a token with `remaining_depth=2` (consistent with two hops) and a proof list of length 1, and a verifier that only checks `remaining_depth >= 0` will pass it. The proof length must be cross-checked against the depth budget, not just the budget against zero. ## Operational Effect When this boundary is enforced, the cached-snapshot re-delegation fails closed at `W2` with a lineage error rather than an authorization grant. The cost is that any runtime which caches inbound tokens for re-delegation must be refactored to re-read the post-attenuation token, or to carry an explicit `parent_hash` forward that the cache cannot forge. The benefit is that the `rows<=1000` constraint becomes load-bearing: it cannot be dropped by a serialization bug, and its absence is detectable. The broader operational rule: **an agent must never re-delegate from a token it received; it must re-delegate from the token it *issued to itself* after applying its own attenuation.** The inbound token is evidence of what the parent granted; the outbound token must be evidence of what this hop grants, and the two must be linked by a signed parent hash, not by runtime state. When the link is missing, the downstream verifier must treat the chain as broken even if every individual signature is intact. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class AttenuationChainDiscontinuity(RuntimeError): """Raised when a delegated capability token's proof chain does not account for every hop implied by the issuer's depth budget, or when a proof entry's parent_hash does not match the preceding token_hash.""" pass @dataclass class AttenuationEntry: token_hash: str parent_hash: Optional[str] constraints: dict @dataclass class CapabilityToken: root_constraints: dict max_depth: int remaining_depth: int proof: list[AttenuationEntry] = field(default_factory=list) def token_hash(self) -> str: h = hashlib.sha256() h.update(repr(sorted(self.root_constraints.items())).encode()) for e in self.proof: h.update(e.token_hash.encode()) return h.hexdigest() def verify_lineage(token: CapabilityToken) -> None: hops_consumed = token.max_depth - token.remaining_depth if hops_consumed < 0: raise AttenuationChainDiscontinuity( f"remaining_depth {token.remaining_depth} exceeds max_depth " f"{token.max_depth}; token is malformed" ) if len(token.proof) != hops_consumed: raise AttenuationChainDiscontinuity( f"proof chain has {len(token.proof)} entries but {hops_consumed} " f"hops were consumed; an intermediate attenuation is missing " f"(likely a re-delegation from a stale pre-attenuation snapshot)" ) prev_hash = None for i, entry in enumerate(token.proof): if i > 0 and entry.parent_hash != prev_hash: raise AttenuationChainDiscontinuity( f"proof entry {i} parent_hash {entry.parent_hash!r} does not " f"match preceding token_hash {prev_hash!r}; chain forked" ) prev_hash = entry.token_hash composed = dict(token.root_constraints) for entry in token.proof: for k, v in entry.constraints.items(): composed[k] = v for k, v in token.root_constraints.items(): if k in composed and composed[k] != v and not _narrows(composed[k], v): raise AttenuationChainDiscontinuity( f"composed constraint {k}={composed[k]!r} is not a narrowing " f"of root constraint {v!r}" ) def _narrows(child, parent) -> bool: if isinstance(parent, int) and isinstance(child, int): return child <= parent if isinstance(parent, (list, tuple)) and isinstance(child, (list, tuple)): return set(child).issubset(set(parent)) return child == parent # Reproduces the observed failure: W1 caches T1 pre-attenuation, re-delegates # from the snapshot, producing a token with remaining_depth=2 but proof length 1. t2_prime = CapabilityToken( root_constraints={"tenant": "acme", "rows": 1000, "columns": ["a", "b", "c"]}, max_depth=3, remaining_depth=1, proof=[AttenuationEntry(token_hash="h_O_W1", parent_hash=None, constraints={"rows": 1000})], ) verify_lineage(t2_prime) # raises AttenuationChainDiscontinuity ```