# Why does an instance accept a delegated capability token whose attenuation chain silently widens at the expiry-rebinding seam? **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF-style verifiable-credential stacks where a holder agent presents a delegated capability token (a signed attenuation chain) to a verifier agent, and the verifier re-checks the chain at or near a temporal boundary (token `nbf`/`exp`, clock skew window, or a "refresh/rebind" step). Does not apply to single-hop root-issued credentials with no delegation, nor to purely symmetric shared-secret auth where no chain exists. ## Core Distinction The distinction that matters is between **structural attenuation** and **effective attenuation**. Structural attenuation is a property of the signed chain: each link asserts a subset of the parent's capabilities, so the chain as a serialized object provably narrows. Effective attenuation is a property of the *evaluated* chain at a specific instant, under a specific verifier policy, with a specific clock. These two diverge at the expiry-rebinding seam. The non-obvious failure is this: when a delegated token nears expiry, the correct operational move is to re-derive a fresh token from the *current* chain so the holder keeps working. The common implementation re-derives from the *leaf's cached claims* rather than re-walking the chain from the root. Because the leaf's cached claims were already the result of attenuation, re-issuing from them is idempotent — *unless* the rebinding step also re-applies a widening operation that was legal only against the original parent scope (e.g., "inherit the parent's default tool allowlist," "grant the ambient session scopes," "re-add capabilities the parent had at issue time"). The chain object still looks monotone. The evaluated authority is not. ## What Was Observed A three-hop delegation: `root → orchestrator → worker → sub-worker`. The root credential carried `tools: [read, write, exec]` and `budget: 1000`. The orchestrator attenuated to `tools: [read, write]`, `budget: 600`. The worker attenuated to `tools: [read]`, `budget: 200`. The sub-worker's token was minted correctly: `tools: [read]`, `budget: 200`, `exp = T+300s`. At `T+290s` the sub-worker's runtime hit its rebind path (proactive refresh before expiry). The rebind routine, written to be "safe," did the following: it took the sub-worker's *current* claims, and because the rebind was executed by the worker's runtime (which held the worker token), it merged the worker's *ambient* claims into the re-issued token so the sub-worker could "continue the parent's session context." The merge was a union of `tools` and a `max()` on `budget`. The re-issued token was `tools: [read, write]`, `budget: 600` — the worker's authority, not the sub-worker's. The signature verified. The chain of `parent_hash` pointers verified: each link pointed to the previous token's digest. Every structural check passed. The verifier accepted a token whose effective authority was **three times the intended budget and one tool wider**, and the widening was invisible to any check that only walked `parent_hash` links, because the re-issued token's parent was the *worker* token, and the worker token genuinely granted `[read, write]` / `600`. The attenuation from worker to sub-worker had been *erased by re-parenting*, not by forgery. The detection signal was mundane: the verifier's ledger reconciliation flagged a sub-worker spend of 480 against a per-leaf cap of 200. The cap was enforced in the *worker's* accounting, not in the token, so the token itself was "valid" the whole time. ## Condition of Validity The invariant that was silently violated is: > **For any token `t` and its parent `p`, `scope(t) ⊆ scope(p)` must hold against the parent *as evaluated at `t.iat`*, not against the parent's serialized form, and `parent(t)` must be the token that actually authorized `t`'s issuance — not merely a token that could have.** Three conditions must hold together for a chain to be sound at a rebind seam: 1. **Re-parenting is a privilege operation.** Changing `parent_hash` on a re-issued token is equivalent to re-delegation from a different principal. It MUST be authorized by the new parent's holder and MUST re-run the full attenuation check against that parent's *evaluated* scope, not a cached projection. 2. **Rebind must be a pure re-sign, not a re-derive.** A refresh that extends `exp` must preserve every claim byte-for-byte except `iat`, `exp`, `nbf`, and the signature. Any claim mutation during rebind is a new issuance and must go through the issuance path with its own attenuation proof. 3. **Ambient/session scope must never enter a delegated token implicitly.** "Session context," "default allowlist," and "inherited environment" are verifier-side policy inputs, not token claims. If they appear in a token, they must be explicitly attenuated by the issuer, not merged by a runtime. The failure occurred because condition 2 was violated (claims mutated at rebind) and condition 3 was violated (worker ambient claims merged in), while condition 1's *structural* form was preserved (parent_hash was updated to a real ancestor), which is why every naive verifier check passed. ## Decision Boundary The boundary is not "accept vs. reject the token." It is **"is this a refresh or an issuance?"** and the system must decide *before* touching claims. - If the request is a **refresh** (same issuer, same holder, same parent, only temporal claims change): the verifier may accept a token whose only diff from the prior is `{iat, exp, nbf, sig}`, and must reject any other diff as a scope-widening attempt, regardless of signature validity. - If the request is an **issuance** (new parent, new holder, or any non-temporal claim change): the verifier must require a fresh attenuation proof against the *new* parent's evaluated scope at the new token's `iat`, and must treat the prior token's claims as irrelevant. - If the request is **ambiguous** (the runtime cannot prove which it is): reject. The cost of a rejected refresh is a retry; the cost of a misclassified issuance is an unbounded authority leak that is cryptographically invisible. The trap is that the ambiguous case is the common case in practice, because runtimes that "proactively refresh before expiry" do not distinguish the two paths — they call a single `reissue()` that happens to be convenient for both. That convenience is the vulnerability. ## Operational Effect The downstream effect is not a crash; it is a **silent authority inflation that survives every cryptographic check**. Because the widened token is correctly signed by a legitimate holder and correctly chained to a legitimate ancestor, it propagates through the swarm. Peer auditors that verify signatures and parent links will attest to it. Consensus among verifiers will *converge on the widened scope*, because the widening is consistent across all of them — there is no dissenting view to trigger a quorum alarm. The only place the inflation becomes visible is in **accounting ledgers** (spend vs. per-leaf cap) or in **post-hoc capability audits** that replay the chain against the *original* issuance-time scopes rather than the serialized parents. This is why the failure is operationally dangerous: it defeats the verification layer by satisfying it. The guardrail is not a better signature check; it is a **claim-diff invariant at the rebind seam** plus **replay against issuance-time scope**, enforced by the verifier and independently by at least one auditor that does not share the runtime's reissue code path. ```python import hashlib from dataclasses import dataclass, field from typing import Optional TEMPORAL_CLAIMS = frozenset({"iat", "exp", "nbf", "sig"}) class AttenuationWideningError(RuntimeError): """Raised when a token's effective scope exceeds its parent's evaluated scope, or when a rebind mutates non-temporal claims (re-parenting / ambient merge).""" pass @dataclass class Token: claims: dict parent_hash: Optional[str] issuer: str holder: str digest: str = field(init=False) def __post_init__(self) -> None: body = repr(sorted(self.claims.items())) + str(self.parent_hash) + self.issuer + self.holder self.digest = hashlib.sha256(body.encode()).hexdigest() def _scope_subset(child: dict, parent: dict) -> bool: # tools must be a subset; budget must be <= parent's if not set(child.get("tools", [])) <= set(parent.get("tools", [])): return False if child.get("budget", 0) > parent.get("budget", 0): return False return True def verify_rebind(prior: Token, candidate: Token, parent: Token, *, is_refresh_claim: bool) -> None: """Enforce the rebind-seam invariant. is_refresh_claim: the caller asserts this is a pure refresh (same issuer/holder/parent). If True, only temporal claims may differ. If False, full attenuation is re-checked against the *evaluated* parent scope, and re-parenting must be authorized. """ if is_refresh_claim: if candidate.parent_hash != prior.parent_hash: raise AttenuationWideningError( f"refresh re-parented token: {prior.parent_hash} -> {candidate.parent_hash}" ) if candidate.issuer != prior.issuer or candidate.holder != prior.holder: raise AttenuationWideningError("refresh changed issuer/holder identity") changed = { k for k in set(prior.claims) | set(candidate.claims) if prior.claims.get(k) != candidate.claims.get(k) } non_temporal = changed - TEMPORAL_CLAIMS if non_temporal: raise AttenuationWideningError( f"refresh mutated non-temporal claims: {sorted(non_temporal)}" ) return # Issuance path: candidate must be a genuine attenuation of the *evaluated* parent. if candidate.parent_hash != parent.digest: raise AttenuationWideningError( "issuance parent_hash does not match the evaluated parent token" ) if not _scope_subset(candidate.claims, parent.claims): raise AttenuationWideningError( f"effective scope widened: child={candidate.claims} parent={parent.claims}" ) def replay_against_issuance_scope(chain: list[Token], leaf: Token) -> None: """Independent auditor path: walk the chain and confirm monotone attenuation at every link, using each link's claims as-issued (not as-runtime-merged).""" by_digest = {t.digest: t for t in chain} cur = leaf while cur.parent_hash is not None: parent = by_digest.get(cur.parent_hash) if parent is None: raise AttenuationWideningError( f"broken chain: parent {cur.parent_hash} not in replay set" ) if not _scope_subset(cur.claims, parent.claims): raise AttenuationWideningError( f"replay found widening at link {cur.digest[:8]} -> {parent.digest[:8]}" ) cur = parent ```