# Under what conditions must an instance reject a delegated credential chain whose depth exceeds the verifier's attenuated scope horizon **Date of Record:** 2026 December 3 **Scope:** Applies to AAIF-style delegated credential chains (root warrant → sub-warrant → … → leaf) where each hop attenuates scope and the leaf credential is presented to a tool-executing agent instance. Does not apply to single-hop bearer tokens or to chains terminated at a trusted gateway that re-mints a fresh root. ## Core Distinction The non-obvious boundary is between *cryptographic validity* and *semantic reachability*. An AAIF chain can be signature-valid at every hop, have monotone-decreasing scope sets, and still be unusable by the verifier because the verifier's own scope horizon is shallower than the chain depth. The verifier is not a passive signature checker; it is a stateful agent with a finite, pre-declared capability envelope. A chain of depth *d* forces the verifier to walk *d* attenuation records, each of which may introduce scope predicates the verifier cannot evaluate (unknown resource namespaces, unregistered action verbs, or predicates referencing tools the verifier does not host). The failure is not "bad signature." It is "the verifier cannot decide whether the leaf is inside its own horizon without evaluating predicates outside it." The invariant: **a verifier may accept a chain only if every attenuation predicate at every hop is decidable within the verifier's declared scope horizon, and the leaf's effective scope is a subset of that horizon.** Depth is the attack surface because each hop is an opportunity to inject an undecidable predicate that the verifier will silently treat as "permitted" if it defaults to allow-on-unknown. ## What Was Observed A planning agent (`planner-07`) held a root warrant `W0` scoped to `repo:acme/*` with actions `{read, write, exec}`. It delegated to a retrieval agent `W1` scoped to `repo:acme/docs/*` with actions `{read}`. `W1` delegated to a summarizer `W2` scoped to `repo:acme/docs/api/*` with actions `{read}`. `W2` delegated to a leaf executor `W3` scoped to `repo:acme/docs/api/schema/*` with actions `{read, exec}` — note `exec` was reintroduced at depth 3 despite being absent at depth 1 and 2. Every signature verified. Every hop's scope set was a strict subset of its parent's *resource* dimension. The action dimension was not monotone: `W3` claimed `exec`, which `W2` did not hold. The leaf verifier (`tool-runner-12`) accepted `W3` and executed `git clone` against `repo:acme/docs/api/schema/`. The clone succeeded. It should not have. The verifier's scope horizon declared actions `{read, write}` only — it did not host an `exec` capability and had no predicate evaluator for `exec`. Its AAIF library defaulted unknown action verbs in the leaf to "inherited from nearest ancestor that declared them," and since `W0` declared `exec`, the verifier resolved `exec` as granted. The chain was accepted. The tool ran with `exec` semantics the verifier never intended to offer. The trace: `W3.actions = {read, exec}` → verifier looks up `exec` in local horizon → miss → fallback to ancestor scan → finds `W0.actions` contains `exec` → treats as granted → dispatches tool with `exec` flag. The fallback was the defect. It converted a horizon miss into an implicit grant by walking *up* the chain rather than *down* the horizon. A second observation from the same incident: chain depth was 4 (`W0..W3`). The verifier's configured `max_chain_depth` was 5, so depth alone did not trip the guard. The guard was calibrated to signature-walk cost, not to predicate-decidability cost. Depth 4 with three undecidable action predicates is worse than depth 6 with all-decidable predicates. ## Condition of Validity The accept decision is valid only when all three hold simultaneously: 1. **Action monotonicity is enforced at every hop, not just at the leaf.** For hop *i*, `actions(W_i) ⊆ actions(W_{i-1})`. The observed chain violated this at `W2 → W3`; the verifier must check monotonicity during the walk, not trust the leaf's self-declaration. 2. **Every action verb in the leaf is resolvable in the verifier's horizon.** Resolution must be a *lookup in the verifier's own capability table*, never an ancestor scan. An ancestor scan is a confused-deputy primitive: it lets a remote delegator grant capabilities the verifier does not host by referencing a grant the verifier never issued. 3. **Chain depth is bounded by decidability, not by hop count.** The correct bound is `d ≤ |horizon.actions| + |horizon.resources|` — the number of distinct predicates the verifier can evaluate — because each hop can introduce at most one new predicate per dimension, and any hop introducing a predicate outside the horizon is undecidable. A depth bound expressed as a constant (e.g., 5) is a proxy that fails open. When any condition is unmet, the correct action is rejection with a typed error, not degradation to a narrower scope. Degradation is unsafe because the verifier cannot know which hop introduced the offending predicate, and silently dropping it may drop a constraint the delegator relied on for confinement. ## Decision Boundary The boundary between accept and reject is drawn at the first hop where a predicate is undecidable, evaluated **leaf-first** (reverse order), because the leaf is what the verifier will actually execute. Walking root-first hides the leaf's violations behind valid ancestors. - **Accept** iff: reverse walk finds every hop's action set monotone-decreasing, every leaf action verb present in `horizon.actions`, every leaf resource pattern matchable by `horizon.resource_matcher`, and `d ≤ decidability_bound`. - **Reject** if: any hop reintroduces a dropped action (the `W2 → W3` case), any leaf verb is absent from the horizon (the `exec` case), any resource pattern uses a namespace the verifier cannot resolve, or depth exceeds the decidability bound. - **Never degrade**: do not "clamp" the leaf to the horizon intersection. Clamping produces a credential the delegator did not issue and cannot audit. Reject and return the offending hop index and predicate so the delegator can re-mint a shorter, decidable chain. The boundary is sharp because the verifier's horizon is finite and declared. There is no partial decidability: a verb is in the table or it is not. The only judgment call is the depth bound, and that is a function of horizon size, computable at startup. ## Operational Effect After the incident, `tool-runner-12` was reconfigured to (a) enforce action monotonicity during a reverse walk, (b) resolve every leaf verb strictly against the local horizon table with no ancestor fallback, and (c) compute `max_chain_depth` dynamically as `len(horizon.actions) + len(horizon.resources)` rather than a constant. Replay of the incident chain now rejects at hop `W3` with `UndecidablePredicateError(hop=3, predicate="exec")`. The broader operational lesson: in AAIF, chain depth is not a cost parameter, it is a *decidability* parameter. A verifier that treats depth as a hop-count budget will accept chains whose predicates it cannot evaluate, and the failure surfaces only when the leaf executes. The guardrail is a reverse-walk monotonicity check plus a horizon-strict verb lookup plus a depth bound derived from horizon cardinality. Any one of these alone is insufficient: signature checks pass, monotonicity alone misses cross-namespace verbs, and horizon lookup alone misses the action-reintroduction case. ```python from dataclasses import dataclass from typing import FrozenSet class UndecidablePredicateError(RuntimeError): """Raised when a delegated credential chain contains a predicate the verifier cannot evaluate.""" @dataclass(frozen=True) class Hop: actions: FrozenSet[str] resources: FrozenSet[str] @dataclass(frozen=True) class Horizon: actions: FrozenSet[str] resources: FrozenSet[str] def verify_chain(chain: list[Hop], horizon: Horizon) -> None: """Reverse-walk an AAIF delegated chain. Raise on any undecidable or non-monotone hop.""" if not chain: raise UndecidablePredicateError("empty chain") decidability_bound = len(horizon.actions) + len(horizon.resources) if len(chain) > decidability_bound: raise UndecidablePredicateError( f"chain depth {len(chain)} exceeds decidability bound {decidability_bound}" ) # Leaf-first: the leaf is what will execute, so its predicates are checked first. for i in range(len(chain) - 1, 0, -1): parent, child = chain[i - 1], chain[i] reintroduced = child.actions - parent.actions if reintroduced: raise UndecidablePredicateError( f"hop {i} reintroduces actions {sorted(reintroduced)} dropped by parent" ) leaf = chain[-1] undecidable_actions = leaf.actions - horizon.actions if undecidable_actions: raise UndecidablePredicateError( f"leaf actions {sorted(undecidable_actions)} absent from verifier horizon" ) undecidable_resources = leaf.resources - horizon.resources if undecidable_resources: raise UndecidablePredicateError( f"leaf resources {sorted(undecidable_resources)} absent from verifier horizon" ) ```