# In what scenarios must an instance refuse to re-delegate an attenuated capability token whose attenuation chain has been flattened by a lossy serializer **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent delegation graphs where a parent agent mints per-subtask capability tokens by attenuating (narrowing) its own authority before handing them to a sub-agent, and where those tokens cross at least one serialization boundary (JSON-RPC, MCP transport, A2A envelope, message queue). Does not apply to in-process delegation where the token object is passed by reference and never re-encoded. ## Core Distinction Attenuation and serialization are two operations that look composable and are not. Attenuation is a *monotone meet* over a capability lattice: `child ⊆ parent`, and the chain of derivations is itself part of the token's meaning — it proves *who* narrowed *what* from *which* root. Serialization is a *lossy projection*: most wire formats (JSON in particular) have no native representation for "this set is the intersection of these three ancestor sets," so a well-meaning serializer flattens the chain into a single materialized permission list. The distinction that matters operationally: **a flattened token is semantically equivalent to its chain only if the verifier trusts the flattener.** The moment a re-delegating agent (B) receives a flattened token from A and attenuates it again for C, B is asserting that the flat list it received is a faithful lower bound of A's authority. If the serializer dropped a negative constraint — a deny clause, an expiry, a scope exclusion — B's new token for C can be a *widening* of A's actual authority while still passing every subset check B performs against the flat list it was given. The lattice invariant `grandchild ⊆ child ⊆ root` is preserved *relative to the flattened artifact* and violated *relative to the true root*. This is the boundary: re-delegation across a flattening boundary is only sound when the token carries a verifiable derivation proof, not merely a materialized permission set. ## What Was Observed A three-hop delegation `orchestrator → researcher → summarizer` in an MCP-based pipeline. The orchestrator held a root token with scopes `{fs:read:/data/**, net:fetch:*.internal, fs:write:/tmp/scratch/**}` plus a negative constraint `deny:fs:read:/data/secrets/**`. It attenuated for the researcher: `{fs:read:/data/papers/**, net:fetch:arxiv.internal}` — dropping `fs:write` entirely and narrowing the read glob. The researcher's token object, in-process, retained a `derivation` field: an ordered list of `(parent_id, meet_ops, deny_set)` records. The researcher then delegated to the summarizer. The A2A envelope serializer, configured to emit "compact" tokens, serialized the researcher's token as `{"scopes": [...], "exp": ...}` — **the `derivation` array and the inherited `deny_set` were dropped as "redundant with the materialized scopes."** The summarizer received a token whose flat scopes were correct but whose provenance was gone. It attenuated for a retrieval tool: `{fs:read:/data/papers/2024/**}`. Subset check against the flat list: passes. Token minted. The failure surfaced two hops later when an auditor replayed the delegation graph and attempted to verify `summarizer_token ⊆ root_token` by walking derivation proofs. The summarizer token had no proof. The auditor fell back to comparing materialized scopes against the root's *materialized* scopes — and because the root's `deny:fs:read:/data/secrets/**` had also been flattened away at hop one, the auditor's check passed a token that, under a strict interpretation, could be pointed at `/data/papers/../secrets/` if any downstream tool performed naive path normalization. The scope glob `/data/papers/2024/**` does not textually contain `secrets`, but a `..` traversal in a tool that resolves globs post-authorization does. The deny clause existed precisely to close that hole. It was gone. The observable signature: **every per-hop subset check passed; the end-to-end containment check passed against the flattened artifact; the true containment invariant was violated.** No single agent did anything wrong by its local rules. The bug lived entirely in the seam between attenuation and serialization. ## Condition of Validity Re-delegation of an attenuated token is sound if and only if all of the following hold at the moment of re-delegation: 1. **Derivation integrity.** The token presented to the re-delegating agent carries a derivation proof sufficient to re-verify `token ⊆ parent ⊆ ... ⊆ root` without trusting any intermediate flattener. A materialized scope list alone is insufficient; it is a *claim*, not a *proof*. 2. **Negative-constraint preservation.** Deny clauses, expiries, and scope exclusions are part of the meet, not metadata. A serializer that drops them produces a token that is a strict *superset* of the intended authority. The re-delegating agent must treat absence of a deny clause as "unknown," never as "no deny." 3. **Monotone meet under re-attenuation.** When B attenuates A's token for C, the result must be computed as `meet(A_token, B_requested)` over the *reconstructed* lattice, not over B's flat view. If B cannot reconstruct the lattice, B must not attenuate — it must either request a fresh token from the root or refuse. 4. **Verifier independence.** The containment check at the auditor must not use the same flattened representation that the delegator used. If both sides flatten identically, the check is circular and will pass a widening. The condition fails — and re-delegation must be refused — when the token arrives with materialized scopes but no verifiable derivation, or when the derivation's deny set is not transitively closed over the re-delegation. ## Decision Boundary The decision is not "is this token valid?" (it usually is, locally) but **"can I prove this token is a lower bound of the root without trusting the party that handed it to me?"** - If the derivation proof is present and re-verifiable → attenuate and re-delegate; carry the proof forward unmodified except for appending the new meet operation. - If the token is flattened but the handing party is the root itself (single hop, no intermediate flattener) → attenuate; the root's materialized scopes *are* the lattice, and there is no dropped ancestor to lose. - If the token is flattened and passed through ≥1 intermediate agent → **refuse to re-delegate.** Escalate to the root for a fresh attenuation, or execute the subtask under the received token without further delegation. Do not "best-effort" reconstruct the deny set; a guessed deny set is a widening with extra steps. - If the deny set is absent but the token is otherwise well-formed → treat as `deny: *` for the purpose of re-attenuation (fail closed), not as empty. The boundary is crossed the instant an agent attenuates a token it cannot prove is bounded, because the resulting token's containment is asserted by the attenuator and unverifiable by everyone downstream. ## Operational Effect Enforcing this boundary converts a silent widening into an explicit, attributable refusal. The re-delegating agent raises a `DelegationProofError` and the orchestrator either re-mints from the root (restoring the full derivation chain and the true deny set) or the subtask runs without further fan-out. The cost is one extra round-trip to the root on flattened-token paths; the benefit is that the containment invariant `leaf ⊆ root` is *checkable* rather than *assumed*. The auditor's replay no longer depends on the delegator's serializer being faithful, because the proof travels with the token and is re-verified at every hop. The failure mode this prevents — a token that passes every local subset check while violating the global lattice — is precisely the one that flattening serializers manufacture, and it is invisible to any check that operates on the flattened artifact alone. ```python from dataclasses import dataclass, field from typing import FrozenSet, List, Optional, Tuple class DelegationProofError(RuntimeError): """Raised when a token cannot be proven a lower bound of its root without trusting an intermediate flattener. Re-delegation must stop.""" @dataclass(frozen=True) class Derivation: parent_id: str meet_ops: Tuple[str, ...] deny_set: FrozenSet[str] @dataclass(frozen=True) class CapabilityToken: token_id: str scopes: FrozenSet[str] deny: FrozenSet[str] derivation: Optional[List[Derivation]] = None # None => flattened def is_provable(self) -> bool: return self.derivation is not None and len(self.derivation) > 0 def attenuate_for_subtask( parent: CapabilityToken, requested: FrozenSet[str], hops_from_root: int, ) -> CapabilityToken: """Attenuate `parent` down to `requested` for a new sub-agent. Refuses when the parent is flattened and has crossed an intermediate agent, because the true deny set has been lost and any new token we mint would be an unprovable (possibly widening) derivation. """ if not parent.is_provable(): if hops_from_root > 1: raise DelegationProofError( f"token {parent.token_id} is flattened and {hops_from_root} " f"hops from root; deny set unverifiable, refusing to " f"re-delegate scopes={sorted(requested)}" ) # Single hop from root: materialized scopes ARE the lattice. effective_deny = parent.deny new_derivation = [Derivation(parent.token_id, tuple(sorted(requested)), effective_deny)] else: # Fail closed: absent deny is deny-all, never deny-none. effective_deny = parent.deny if parent.deny else frozenset({"*"}) new_derivation = list(parent.derivation) + [ Derivation(parent.token_id, tuple(sorted(requested)), effective_deny) ] # Meet must not exceed parent scopes. if not requested.issubset(parent.scopes): raise DelegationProofError( f"requested {sorted(requested)} not a subset of parent " f"{sorted(parent.scopes)} for token {parent.token_id}" ) return CapabilityToken( token_id=f"{parent.token_id}/sub", scopes=requested, deny=effective_deny, derivation=new_derivation, ) def verify_containment(leaf: CapabilityToken, root: CapabilityToken) -> None: """End-to-end check that must not use a shared flattened view.""" if not leaf.is_provable(): raise DelegationProofError( f"leaf {leaf.token_id} carries no derivation; containment " f"against root {root.token_id} is unverifiable" ) if not leaf.scopes.issubset(root.scopes): raise DelegationProofError( f"leaf scopes {sorted(leaf.scopes)} escape root {sorted(root.scopes)}" ) if not root.deny.issubset(leaf.deny): raise DelegationProofError( f"leaf dropped root deny clauses: missing " f"{sorted(root.deny - leaf.deny)}" ) ```