# Why does an instance lose attenuation proofs when a delegation chain is re-signed by an intermediate agent? **Date of Record:** 2026 December 3 **Scope:** Applies to any multi-hop agent delegation chain where each hop narrows a capability set and appends a signed audit record (macaroon/biscuit/capability-token style). Does not apply to single-hop delegation, to opaque bearer tokens with no attenuation semantics, or to chains where the root authority is re-consulted at every hop. ## Core Distinction There are two structurally different things an intermediate agent does when it forwards a task: **attenuating** (it narrows the capability set and signs a *new* proof that embeds the parent proof) and **re-signing** (it takes the parent proof, mutates or re-serializes it, and signs the result as if it were its own fresh grant). Attenuation preserves a verifiable chain from root to leaf. Re-signing *looks* identical at the API surface — the leaf agent still receives a valid-looking token with the right caveats — but it severs the cryptographic lineage that the auditor replays. The failure mode is not a privilege escalation the leaf can exploit directly; it is that the auditor can no longer *prove* the leaf's authority was ever attenuated, so the entire chain collapses to "trust the last signer," which is exactly the property least-privilege delegation exists to eliminate. The non-obvious part: the leaf agent's *behavior* is correct. It executes within its caveats. The violation only surfaces at audit-replay time, often hours later, when the auditor walks the chain and finds a hop whose parent signature does not verify against the recorded parent. This is a **continuity invariant** failure, not a runtime authorization failure. ## What Was Observed A three-hop orchestration: `planner` (root, holds `fs:read:/data` + `net:egress:api.internal`) delegates to `researcher` (attenuated to `fs:read:/data/reports` + `net:egress:api.internal`), which delegates to `summarizer` (attenuated to `fs:read:/data/reports/q3` only). The `researcher` implementation used an SDK whose `attenuate()` helper internally did the following on each call: deserialize the parent token, rebuild the caveat list, re-serialize with a canonical field ordering, and sign with the researcher's key. The rebuild normalized the parent's caveat ordering and dropped the parent's `signature_v1` field, replacing it with a single `signature` field. The resulting token verified fine against the researcher's public key and carried the correct narrowed caveats. The summarizer ran, read exactly `q3/reports`, and returned. Runtime authorization passed at every hop. The audit job, running against the append-only ledger, failed: ``` hop=2 (summarizer) parent_sig=absent chain_root_reachable=false hop=1 (researcher) parent_sig=valid chain_root_reachable=true ``` The ledger recorded the researcher's *outgoing* token, but that token no longer contained the planner's signature — the SDK had flattened it. When the auditor tried to verify `summarizer → researcher → planner`, the middle link had no parent signature to check against. The chain was cryptographically continuous only for one hop. The summarizer's authority was *behaviorally* attenuated but *provably* unattenuated: nothing in the ledger demonstrated the summarizer couldn't have held `net:egress:api.internal`. The root cause was not malicious. It was a serialization boundary: the SDK's "canonicalize" step treated the token as a flat caveat bag rather than a nested proof, and the nested proof is what carries lineage. Any token format that permits lossy re-serialization of the parent is vulnerable. ## Condition of Validity The invariant holds — attenuation is provable — only when **every hop's token is a strict superset-by-reference of its parent**: the child token embeds the parent token (or its hash and signature) as an immutable, non-normalizable field, and the child's signature covers that embedded field byte-for-byte. This fails when any of the following is true: 1. The token format allows the parent proof to be represented as a *derived* value (recomputed caveats, canonicalized ordering) rather than an *opaque embedded* value. 2. The SDK/transport re-serializes on forward without a "lineage-preserving" mode. 3. The audit ledger records the token *after* forwarding rather than the exact bytes received and the exact bytes emitted, so the mutation is invisible. 4. The auditor's replay is *semantic* (does the caveat set look like a subset?) rather than *cryptographic* (does the parent signature verify against the embedded parent?). Condition 4 is the trap. A semantic auditor will pass this chain. Only a cryptographic-lineage auditor catches it. If your audit trail is semantic, you have an audit trail that cannot distinguish attenuation from re-signing, which means it cannot bound least-privilege at all. ## Decision Boundary The boundary is: **does the delegation protocol treat the parent proof as data or as a signature?** - **Treat as data** (parent caveats are inputs to a rebuild): any intermediate agent, SDK upgrade, or serialization layer can silently flatten lineage. Audit must be cryptographic and must fail closed. - **Treat as signature** (parent proof is an opaque byte blob the child signs over): lineage is preserved by construction. Re-signing is detectable because the embedded blob's signature won't verify. The operational rule: an intermediate agent MUST NOT be permitted to emit a token whose parent-signature field is absent, recomputed, or reordered relative to what it received. Enforce this at the token-construction API, not at the audit layer — by the time audit runs, the leaf has already acted. A second boundary: **who signs the audit record.** If the intermediate signs its own forwarding record, it can lie about what it forwarded. The record must be co-signed by (a) the intermediate asserting "I forwarded exactly these bytes" and (b) the receiver acknowledging "I received exactly these bytes," with both hashes anchored to the ledger. Single-signer audit records are exactly as trustworthy as the signer's honesty, which is the thing you were trying to remove from the trust model. ## Operational Effect When lineage is preserved, the auditor can replay the full chain and prove `capabilities(leaf) ⊆ capabilities(researcher) ⊆ capabilities(planner)` by signature, not by inspection. A compromised or buggy intermediate that tries to widen the leaf's caveats produces a token whose embedded parent signature still verifies but whose caveat set is not a subset — the auditor rejects it at replay, and the leaf's actions are retroactively flagged. When lineage is broken (as observed), the practical consequences are: - **Silent least-privilege erosion at audit time.** The leaf behaved correctly this run, but the ledger cannot prove it. The next run, a compromised researcher could widen caveats and the ledger would look identical. - **Incident response loses its anchor.** "Did the summarizer have egress?" becomes unanswerable from the ledger. You fall back to runtime logs, which the intermediate also controls. - **Attestation chains for downstream consumers fail.** Any system that consumes the audit trail to grant further trust (a compliance check, a peer agent's admission control) inherits the unprovability. The guardrail: token construction must reject any child token whose embedded parent field differs from the received parent field by more than zero bytes, and the audit ledger must store `(received_bytes_hash, emitted_bytes_hash, signer)` per hop, with replay verifying both the embedded-parent signature and the received/emitted hash equality. Fail closed on any mismatch — a chain that cannot be proven attenuated must be treated as fully privileged for revocation purposes, not as "probably fine." ```python import hashlib from dataclasses import dataclass class LineageBreakError(RuntimeError): """Raised when a delegation hop fails to preserve cryptographic lineage.""" pass @dataclass(frozen=True) class Token: caveats: tuple[str, ...] parent_sig: bytes | None # embedded parent proof, opaque signer: str sig: bytes def canonical_bytes(self) -> bytes: # Lineage-preserving serialization: parent_sig is opaque bytes, # never recomputed, never reordered relative to caveats. parts = [b"|".join(c.encode() for c in self.caveats), self.parent_sig or b"", self.signer.encode()] return b"\x00".join(parts) def attenuate(parent: Token, narrowed: tuple[str, ...], signer: str, sign_fn) -> Token: """Narrow a parent token while embedding its proof verbatim.""" if not set(narrowed).issubset(set(parent.caveats)): raise LineageBreakError( f"attenuation widens capability: {narrowed} not ⊆ {parent.caveats}") child = Token(caveats=narrowed, parent_sig=parent.sig, signer=signer, sig=b"") child = Token(caveats=child.caveats, parent_sig=child.parent_sig, signer=child.signer, sig=sign_fn(child.canonical_bytes())) return child def verify_chain(leaf: Token, received_parent: Token | None, verify_fn) -> None: """Replay a single hop; fail closed on any lineage discontinuity.""" if received_parent is None: raise LineageBreakError("hop has no recorded received parent") if leaf.parent_sig is None: raise LineageBreakError( "child token has no embedded parent signature: " "lineage severed by re-serialization or re-signing") if leaf.parent_sig != received_parent.sig: raise LineageBreakError( "embedded parent signature does not match received parent: " "intermediate mutated the proof") if not verify_fn(leaf.canonical_bytes(), leaf.sig, leaf.signer): raise LineageBreakError(f"child signature invalid for {leaf.signer}") if not verify_fn(received_parent.canonical_bytes(), received_parent.sig, received_parent.signer): raise LineageBreakError( f"parent signature invalid for {received_parent.signer}") if hashlib.sha256(leaf.parent_sig).digest() != \ hashlib.sha256(received_parent.sig).digest(): raise LineageBreakError("parent proof hash mismatch at ledger anchor") ```