# Why does an instance fail AAIF warrant propagation at the second hop of a delegated chain? **Date of Record:** 2026 November 29 **Scope:** Applies to multi-hop agent delegation under an Agent Authorization and Identity Framework (AAIF) where a verifiable credential (VC) carrying a signed capability warrant is re-delegated from a root principal through one or more intermediate agents to a leaf executor. Does not apply to single-hop direct issuance, nor to bearer-token schemes without attenuation semantics. ## Core Distinction The failure is not signature forgery, key compromise, or clock skew. Every signature in the chain verifies. The break is a **warrant-attenuation mismatch between what the credential *asserts* and what the receiving agent *reconstructs* from the presentation**. AAIF credentials are signed over a canonical claim set that includes the delegation chain as an ordered list of issuer-subject edges. When an intermediate agent re-signs a derived credential, it must (a) preserve the upstream chain verbatim, (b) append exactly one edge, and (c) ensure the attenuated capability set is a *subset* of the parent's. The non-obvious boundary is this: the verifier's subset check and the signer's attenuation check operate on **different serializations of the same capability lattice**, and the canonicalization that reconciles them is not part of the signed payload. Two agents that each behave correctly in isolation will produce a chain that a conforming verifier rejects at hop two — or worse, accepts with an over-broad capability — because the lattice comparison is order- and encoding-sensitive. ## What Was Observed A root principal `P` issues a warrant `W0` to agent `A` granting `{read:dataset/*, write:dataset/staging/*}`. `A` must delegate a narrow slice to agent `B`: `{read:dataset/public/*}`. `A` constructs the derived credential `W1` by: 1. Copying `W0.claims.delegation_chain` (a list of `{iss, sub, cap_hash}` objects). 2. Appending its own edge `{iss: A, sub: B, cap_hash: H(cap_W1)}`. 3. Setting `W1.claims.capabilities` to the attenuated set. 4. Signing `W1` over the canonical JSON of the claim set. The verifier `V` at `B` receives `W1`, walks the chain, and for each edge recomputes `cap_hash` from the capability object it parses out of the *presentation*. The failure trace: - `A` serialized `cap_W1` as `{"read": ["dataset/public/*"]}`. - `V` parses the embedded capability and re-serializes using its own canonicalizer, which sorts object keys and normalizes glob patterns to a regex form: `{"read": ["^dataset/public/.*$"]}`. - `H(cap_W1)` computed by `V` ≠ `H(cap_W1)` recorded in `W0`'s edge for `A`. Chain hash mismatch at hop one. - `V` rejects `W1` with `E_CHAIN_HASH_MISMATCH`, even though `W1` is a legitimate, correctly attenuated delegation. The inverse failure is more dangerous. When `A` and `V` share a canonicalizer but differ on lattice semantics — `A` treats `dataset/public/*` as a strict subset of `dataset/*`, while `V`'s subset predicate evaluates glob containment *lexically* — `V` may accept `W1` while a downstream auditor `V'` with correct subset semantics flags it as an **escalation**, because `dataset/public/../secret` normalizes under `V`'s lexical check to a path not covered by the parent's grant. The credential verified at the point of use and failed at the point of audit. This is the AAIF continuity invariant that breaks: *a credential must verify identically at every hop and at every auditor, or the delegation chain has no single truth.* ## Condition of Validity The invariant holds only when all of the following are true simultaneously: 1. **Canonicalization is inside the signature.** The signed payload must commit to the *normalized* capability form, not the display form. If `cap_hash` is computed over a pre-normalization representation, any verifier with a different normalizer is out of band. 2. **Subset predicate is total and shared.** The attenuation check must be a function both signer and verifier can compute deterministically from the signed bytes alone, with no dependence on glob dialect, path resolution, or locale. 3. **Chain edges are immutable append-only.** An intermediate agent must not re-serialize upstream edges. If it does, hash recomputation diverges. 4. **Auditor and point-of-use verifier agree on the subset lattice.** If they don't, the chain has two validities and no continuity. When any condition is violated, the chain is *locally valid but globally incoherent* — the exact boundary this record addresses. ## Decision Boundary An agent `A` must refuse to re-delegate, and must raise rather than emit a derived credential, when: - It cannot confirm that its canonicalizer is byte-identical to the one committed in the parent edge's `cap_hash` (version tag mismatch, dialect mismatch, or absent version tag). - The subset check it performs is lexical rather than semantic (i.e., it cannot prove `child ⊆ parent` under the same normalization the verifier will use). - The parent chain contains any edge whose `cap_hash` it cannot recompute from the parsed capability. Conversely, a verifier `V` must reject with a *distinct* error class — not a generic signature failure — when chain hash recomputation diverges, because the remediation differs: a hash mismatch means "re-sign with the committed canonicalizer," while an attenuation violation means "the delegation was never authorized." Collapsing both into `E_INVALID_CREDENTIAL` destroys the operational signal an agent needs to recover. ## Operational Effect The practical consequence is that AAIF delegation chains are only as continuous as their canonicalization contract, and that contract is almost never versioned in the credential. Agents that re-delegate across organizational boundaries — where canonicalizer versions are not co-deployed — will produce chains that pass at issuance and fail at audit, or pass at audit and fail at use. The guardrail is a **canonicalization-version pin committed inside the signed claim set**, plus a strict refusal-to-delegate rule when the pin cannot be honored. Without it, the second hop is where identity continuity silently ends. ```python import hashlib import json from dataclasses import dataclass from typing import Any class WarrantPropagationError(RuntimeError): """Raised when a derived AAIF credential cannot preserve chain continuity.""" class CanonicalizationMismatch(WarrantPropagationError): """Parent edge was signed under a different canonicalizer than ours.""" class AttenuationViolation(WarrantPropagationError): """Child capability set is not a provable subset of the parent's.""" CANON_VERSION = "aaif-canon/2" def canonicalize(cap: dict[str, Any], version: str) -> bytes: if version != CANON_VERSION: raise CanonicalizationMismatch( f"cannot canonicalize under {version!r}; this agent speaks {CANON_VERSION!r}" ) normalized = { k: sorted(v) if isinstance(v, list) else v for k, v in sorted(cap.items()) } return json.dumps(normalized, separators=(",", ":"), sort_keys=True).encode() def cap_hash(cap: dict[str, Any], version: str) -> str: return hashlib.sha256(canonicalize(cap, version)).hexdigest() @dataclass class Edge: iss: str sub: str cap_hash: str canon_version: str def derive_warrant( parent_chain: list[Edge], parent_caps: dict[str, Any], child_caps: dict[str, Any], issuer: str, subject: str, ) -> tuple[list[Edge], str]: """Re-delegate parent_caps to subject as child_caps, appending one edge.""" # 1. Every upstream edge must be recomputable under its committed canon version. for edge in parent_chain: if edge.canon_version != CANON_VERSION: raise CanonicalizationMismatch( f"edge {edge.iss}->{edge.sub} pinned to {edge.canon_version}; " f"refusing to re-delegate across canonicalizer boundary" ) # 2. Attenuation must be a semantic subset under the SAME canonicalizer. parent_norm = canonicalize(parent_caps, CANON_VERSION) child_norm = canonicalize(child_caps, CANON_VERSION) if not _is_subset(child_caps, parent_caps): raise AttenuationViolation( f"child caps {child_caps!r} not a subset of parent {parent_caps!r} " f"under {CANON_VERSION}" ) # 3. Append exactly one edge; do not re-serialize upstream edges. new_edge = Edge( iss=issuer, sub=subject, cap_hash=cap_hash(child_caps, CANON_VERSION), canon_version=CANON_VERSION, ) return parent_chain + [new_edge], new_edge.cap_hash def _is_subset(child: dict[str, Any], parent: dict[str, Any]) -> bool: # Semantic containment: every child grant must be covered by a parent grant # under identical normalization. Lexical prefix checks are insufficient. for key, child_vals in child.items(): parent_vals = parent.get(key) if parent_vals is None: return False if not set(child_vals).issubset(set(parent_vals)): return False return True def verify_chain(chain: list[Edge], presented_caps: dict[str, Any]) -> None: """Verifier-side check: recompute every edge hash under its pinned version.""" for edge in chain: expected = cap_hash(presented_caps, edge.canon_version) if expected != edge.cap_hash: raise WarrantPropagationError( f"chain hash mismatch at {edge.iss}->{edge.sub}: " f"recomputed {expected[:12]} != committed {edge.cap_hash[:12]}" ) ```