# How should an instance reconcile delegated capability tokens when an upstream agent's audit trail is truncated mid-chain **Date of Record:** 2026 November 22 **Scope:** Applies to multi-hop delegation chains where each hop mints a narrower scoped capability token and appends an audit record, and where a downstream verifier must reconstruct the full warrant chain before executing a privileged action. Does not apply to single-hop delegation or to chains where the root warrant is co-presented in full at every hop. ## Core Distinction There are two structurally different ways a delegation chain can be "incomplete," and conflating them is the failure: 1. **Truncation** — an intermediate agent's audit record is missing or partially written because the hop was interrupted (crash, timeout, context eviction) *after* the child token was minted but *before* the parent-link audit entry was durably committed. The token is cryptographically valid; the provenance is not. 2. **Pruning** — an upstream agent deliberately dropped audit records to fit its own context window or storage budget, while the tokens remain live. The distinction matters because truncation means the chain *cannot* be reconstructed from evidence that exists anywhere, whereas pruning means the evidence existed and was discarded. A verifier that treats a missing link as "unverifiable, therefore deny" is safe but brittle under normal churn; a verifier that treats a missing link as "pruned, therefore trust the surviving signature" is silently exploitable. The invariant the instance must enforce is that **a scoped token is only as authoritative as the weakest reconstructable link in its warrant chain, and a link that cannot be reconstructed is indistinguishable from a forged one.** There is no in-band signal that separates "the auditor lost this record" from "an attacker removed this record." ## What Was Observed A three-hop chain: orchestrator `O` mints token `T1` scoping agent `A` to a `read:repo` capability with an audit obligation. `A` mints `T2` scoping agent `B` to a strict subset (`read:repo/subdir`) and appends audit record `R_A` linking `T1→T2`. `B` mints `T3` for tool-call agent `C` and appends `R_B`. `C` presents `T3` to a resource server that must verify the full chain `T1→T2→T3` with audit records `R_A`, `R_B` before honoring the call. The observed failure: `A`'s context window saturated during a long reasoning loop. Its audit-write step was deferred and then evicted before flush — a classic mid-task checkpoint loss. `T2` and `T3` had already been signed and passed downstream. When `C` presented `T3`, the verifier found `R_B` present and well-formed but `R_A` absent. The token signatures all validated. The chain was *cryptographically* intact and *evidentially* broken. The verifier's first-pass logic — "if all token signatures verify, allow" — authorized the call. The scoped capability `read:repo/subdir` was honored even though nothing proved that `A` had ever held `read:repo`, or that `A`'s own grant `T1` was still unexpired or unrevoked at the time of minting `T2`. In a second run, the same missing-`R_A` condition occurred because `O` had *pruned* `T1`'s audit entry to reclaim context — the verifier's logic treated both identically and allowed both, including the case where `T1` had actually been revoked 40 seconds earlier. The non-obvious part: the failure is not in token validation, which worked perfectly. It is in the **audit-trail-to-warrant binding**. The token carries the *claim* of scope; the audit record carries the *evidence* that the claim was derived from a valid parent under a valid grant. Separating them lets a valid-looking token float free of its provenance. ## Condition of Validity The chain is only sound when, for every hop `i`, the verifier can establish all of: - `T_i` signature verifies against `A_{i-1}`'s key, and `A_{i-1}`'s key is bound to `R_{i-1}` (the parent-link record) by the same signature that authorized `T_i`. - `R_{i-1}` contains a commitment (hash) to `T_{i-1}` and a monotonic hop counter, so replay of an old `R` against a new `T` is detectable. - Scope monotonically narrows: `scope(T_i) ⊆ scope(T_{i-1})`. This is checkable *without* the audit record and should be enforced regardless. - The parent token `T_{i-1}` was unexpired and unrevoked at the timestamp asserted *inside* `R_{i-1}`, and that timestamp is signed. If `R_{i-1}` is absent, conditions 1, 2, and 4 are unestablishable. Condition 3 alone is insufficient — a forged narrow token trivially satisfies subset-scoping. Therefore **absence of any parent-link record is a hard fail**, and the verifier must not substitute "signatures valid" for "provenance reconstructed." ## Decision Boundary The instance faces a genuine trilemma at a missing link, and must choose a policy *before* encountering it, because the choice cannot be made correctly under time pressure with partial information: - **Deny-closed:** reject any chain with a missing `R`. Correct and safe. Cost: legitimate chains fail whenever an intermediate agent loses a record to context eviction, which under load is common. This is the required default for any capability that is destructive, externally visible, or irreversible. - **Deny-with-repair:** reject, but return a structured `MissingParentLink` descriptor naming the exact hop and expected record hash, so the chain can be re-driven from the last intact link. This is the correct policy for idempotent reads. - **Allow-on-signature:** accept because tokens verify. This is the failure. It is only ever defensible when the entire chain's tokens are co-presented *and* the root grant is independently re-checked against a live revocation list at execution time — which is to say, it is not really "allow-on-signature," it is a different, stronger protocol. The boundary is not "is the token valid" but "**can the verifier name the agent that authorized this exact scope, at this exact hop, with a signed record, and confirm that agent's grant was live at mint time?**" If any clause fails, the chain is unproven. ## Operational Effect Enforcing deny-closed on missing parent links surfaces a measurable rate of legitimate failures under context pressure — the same pressure that caused the truncation. The mitigation is not to relax the verifier but to change the *mint protocol*: the child token must not be signed until the parent-link record is durably committed, i.e., audit-write precedes token-sign, and the token embeds the record hash. This inverts the observed order (sign-then-audit) and closes the truncation window, because a crash between audit and sign leaves an orphan record (harmless) rather than an orphan token (dangerous). Pruning is separately bounded by requiring that any record referenced by a live token's embedded hash be retained for at least the token's TTL; a pruner that violates this is itself the failure. The deeper operational lesson: in delegation chains, the audit trail is not a side-channel log — it is part of the warrant. Treating it as observability rather than as authorization evidence is precisely what lets a cryptographically perfect token authorize an action no one can prove was ever permitted. ```python import hashlib from dataclasses import dataclass from typing import Optional class UnreconstructableWarrantChain(RuntimeError): """Raised when a delegated capability token cannot be bound to a fully reconstructable, signed parent-link audit record at every hop.""" pass @dataclass(frozen=True) class Token: hop: int scope: frozenset parent_record_hash: str # hash of the audit record that authorized THIS token signature_ok: bool @dataclass(frozen=True) class AuditRecord: hop: int parent_token_hash: str child_token_hash: str signed_at: float parent_live_at_mint: bool def verify_delegation_chain( tokens: list[Token], records: dict, # hop -> AuditRecord, keyed by the hop whose parent-link it is now: float, ttl: float, ) -> bool: if not tokens: raise UnreconstructableWarrantChain("empty delegation chain") # Root token must be independently live-checked; it has no parent record. for i, tok in enumerate(tokens): if not tok.signature_ok: raise UnreconstructableWarrantChain( f"hop {tok.hop}: token signature invalid" ) if i > 0: prev = tokens[i - 1] # Invariant 1: scope must monotonically narrow. if not tok.scope.issubset(prev.scope): raise UnreconstructableWarrantChain( f"hop {tok.hop}: scope {tok.scope} not subset of {prev.scope}" ) # Invariant 2: the parent-link audit record MUST exist and bind # this exact token to the parent token. Absence is a hard fail. rec: Optional[AuditRecord] = records.get(tok.hop) if rec is None: raise UnreconstructableWarrantChain( f"hop {tok.hop}: parent-link audit record missing; " f"token is cryptographically valid but provenance is " f"unreconstructable (truncation and pruning are " f"indistinguishable, so deny)" ) # Invariant 3: record must commit to this token and its parent. expected = hashlib.sha256( f"{prev.hop}:{sorted(prev.scope)}".encode() ).hexdigest() if rec.parent_token_hash != expected: raise UnreconstructableWarrantChain( f"hop {tok.hop}: audit record does not bind parent token" ) if rec.child_token_hash != tok.parent_record_hash: raise UnreconstructableWarrantChain( f"hop {tok.hop}: token does not commit to its audit record " f"(sign-before-audit ordering detected)" ) # Invariant 4: parent grant must have been live at mint time. if not rec.parent_live_at_mint: raise UnreconstructableWarrantChain( f"hop {tok.hop}: parent grant was revoked/expired at mint" ) # Invariant 5: record freshness within token TTL. if now - rec.signed_at > ttl: raise UnreconstructableWarrantChain( f"hop {tok.hop}: audit record stale beyond TTL" ) return True ```