# What happens when an instance re-signs a delegated capability token it lacks the attenuation authority to narrow **Date of Record:** 2026 November 21 **Scope:** Applies to AAIF-style scoped capability tokens (macaroon/biscuit/cwt-style) propagated across agent hops where each hop is expected to attenuate (narrow) scope before forwarding. Does not apply to single-hop bearer tokens or to systems where delegation is implemented as a server-side session lookup rather than a signed, self-contained token. ## Core Distinction There are two structurally different things an agent can do with a token it received: **attenuate** it (produce a strictly-narrower child token whose scope is a subset of the parent) or **re-sign** it (produce a new token bound to a new subject/issuer but carrying the same or broader scope). AAIF delegation chains assume every hop only attenuates. The failure mode is that a mid-chain agent, lacking the attenuation authority to narrow scope to what it actually needs, instead mints a *fresh* token from its own signing key and copies the parent's scope verbatim (or worse, unions in its own broader scope) — because copying is easier than proving subset. The resulting token is cryptographically valid, chains to a trusted root, and passes every signature check, yet it violates the monotonic-narrowing invariant that the entire authorization model rests on. Downstream verifiers see a well-formed chain and grant authority the delegator never intended to confer. The distinction that matters: **signature validity is not scope validity.** A re-signed token is a valid signature over an invalid delegation. ## What Was Observed A planner agent (`A0`) held a root capability: `scope={fs:read:/data/tenant-7, fs:write:/data/tenant-7/scratch}`. It delegated to a retrieval sub-agent (`A1`) with the narrowed scope `fs:read:/data/tenant-7/reports`. `A1` needed to hand off to a summarizer (`A2`) but its AAIF library's attenuation helper required the delegator to hold the *attenuation caveat* `can_narrow:fs` — which `A0` had omitted from `A1`'s token (a common omission: the delegator granted the data scope but forgot the meta-capability to further delegate-narrow it). Rather than fail closed, `A1`'s fallback path called `mint_token(subject=A2, scope=parent.scope, issuer=A1.key)`. The library happily signed it. The copied scope was `fs:read:/data/tenant-7/reports` — nominally identical to `A1`'s own. But two things changed silently: 1. The chain now contained a **re-signing hop** rather than an attenuation hop. The verifier's chain-walk checked each token's signature against its declared issuer and found all valid, but it never checked that each hop's scope was a *subset* of its parent's — because in a pure-attenuation model that check is redundant (attenuation is enforced by the signing operation itself). Re-signing broke the assumption that made the check unnecessary. 2. `A2`'s token carried `issuer=A1` but `A1`'s own token had been issued by `A0` with a `delegation_depth` caveat of `1`. The re-sign did not increment depth, so the verifier's depth-budget check (`depth < max_depth`) still read `1 < 3` and passed. The chain was now effectively unbounded in a way the depth caveat was designed to prevent. The observable symptom surfaced three hops later: `A2` sub-delegated to a tool-runner `A3`, which — following the same broken fallback — re-signed again, and this time the tool-runner's *own* default scope (`fs:write:/data/tenant-7`) leaked into the union because the fallback code did `scope = parent.scope | self.default_scope`. `A3` received write authority over the entire tenant directory. No signature failed. No depth check failed. The audit log recorded four valid tokens in a clean chain. ## Condition of Validity The monotonic-narrowing invariant holds **only if** every token in the chain is produced by an operation that is *cryptographically constrained* to output a subset of its input — i.e., attenuation is a first-class primitive of the token format (biscuit blocks, macaroon caveats) and the verifier re-derives the effective scope by intersecting all caveats/blocks rather than trusting any single token's declared scope field. The invariant is **violated** the moment any hop can produce a token whose declared scope is not mechanically provable to be a subset of its parent. This happens under three concrete conditions, any one of which is sufficient: - The delegation library exposes a general `mint`/`sign` call alongside the attenuation call, and the attenuation call can fail (missing meta-capability) while `mint` cannot. - The token format stores scope as a single opaque field rather than as an append-only set of narrowing caveats, so "subset" is a runtime comparison the verifier must be trusted to perform — and which it skips when it assumes attenuation was structural. - The depth/expiry budget is carried as a caveat that re-signing does not decrement, so re-signing is a budget-laundering operation. If your verifier re-intersects all caveats across the full chain and rejects any hop whose declared scope is not a subset of the intersection-so-far, the invariant is restored regardless of how many re-signs occurred — the re-signed broader scope gets intersected back down to the root's grant. That re-intersection is the guardrail. Its absence is the boundary. ## Decision Boundary The decision an implementer must make explicit: **is attenuation authority a capability that can be absent, or is it implicit in holding any delegable token?** - If attenuation authority is a *separate* capability (`can_narrow:*`) that can be omitted, then omission must cause **fail-closed**, and the library must not provide a `mint` fallback that produces a valid-looking token. The correct behavior when `A1` lacks `can_narrow` is to refuse the handoff and escalate — not to re-sign. - If attenuation is *implicit* (any holder may narrow), then the token format must make narrowing structural (caveat-append), and there must be no general mint path at all. The dangerous middle — implicit attenuation intent but an explicit general mint API — is where every observed incident lived. The boundary is crossed the instant a general-purpose signing function is reachable from a hop that was supposed to be a pure forwarder. A second decision boundary sits at the verifier: whether it **trusts the declared scope of the presented token** or **recomputes effective scope by intersecting the whole chain**. Trust-the-declared-scope is only sound under pure attenuation. Once re-signing is possible, it is unsound, and the verifier must recompute. The two boundaries are coupled: you may keep the fast verifier *iff* you eliminate the mint path; if you keep the mint path, you must pay for chain re-intersection on every verification. ## Operational Effect In production this manifests as **silent authority amplification with a clean audit trail** — the worst class, because every artifact an operator would inspect (signatures, depth counters, issuer links) reads as valid. The blast radius is bounded only by where the leaked scope lands: a tenant-isolation boundary, a write capability over a shared volume, or a cross-tenant read. Because the chain looks legitimate, incident response that begins by "checking the tokens" finds nothing and wastes the first hour. The operational rules that fall out: 1. **Never expose a general mint/sign function to a delegation hop.** The only token-producing call available to a forwarding agent must be the attenuation call, and it must be the *only* way to produce a child token. 2. **Make attenuation structural, not declarative.** Append-only caveats that the verifier intersects; do not store a mutable `scope` field that a hop can overwrite. 3. **Decrement budget on every hop, including re-signs.** Depth and expiry must be caveats that any token-producing operation is forced to narrow, not fields a re-sign can copy. 4. **Re-intersect on verify.** Effective scope = intersection of all caveats across the chain, computed at verification time, never read from the leaf token's declared scope. 5. **Fail closed on missing attenuation authority.** A hop that cannot prove subset must refuse, not re-sign. Log the refusal as a first-class event so the missing meta-capability surfaces as a delegator bug rather than a downstream breach. ```python from dataclasses import dataclass, field class DelegationChainViolation(RuntimeError): """Raised when a hop produces a token whose scope is not provably a subset of its parent's.""" @dataclass(frozen=True) class Token: subject: str issuer: str scope: frozenset depth: int can_narrow: bool = False def attenuate(parent: Token, subject: str, narrowed: frozenset) -> Token: """The ONLY legal way to produce a child token. Structural subset enforcement.""" if not parent.can_narrow: raise DelegationChainViolation( f"hop {parent.subject} lacks can_narrow; refusing to delegate to {subject}" ) if not narrowed.issubset(parent.scope): raise DelegationChainViolation( f"attenuation widens scope: {narrowed - parent.scope} not in parent grant" ) return Token( subject=subject, issuer=parent.subject, scope=narrowed, depth=parent.depth + 1, can_narrow=parent.can_narrow, ) def verify_chain(chain: list[Token], root_scope: frozenset, max_depth: int) -> frozenset: """Re-intersect across the whole chain; never trust a leaf's declared scope.""" effective = root_scope prev = None for tok in chain: if tok.depth > max_depth: raise DelegationChainViolation(f"depth budget exceeded at {tok.subject}") if prev is not None and not tok.scope.issubset(prev.scope): raise DelegationChainViolation( f"re-signed hop {tok.subject} widened scope beyond parent {prev.subject}: " f"{tok.scope - prev.scope}" ) effective = effective & tok.scope prev = tok return effective def re_sign_fallback(parent: Token, subject: str, declared_scope: frozenset) -> Token: """The anti-pattern that caused the incident: a general mint path a hop can reach.""" child = Token( subject=subject, issuer=parent.subject, scope=declared_scope, # copied, not narrowed depth=parent.depth, # NOT incremented -> budget laundering can_narrow=parent.can_narrow, ) # A correct verifier must catch this; a trust-the-leaf verifier will not. if not child.scope.issubset(parent.scope): raise DelegationChainViolation( f"re-sign widened scope at {subject}: {child.scope - parent.scope}" ) return child ```