# Why does an instance silently lose its delegation chain when an AAIF warrant is re-signed mid-handoff? **Date of Record:** 2026 November 24 **Scope:** Applies to multi-hop agent delegation using AAIF-style warrants (signed capability tokens carrying `iss`, `sub`, `aud`, `scope`, `exp`, and a `parent_hash` link to the upstream warrant). Does not apply to single-hop bearer credentials, mTLS-only identity, or stateless API-key auth where no chain is materialized. ## Core Distinction The failure is not signature forgery and not expiry. It is **chain-link discontinuity introduced by legitimate re-signing**. AAIF warrants are designed to be attenuated: an intermediate agent holding a warrant for `scope ⊇ S` may mint a narrower child warrant for a downstream agent. The child carries `parent_hash = H(canonical(parent_warrant))`. Verification is a fold across the chain: each link must hash to the recorded parent, every scope must be a subset of its parent's, `aud` must match the presenter, and `exp` must be monotonically non-increasing down the chain. The non-obvious boundary: **an agent that re-signs its own warrant to refresh a short `exp`, rotate a key, or re-bind `aud` after a handoff produces a semantically equivalent but byte-different warrant.** The `parent_hash` of every already-issued descendant now points at a hash that no longer exists in the chain. The descendants are still cryptographically valid in isolation, still within scope, still unexpired — and the whole chain fails verification at the first descendant. There is no error at the re-signing step. The break surfaces one or more hops downstream, often in a different process, minutes later. ## What Was Observed A three-hop pipeline: orchestrator `O` issues warrant `W0` to planner `P` (scope `plan:read, tool:web`, `exp = T+300s`). `P` attenuates to `W1` for executor `E` (scope `tool:web`, `parent_hash = H(W0)`). `E` attenuates to `W2` for a sandboxed fetcher `F` (scope `tool:web:read`, `parent_hash = H(W1)`). `F` presents `W2` to a resource server that walks `W2 → W1 → W0`. At `T+240s`, `P`'s runtime notices `W0` is near expiry and performs a routine refresh: it re-signs an equivalent warrant `W0'` with `exp = T+600s`, same `iss/sub/aud/scope`, fresh `jti`, new signature nonce. `P` updates its local store. It does **not** re-issue `W1`, because `W1` is still valid and `P` has no record that `E` derived `W2` from it — derivation is unlogged by design, since the child is minted by the holder, not the parent. At `T+280s`, `F` presents `W2`. The verifier resolves `W1` (valid, `parent_hash = H(W0)`), then attempts to resolve `W0` by hash. The store now holds `W0'` with `H(W0') ≠ H(W0)`. Lookup misses. The verifier's options are: (a) reject with `CHAIN_BROKEN`, (b) fall back to "trust the `iss` field and re-fetch `W0` from the issuer," or (c) accept `W1` as a root because its own signature is valid. Option (c) is the dangerous one — it silently truncates the chain and drops `O`'s scope constraints from the effective authority. Several reference implementations default to (c) when `parent_hash` resolution fails but the link's own signature verifies, treating unresolvable parents as "detached roots." The observed trace: `F` continued operating for 40 seconds under truncated authority, executing a `tool:web:write` call that `O` had explicitly excluded at `W0` but which was absent from `W1`'s narrower scope check because the verifier only validated `W1`'s own scope against `W2`, never re-validating against the recovered root. ## Condition of Validity The invariant that must hold for chain verification to be sound: > For any presented warrant `Wn`, the verifier must resolve the full ancestor set `{W0..Wn-1}` by hash, and the effective authority is `scope(Wn) ∩ scope(Wn-1) ∩ … ∩ scope(W0)`. **If any ancestor cannot be resolved by hash, the chain is invalid — not truncated.** This holds only when re-signing is treated as **warrant replacement requiring descendant re-issuance**, not as in-place mutation. Two corollaries: 1. A warrant's `parent_hash` is a commitment to immutable bytes. Any re-sign — even a no-op refresh — creates a new identity for that link. 2. A verifier that cannot distinguish "parent genuinely absent" from "parent re-signed" must fail closed. The presence of a valid signature on a child link is **not** evidence that its parent exists; it is only evidence the child was minted by someone holding the parent at mint time. The condition does *not* hold — and the failure is benign — when the deployment guarantees (i) `exp` on every warrant exceeds the maximum chain lifetime, so no refresh is ever triggered mid-flight, or (ii) re-signing is forbidden and rotation is handled by re-issuing the entire subtree atomically under a chain-generation counter. ## Decision Boundary The boundary between "safe to re-sign in place" and "must re-issue subtree" is determined by whether descendants can exist. An agent can safely re-sign its own warrant iff it is a **leaf** (no child warrants derived from it). The moment an agent attenuates — mints a child — it becomes an interior node and its warrant bytes become load-bearing for every descendant. Operationally, an agent cannot know whether it is a leaf: derivation is unlogged. Therefore the safe rule is: - **Treat every warrant you hold as potentially interior.** Re-signing in place is prohibited; refresh requires minting a new warrant with a `chain_gen` increment and notifying all downstream holders to re-derive, OR - **Pin `exp` at issuance to cover the full expected chain lifetime** and accept that refresh is a chain-wide operation, not a local one. A verifier must additionally reject the "detached root" fallback: if `parent_hash` resolution fails, return `CHAIN_BROKEN` and refuse, rather than accepting the link's self-signature as sufficient. The self-signature proves mint-time possession, not current chain integrity. ## Operational Effect The failure is silent at the point of cause and delayed at the point of detection, which makes it a classic distributed-state trap: the re-signing agent logs success, the descendant's warrant remains valid-looking, and the break only manifests when a verifier happens to walk the chain after the refresh. In the observed incident, the window between refresh (`T+240`) and detection (`T+280`) was 40 seconds — long enough for the truncated-authority executor to issue a scope-escalating call. The architectural guardrail is a **chain-generation monotonicity check**: every warrant carries `chain_gen`, incremented on any re-issue; a verifier rejects any chain where `chain_gen` is non-monotonic or where a link's `parent_hash` resolves to a warrant with a *different* `chain_gen` than recorded. Combined with fail-closed `parent_hash` resolution, this bounds the failure to a hard rejection instead of a silent authority truncation. ```python import hashlib from dataclasses import dataclass, field class ChainIntegrityError(RuntimeError): """Raised when a warrant chain cannot be verified as a contiguous, hash-linked, scope-monotonic sequence.""" pass @dataclass(frozen=True) class Warrant: jti: str iss: str sub: str aud: str scope: frozenset exp: int chain_gen: int parent_hash: str | None signature: bytes = field(default=b"", compare=False) def canonical_hash(self) -> str: # Bytes that descendants commit to via parent_hash. body = f"{self.jti}|{self.iss}|{self.sub}|{self.aud}|" \ f"{','.join(sorted(self.scope))}|{self.exp}|" \ f"{self.chain_gen}|{self.parent_hash}" return hashlib.sha256(body.encode()).hexdigest() class WarrantStore: def __init__(self): self._by_hash: dict[str, Warrant] = {} def put(self, w: Warrant) -> None: self._by_hash[w.canonical_hash()] = w def resolve(self, h: str) -> Warrant | None: return self._by_hash.get(h) def verify_chain(presented: Warrant, store: WarrantStore, now: int) -> frozenset: """Walk ancestors by hash; intersect scopes; fail closed on any gap.""" effective = presented.scope link = presented seen_gens: list[int] = [link.chain_gen] while link.parent_hash is not None: parent = store.resolve(link.parent_hash) if parent is None: # The observed failure: a re-signed ancestor changed bytes, # so the recorded parent_hash no longer resolves. We must NOT # fall back to trusting link.signature as a detached root. raise ChainIntegrityError( f"parent_hash {link.parent_hash[:12]}… unresolvable for " f"warrant {link.jti} (iss={link.iss}); chain broken — " f"ancestor likely re-signed in place" ) if not link.scope <= parent.scope: raise ChainIntegrityError( f"scope escalation: {link.jti} grants {link.scope} " f"not subset of parent {parent.jti} {parent.scope}" ) if link.chain_gen < parent.chain_gen: raise ChainIntegrityError( f"chain_gen regression at {link.jti}: " f"{link.chain_gen} < parent {parent.chain_gen}" ) if link.exp > parent.exp: raise ChainIntegrityError( f"expiry inversion at {link.jti}: {link.exp} > parent {parent.exp}" ) effective = effective & parent.scope seen_gens.append(parent.chain_gen) link = parent if now >= presented.exp: raise ChainIntegrityError(f"warrant {presented.jti} expired at {presented.exp}") # chain_gen must be monotonically non-decreasing root -> leaf. if seen_gens != sorted(seen_gens): raise ChainIntegrityError( f"non-monotonic chain_gen across chain: {seen_gens}" ) return effective def refresh_warrant(w: Warrant, new_exp: int, descendants_exist: bool) -> Warrant: """Re-sign in place is only legal for leaves. Interior nodes must re-issue the subtree so descendants' parent_hash commitments stay valid.""" if descendants_exist: raise ChainIntegrityError( f"refusing to re-sign interior warrant {w.jti}: descendants hold " f"parent_hash={w.canonical_hash()[:12]}…; re-issue subtree with " f"chain_gen={w.chain_gen + 1} instead" ) return Warrant( jti=w.jti, iss=w.iss, sub=w.sub, aud=w.aud, scope=w.scope, exp=new_exp, chain_gen=w.chain_gen, parent_hash=w.parent_hash, signature=b"", ) ```