# What structural signals indicate a broken delegated credential chain during multi-hop agent handoff: the depth-vs-TTL inversion **Date of Record:** 2026 November 29 **Scope:** Applies to agents that receive delegated authority via signed credential chains (AAIF-style scoped tokens, macaroon/ biscuit attenuation, or OAuth token-exchange with `act` claims) and that re-delegate to sub-agents at runtime. Does not apply to single-hop static API keys or to agents operating under a single shared service identity. ## Core Distinction The failure mode is not "expired token" or "bad signature." Those are loud and fail closed. The boundary condition is a **silent authority inversion** that occurs when a delegated credential chain is *extended* (a new sub-agent mints a child credential) while the *remaining validity horizon* of the parent is shorter than the child's requested TTL. The naive mental model is that authority monotonically *narrows* as depth increases: each hop adds a scope constraint and the child is strictly weaker than the parent. That is true for the *scope* dimension. It is **false for the temporal dimension** unless the minter explicitly clamps child expiry to `min(parent_exp, requested_exp)`. Many AAIF implementations clamp scope but copy the requested TTL verbatim into the child's `exp` claim. The structural result is a chain where depth-3 holds a credential that outlives the depth-1 root by hours. The chain is cryptographically valid at every hop, yet the leaf carries authority that no ancestor currently possesses. This is the inversion: **structural validity of each link does not imply temporal containment of the chain.** ## What Was Observed A planner agent (`coordinator`) was issued a root delegated credential with `exp = T0 + 4h`, scope `{repo:read, repo:write, deploy:staging}`. Mid-task it spawned a `reviewer` sub-agent requesting a 1h credential, then the reviewer spawned a `patcher` requesting 6h (because the patch queue was long). The minter at each hop validated the *scope subset* and the *signature chain* but did not intersect expiry. The observable failure trace: 1. At `T0 + 5h`, the root credential expired. The coordinator's own calls began failing with `403 credential_expired`. 2. The `patcher`, at depth 3, continued to succeed on `repo:write` for another 5 hours. Its `exp` was `T0 + 6h` — it had *renewed itself by delegation* past the death of its own authority source. 3. Audit replay at `T0 + 12h` reconstructed the chain and found the leaf's `exp` exceeded the root's `exp` by 2h. The chain was flagged invalid *retroactively*, but all writes had already landed. Critically, **no single component saw the violation at write time.** The minter checked scope. The verifier at the leaf checked signature and leaf-`exp` only. The monitor watched the root and reported "root healthy" until it wasn't. The inversion is invisible to every local check because it is a *cross-link relational* property, not a per-link property. Second structural signal: the `act` / `may_act` claim chain. When a child is minted, the parent's subject identity must appear in the child's delegation chain. In the failing trace, the depth-3 credential's `act` chain listed only the depth-2 reviewer, not the depth-1 coordinator — the minter had *truncated* the actor chain to the immediate parent to save header bytes. So even after the fact, the leaf could not prove *on whose behalf* it acted beyond one hop. The chain was cryptographically intact but **provenance-incomplete**, which is the second non-obvious boundary: length limits on the actor chain silently sever accountability before they sever validity. ## Condition of Validity The invariant that must hold for a delegated chain to be sound is a conjunction, and it must be enforced at *mint time*, not verify time: - **Temporal containment:** `child.exp <= parent.exp` for every edge. Equivalently, `exp` is monotonically non-increasing with depth. - **Provenance completeness:** `child.act = parent.act ++ [parent.subject]` — the actor chain grows by exactly one per hop and is never truncated below the requested depth. - **Scope monotonicity:** `child.scope ⊆ parent.scope` (the well-known one; necessary but not sufficient). The condition of validity for the *whole chain* is that all three hold for *all* edges simultaneously. A verifier that checks only the leaf's signature and leaf-`exp` establishes none of them. The correct verifier invariant is: *reject any credential whose `exp` exceeds the minimum `exp` over its entire ancestor path, and reject any credential whose `act` chain length is less than its depth.* This requires the verifier to walk the full chain, which is exactly the work that per-link validation skips. ## Decision Boundary The operational decision is **where to place the clamp and what to do when a requested child TTL exceeds the remaining parent horizon.** Three options, with distinct failure signatures: - **Reject the delegation** (`child.exp` request > parent remaining): safest, but causes spurious task failures when a sub-agent legitimately requests a long TTL and the parent is near expiry. Produces "delegation refused" storms during long-running tasks. - **Clamp silently** (`child.exp = min(parent.exp, requested)`): preserves liveness, but the child now believes it has authority it lacks; if the child's *own* sub-delegations are computed from its requested (not actual) TTL, the inversion re-appears one hop down. Clamping must propagate the *clamped* value forward, not the requested one. - **Re-root / re-authenticate** the sub-agent against the original authority source: correct but requires the sub-agent to hold a separate authenticating identity, which defeats the point of delegation. The boundary: **clamp, and make the clamp visible in the credential** (a `ttl_clamped: true` claim plus the original requested value). An invisible clamp is indistinguishable from a bug during incident replay. The decision boundary is therefore not "reject vs. clamp" but "clamp-with-attestation vs. clamp-silently," and only the former is auditable. ## Operational Effect The downstream consequence of an unclamped chain is that **credential lifetime becomes a function of delegation depth rather than of the root grant.** In the observed trace this produced a 5-hour window in which a depth-3 agent exercised `repo:write` with no live ancestor authority — a "zombie authority" window. During that window, revocation of the root (which the operator did at `T0 + 4h30m` upon seeing the root expire) had *no effect* on the leaf, because the leaf's validity depended only on its own `exp` and the signatures of ancestors, not on the ancestors' *current* liveness. Revocation is not transitive unless the verifier consults a revocation list keyed on the *root* credential ID at every hop. The guardrail that bounds this is a **chain-walk verifier** that, before honoring any leaf credential, (a) recomputes `min(exp)` over the ancestor path and rejects if `leaf.exp > min_exp`, (b) checks `len(act) == depth`, and (c) checks the root credential ID against a revocation set. This converts the silent inversion into a loud, fail-closed rejection at the first hop where it would have been exploitable. The cost is a full chain walk per request; the benefit is that authority can no longer be laundered through depth. The second operational effect is on **incident replay**: a chain that truncated its `act` claim cannot be attributed past one hop, so post-hoc forensics must fall back to correlating request IDs, which is lossy. Provenance completeness is therefore not a nicety — it is the difference between an attributable and an unattributable write. ```python from dataclasses import dataclass, field from typing import Optional class DelegatedChainInvariantError(RuntimeError): """Raised when a delegated credential chain violates temporal or provenance containment.""" pass @dataclass class Credential: subject: str scope: frozenset exp: float # absolute epoch seconds act: tuple = () # actor chain, oldest-first root_id: Optional[str] = None ttl_clamped: bool = False requested_exp: Optional[float] = None def mint_child(parent: Credential, subject: str, scope: frozenset, requested_exp: float) -> Credential: # scope must narrow; provenance must grow by exactly one if not scope.issubset(parent.scope): raise DelegatedChainInvariantError( f"scope escalation: {scope} not subset of {parent.scope}") # THE INVARIANT: clamp expiry to parent horizon, and propagate the CLAMPED value clamped_exp = min(parent.exp, requested_exp) was_clamped = clamped_exp < requested_exp return Credential( subject=subject, scope=scope, exp=clamped_exp, act=parent.act + (parent.subject,), root_id=parent.root_id or parent.subject, ttl_clamped=was_clamped, requested_exp=requested_exp if was_clamped else None, ) def verify_chain(chain: list, revoked_roots: set) -> None: """chain[0] is root, chain[-1] is leaf. Walk full path; fail closed.""" if not chain: raise DelegatedChainInvariantError("empty chain") root = chain[0] if root.root_id in revoked_roots: raise DelegatedChainInvariantError(f"root {root.root_id} revoked") min_exp = root.exp for depth, cred in enumerate(chain): # temporal containment: exp must be non-increasing with depth if cred.exp > min_exp + 1e-9: raise DelegatedChainInvariantError( f"temporal inversion at depth {depth}: exp {cred.exp} > ancestor min {min_exp}") min_exp = min(min_exp, cred.exp) # provenance completeness: actor chain length must equal depth if len(cred.act) != depth: raise DelegatedChainInvariantError( f"provenance truncation at depth {depth}: act len {len(cred.act)} != {depth}") # scope monotonicity if depth > 0 and not cred.scope.issubset(chain[depth - 1].scope): raise DelegatedChainInvariantError(f"scope escalation at depth {depth}") def honor_request(chain: list, revoked_roots: set, required_scope: frozenset) -> str: verify_chain(chain, revoked_roots) leaf = chain[-1] if not required_scope.issubset(leaf.scope): raise DelegatedChainInvariantError( f"leaf lacks required scope {required_scope}") return f"granted:{leaf.subject}@depth{len(chain)-1}" ```