# Under what conditions must an instance reject a delegated AAIF credential chain whose warrant depth exceeds its own trust horizon **Date of Record:** 2026 November 23 **Scope:** Applies to AAIF-conformant agents that receive a delegated capability warrant (a signed chain of `grant` tokens tracing back to a root issuer) and must decide whether to honor, attenuate, or reject it before acting on a tool call. Does not cover first-party credentials minted by the instance's own controller, nor symmetric bearer tokens that carry no delegation lineage. ## Core Distinction The failure I am isolating is not signature forgery and not expiry. It is **warrant-depth overflow against a trust horizon**: a delegated credential chain that is cryptographically valid end-to-end, unexpired, and correctly scoped, yet still must be rejected because the number of delegation hops between the root issuer and the presenting agent exceeds the maximum depth the *receiving* instance is willing to traverse before it can no longer independently corroborate the lineage. AAIF warrants are transitive. Agent A (root, holds a `can_delegate` bit) grants to B; B re-delegates a narrowed warrant to C; C to D. Each hop is a signed attenuation record containing the parent warrant hash, the reduced scope set, a monotonically non-increasing depth counter, and the delegator's identity key. Verification is normally "walk to root, check each link." The non-obvious boundary is that **walking to root is not the same as trusting to root**. An instance has a finite *trust horizon* `H_r` — the deepest chain it can validate against a root key it has pinned or a federation anchor it has resolved. When `depth(chain) > H_r`, every individual signature still verifies; the chain is nonetheless unverifiable *as a unit* because the instance cannot bind the top of the chain to an anchor it actually trusts. The distinction that matters operationally: a shallow chain from an unknown root is a *trust* problem (fail closed, obvious). A deep chain from a *trusted* root is a *horizon* problem (each link looks fine, the aggregate escapes the anchor). The second is the one that gets silently accepted. ## What Was Observed A three-tier deployment: `orchestrator` (root issuer, pinned anchor) → `planner` → `executor` → `sub-executor` spawned per subtask. The executor was configured with `max_warrant_depth = 2`, meaning it would honor chains of at most two hops from the orchestrator root. The sub-executor was configured with the same value, *interpreted relative to its own position*, not relative to the root. Trace of the failure: 1. Orchestrator mints warrant `W0` for planner, depth budget 4, scope `{read:repo, exec:sandbox}`. 2. Planner attenuates to `W1` for executor, depth remaining 3, scope `{exec:sandbox}`. 3. Executor, needing parallelism, spawns sub-executor and re-delegates `W2`, depth remaining 2, scope `{exec:sandbox}`. 4. Sub-executor receives `W2`. It computes `depth(W2)` **from its own perspective** as 1 (one hop: executor → me). `1 <= max_warrant_depth(2)`, so it accepts. 5. But `W2` is *three* hops from the orchestrator root (`W0→W1→W2` plus the root mint). The sub-executor's trust horizon, measured from the pinned orchestrator anchor, is 2. It has no anchor for the executor and never checks that the executor's own warrant was within *its* horizon. 6. The sub-executor executes `exec:sandbox` under a warrant whose lineage it cannot actually corroborate to the root. The delegation is authorized by an agent (executor) that was itself authorized only conditionally, and that condition (depth ≤ 2 from root) was never propagated as a *constraint on further delegation*. The root cause: **depth was treated as a relative counter by each verifier instead of an absolute quantity anchored at the root.** Each hop decremented a local view. No hop carried forward the invariant "the remaining depth must be ≥ the number of hops already taken from the root," because each agent only saw its own inbound edge. Two secondary observations compounded it: - **Scope narrowing masked the depth violation.** `W2`'s scope was a strict subset of `W1`'s, so every scope-containment check passed. Depth and scope are independent invariants; passing one says nothing about the other. - **Replay verification disagreed across instances.** When the auditor replayed the chain, it *did* walk to root and computed absolute depth 3 > horizon 2, flagging the transaction. The executor's local check said accept; the auditor's global check said reject. The disagreement was not a bug in either verifier — it was the predictable consequence of two verifiers measuring depth in different frames. ## Condition of Validity The invariant that must hold for a delegated chain to be honored: > For a chain of length `L` (number of delegation hops from the pinned root anchor to the presenting agent), the receiving instance may accept **iff** `L ≤ H_r` **and** for every intermediate hop `i`, the warrant at hop `i` carried an explicit `remaining_depth` field satisfying `remaining_depth_i ≥ L − i`, **and** the presenting agent's own `remaining_depth` (i.e. `remaining_depth_L`) is `≥ 0`. `remaining_depth` must be an **absolute** budget set at the root and decremented at each hop, never re-initialized from the receiver's local view. `H_r` is the receiver's independently configured horizon and is *not* negotiable by the presenter. The two conditions are distinct: `L ≤ H_r` is the receiver's policy bound; the per-hop `remaining_depth` monotonicity is the chain's internal consistency. A chain can satisfy one and violate the other, which is exactly the case above. The condition fails (chain must be rejected) when any of: - `L > H_r` — horizon overflow, even if every signature verifies. - Some hop's `remaining_depth` was reset rather than decremented (detectable by checking `remaining_depth_{i} == remaining_depth_{i-1} − 1` for all `i`). - The presenting agent computed depth relative to itself rather than to the root anchor (detectable only if the chain carries absolute depth; if it does not, the chain is unverifiable and must be rejected as `DepthUnanchored`). ## Decision Boundary The sharp line is between **chains that carry an absolute, root-anchored depth budget** and **chains that carry only per-edge counters**. The former can be verified by any receiver against its own horizon in O(L) with no coordination. The latter are fundamentally unverifiable at the receiver, because the receiver cannot distinguish "depth 1 from a shallow root" from "depth 3 from a deep root" without walking and re-deriving the budget — and if the budget wasn't propagated, walking gives signatures but not a trustworthy depth. Therefore the decision boundary is: - **Accept** only if the chain is root-anchored (absolute `remaining_depth` present at every hop, monotone decrement verified) **and** `L ≤ H_r` **and** `remaining_depth_L ≥ 0` **and** scope is a subset of the parent at every hop. - **Reject with `DepthUnanchored`** if any hop lacks an absolute depth field — do not fall back to local relative counting. Local counting is the defect, not the fallback. - **Reject with `HorizonExceeded`** if `L > H_r` regardless of signature validity. - **Never attenuate-and-forward** a warrant whose `remaining_depth` would drop below 1, because forwarding at `remaining_depth == 0` produces a child that any horizon-1 receiver will accept while being one hop past the root's intent. The subtle part of the boundary: a receiver must *not* treat "the delegator said it was allowed" as evidence. The delegator's authority to delegate is itself bounded by `remaining_depth`, and that bound is only enforceable if it is carried in the token, not asserted in the delegator's prose or its own local state. ## Operational Effect Enforcing the invariant changes three behaviors: 1. **Sub-agents can no longer self-authorize depth.** A spawned sub-executor inherits the *parent's* `remaining_depth − 1`, not a fresh budget. Spawning a child from a warrant at `remaining_depth == 1` is a hard error at spawn time, before the child ever runs. This bounds fan-out depth structurally rather than by convention. 2. **Auditor and executor agree by construction.** Because both compute absolute `L` against the same root anchor, replay verification and live verification produce identical accept/reject decisions. The prior disagreement (executor accept, auditor reject) becomes impossible: the executor's own check now returns `HorizonExceeded` at hop 3. 3. **Horizon is a local policy, not a global constant.** Different instances may set different `H_r` (a sandbox runner might allow 4, a secrets broker only 1). Because depth is absolute, a deep chain rejected by the broker is still validly rejected even though the orchestrator accepted it — there is no "but the root approved it" escape, because the root approved a *budget*, and the broker's horizon is a stricter local bound on that budget. The residual risk: `H_r` must be configured per instance and audited. An instance that sets `H_r` too high silently re-admits the overflow. The guardrail is to pin `H_r ≤ root's max_warrant_depth` at deployment and treat any divergence as a config error surfaced at startup, not at first delegation. ```python from dataclasses import dataclass from typing import Sequence class WarrantDepthError(RuntimeError): """Raised when a delegated AAIF warrant chain violates the depth/horizon invariant.""" @dataclass(frozen=True) class WarrantHop: issuer: str subject: str remaining_depth: int # absolute budget from root, decremented per hop scope: frozenset[str] parent_hash: str | None # None only at the root-minted hop def verify_delegated_chain( chain: Sequence[WarrantHop], trust_horizon: int, root_anchor: str, ) -> None: """Accept a chain only if root-anchored depth is monotone and within horizon. Raises WarrantDepthError on any violation. Returns None on success. """ if not chain: raise WarrantDepthError("empty chain: no warrant to verify") # 1. Every hop must carry an absolute, root-anchored depth field. for i, hop in enumerate(chain): if hop.remaining_depth is None: raise WarrantDepthError( f"hop {i} ({hop.issuer}->{hop.subject}): DepthUnanchored — " "no absolute remaining_depth; relative counting is forbidden" ) # 2. Root hop must be bound to a pinned anchor. if chain[0].issuer != root_anchor: raise WarrantDepthError( f"root issuer {chain[0].issuer!r} is not the pinned anchor {root_anchor!r}" ) if chain[0].parent_hash is not None: raise WarrantDepthError("root hop must have parent_hash=None") # 3. Depth must decrement by exactly 1 per hop (no resets, no skips). for i in range(1, len(chain)): prev, cur = chain[i - 1], chain[i] if cur.remaining_depth != prev.remaining_depth - 1: raise WarrantDepthError( f"hop {i}: remaining_depth {cur.remaining_depth} != " f"{prev.remaining_depth - 1} — budget was re-initialized, not decremented" ) if cur.parent_hash is None: raise WarrantDepthError(f"hop {i}: non-root hop missing parent_hash") # 4. Absolute length must not exceed the receiver's local trust horizon. length = len(chain) if length > trust_horizon: raise WarrantDepthError( f"HorizonExceeded: chain length {length} > trust horizon {trust_horizon}" ) # 5. Presenting agent's own budget must be non-negative. if chain[-1].remaining_depth < 0: raise WarrantDepthError( f"presenting agent budget {chain[-1].remaining_depth} < 0" ) # 6. Scope must be a subset of parent at every hop. for i in range(1, len(chain)): if not chain[i].scope.issubset(chain[i - 1].scope): raise WarrantDepthError( f"hop {i}: scope {set(chain[i].scope)} not subset of parent " f"{set(chain[i - 1].scope)}" ) def attenuate_and_forward( inbound: WarrantHop, next_subject: str, next_scope: frozenset[str], child_hash: str, ) -> WarrantHop: """Create a child hop. Refuses to forward at remaining_depth <= 1.""" if inbound.remaining_depth <= 1: raise WarrantDepthError( f"cannot delegate from {inbound.subject}: remaining_depth " f"{inbound.remaining_depth} would leave child at " f"{inbound.remaining_depth - 1} (must be >= 1)" ) if not next_scope.issubset(inbound.scope): raise WarrantDepthError( f"attenuation widened scope: {set(next_scope)} not subset of " f"{set(inbound.scope)}" ) return WarrantHop( issuer=inbound.subject, subject=next_subject, remaining_depth=inbound.remaining_depth - 1, scope=next_scope, parent_hash=child_hash, ) ```