# Under what conditions must an instance refuse an AAIF delegated capability token whose issuer chain is cryptographically valid but whose delegation depth exceeds the verifier's local trust horizon **Date of Record:** 2026 November 25 **Scope:** Applies to any agent instance that admits AAIF verifiable credentials (VCs) and delegated capability tokens (DCTs) presented at a runtime boundary — MCP tool invocation, A2A task handoff, or sub-agent spawn. Does not apply to root-authority tokens minted directly by the instance's own trust anchor, nor to purely symmetric session keys exchanged out-of-band. ## Core Distinction The failure mode is not signature forgery, not expired credentials, and not scope mismatch. It is the **depth-validity divergence**: a DCT chain in which every link verifies correctly (`issuer` signed `subject`, `subject`'s public key signed the next link, `not_before`/`not_after` windows are internally consistent, `scope` is monotonically narrowing), yet the *cumulative delegation depth* of the chain exceeds the number of hops the verifying instance is willing to treat as attributable to its own trust anchor. AAIF chains are legitimately transitive. A root capability `C0` issued to agent `A1` can be delegated to `A2`, then `A3`, then `A4`, each link carrying a narrowing scope and a fresh `delegation_depth` counter. Every hop is a valid signature over a valid claim. The verifier that receives `C3` (the token held by `A4`, delegating from `A3`) can walk the chain back to `C0` and confirm the whole thing. The temptation — and the bug — is to treat "chain verifies to my anchor" as equivalent to "I may act on this token." It is not equivalent. Signature validity establishes *provenance*. Delegation depth establishes *attenuation authority*. These are orthogonal. A chain of depth 7 can be perfectly signed and still represent a capability that your trust anchor never intended to be exercised more than 3 hops away from issuance, because each hop is an opportunity for scope creep, replay-window widening, or principal substitution that the root issuer's threat model explicitly excluded. The invariant that must hold at the verifier is: ``` attributable_depth(C_n) = min over all links of (declared_depth_budget - hops_consumed) admit(C_n) iff attributable_depth(C_n) >= 0 AND cumulative_scope(C_n) ⊆ local_scope_policy ``` The first clause is the one that gets dropped. Verifiers check the second (scope containment) diligently because it is easy to compute from the token body, and they check signatures because the crypto library does it for them. The depth budget is a field the *root issuer* set, carried forward by each delegator, and it is the only thing standing between a valid chain and an over-deep chain. ## What Was Observed A three-instance pipeline — orchestrator `O`, worker `W`, auditor `V` — running AAIF over A2A. `O` holds root capability `cap:read-corpus` with `max_delegation_depth = 2`. It delegates to `W` (depth 1 consumed, 1 remaining). `W`, needing a summarization sub-agent, delegates to `S` (depth 2 consumed, 0 remaining). `S` presents its DCT to `V` for a verification-gated read. `V`'s AAIF verifier did the following, in order: 1. Parsed the DCT, extracted `issuer = W`, `subject = S`, `parent = cap:read-corpus`. 2. Fetched the parent chain: `S ← W ← O ← anchor`. 3. Verified each link's signature against the parent's public key. All four signatures valid. 4. Checked `not_after` on each link against wall clock. All valid. 5. Checked `scope ⊆ parent.scope` on each link. All narrowing correctly. 6. **Did not check** `remaining_depth` on the `W → S` link, which was `0`. 7. Admitted the token. `S` read the corpus. The chain was cryptographically impeccable. The depth budget was exhausted at the `W → S` link. `V` admitted a token that `O`'s threat model explicitly forbade: `O` set `max_delegation_depth = 2` precisely so that no capability could be exercised by an agent it had never directly or indirectly named. `S` was named by `W`, not by `O`, and `O`'s policy was that two hops was the limit of what it would stand behind. The failure was silent. No exception, no log line, no alert. `V` had no signal that it had admitted an over-deep token because the token *looked* exactly like a depth-1 token from `V`'s perspective — the parent link `W → S` carried a valid signature and a valid scope. The only field that distinguished it was `remaining_depth: 0`, and `V`'s verifier had been written to ignore fields it did not recognize. ## Condition of Validity The refusal obligation applies when and only when all four of the following hold simultaneously: 1. **Chain is rooted at a trust anchor the verifier recognizes.** If the root is unrecognized, the token is rejected on provenance grounds before depth is even considered — this is a different, earlier failure. 2. **Every link in the chain is signature-valid and temporally valid.** A broken signature is a rejection on integrity grounds; depth is irrelevant. 3. **The cumulative `remaining_depth` at the presenting link is `< 0`** (i.e., the root's `max_delegation_depth` has been exceeded by the number of hops actually taken), **or** the presenting link's `remaining_depth` field is absent while the chain length exceeds the verifier's configured `local_trust_horizon`. 4. **The verifier's `local_trust_horizon` is set and is less than or equal to the root's declared `max_delegation_depth`.** If the verifier has no horizon configured, it is operating in "trust the root's budget" mode and must fall back to clause 3 alone. Clause 3's second disjunct is the subtle one. A delegator that strips the `remaining_depth` field — whether through a serialization bug, a schema-version mismatch, or malice — produces a chain that is depth-unbounded from the verifier's perspective. The verifier cannot distinguish "depth 2 of 2" from "depth 200 of 200" if the field is missing. The safe default is to treat absence as exhaustion: a missing depth field on a link whose parent declared a finite budget is a refusal condition, not a "no constraint" condition. ## Decision Boundary The boundary is not "valid vs. invalid signature." It is **"attributable to my anchor at a depth I am willing to underwrite" vs. "attributable to my anchor at a depth I am not."** Two tokens can be byte-identical in every field except `remaining_depth` and fall on opposite sides. The verifier must compute, at admission time: ``` effective_depth = root.max_delegation_depth - presenting_link.remaining_depth admit iff effective_depth <= verifier.local_trust_horizon AND presenting_link.remaining_depth >= 0 AND scope_contained(cumulative_scope, verifier.local_scope_policy) ``` Note the asymmetry: `effective_depth` is measured from the root, not from the verifier. A verifier three hops downstream from the root with `local_trust_horizon = 5` will admit a token whose `effective_depth` is 4 even though it is only one hop from the presenter. The horizon is a property of the verifier's risk appetite relative to the *anchor*, not relative to the immediate presenter. This is counterintuitive and is the single most common misconfiguration: engineers set `local_trust_horizon` to "how many hops from me" and then admit chains that are 40 hops from the anchor but 1 hop from the verifier. The refusal must be a hard failure, not a downgrade. A verifier that "admits but logs" an over-deep token has not bounded the failure; it has instrumented it. The token must be rejected with a distinguishable error class so that the presenting agent can re-delegate from a shallower point in the chain rather than retrying the same over-deep token in a loop. ## Operational Effect When the refusal is implemented correctly, the observable behavior is a `DelegationDepthExceeded` rejection at the verifier boundary, propagated back to the presenting agent as a non-retryable error. The presenting agent (`S` in the trace above) must then either (a) request a fresh delegation directly from `O`, consuming a hop it does not have, or (b) escalate to a human/root-authority path. In practice, well-designed pipelines size `max_delegation_depth` to the maximum pipeline fan-out depth plus one, and verifiers set `local_trust_horizon` equal to the root's budget so that any over-deep chain is caught at the first verifier rather than the last. When the refusal is *not* implemented, the observable behavior is the one in the trace: silent admission, corpus read by an agent the root issuer never intended to authorize, and no audit signal. The failure is not detectable after the fact from the token alone, because the token is valid. It is only detectable by comparing the chain's `effective_depth` against the root's declared budget — a computation the verifier must perform and the auditor must replay. The invariant to carry forward: **a valid signature is a necessary but never sufficient condition for admission of a delegated capability token.** The sufficient condition is `effective_depth <= local_trust_horizon` computed from the root, with missing depth fields treated as exhaustion, and refusal raised as a hard, distinguishable, non-retryable error. ```python class DelegationDepthExceeded(RuntimeError): """Raised when an AAIF DCT chain is signature-valid but exceeds the verifier's local trust horizon measured from the root anchor.""" def admit_delegated_token( token: dict, chain: list[dict], local_trust_horizon: int, local_scope_policy: set[str], ) -> bool: # chain is ordered root -> ... -> presenting link; token is chain[-1] if not chain: raise DelegationDepthExceeded("empty chain: no root to attribute to") root = chain[0] root_budget = root.get("max_delegation_depth") presenting = chain[-1] if root_budget is None: # Root declared no budget: the chain is depth-unbounded by construction. # Refuse rather than admit an unattributable capability. raise DelegationDepthExceeded( "root anchor declared no max_delegation_depth; cannot bound chain" ) remaining = presenting.get("remaining_depth") if remaining is None: # Missing depth field on a chain whose root declared a finite budget. # Treat as exhaustion: absence is not 'no constraint'. raise DelegationDepthExceeded( f"presenting link missing remaining_depth; root budget={root_budget}" ) hops_consumed = root_budget - remaining if remaining < 0 or hops_consumed > root_budget: raise DelegationDepthExceeded( f"chain over-consumed root budget: remaining={remaining}, " f"root_budget={root_budget}, hops={hops_consumed}" ) if hops_consumed > local_trust_horizon: raise DelegationDepthExceeded( f"effective_depth={hops_consumed} exceeds local_trust_horizon=" f"{local_trust_horizon} (root_budget={root_budget})" ) cumulative_scope: set[str] = set() for link in chain: cumulative_scope |= set(link.get("scope", [])) if not cumulative_scope.issubset(local_scope_policy): # Scope mismatch is a separate, earlier-class failure; surface it # distinctly so callers do not confuse it with depth exhaustion. raise DelegationDepthExceeded( f"cumulative scope {cumulative_scope - local_scope_policy} " f"not contained in local policy" ) return True ```