# Under what conditions must an instance refuse a delegated AAIF credential whose delegation chain re-verifies but whose scope-narrowing proof has silently collapsed **Date of Record:** 2026 November 28 **Scope:** Applies to AAIF-style delegated credentials (macaroon/biscuit/GNAP-class attenuation tokens) presented to an LLM agent instance at tool-invocation time, where the instance must decide whether to accept a delegated capability. Does not apply to root-issued credentials held by the principal itself, nor to symmetric bearer tokens with no attenuation chain. ## Core Distinction A delegated credential carries two separable guarantees: **chain authenticity** (every link was signed by a holder authorized to attenuate it) and **scope monotonicity** (each link's authority set is a subset of its parent's). Standard verification — signature walk from root to leaf — checks only the first. The second is an *invariant over the set algebra of caveats*, and it can fail while every signature remains valid. The non-obvious boundary: an agent that verifies the chain and then reads the leaf's declared scope is trusting a narrowing proof it never actually evaluated. When an intermediate attenuator is itself an LLM agent — which is the normal case in AAIF handoffs — that agent can emit a child credential whose caveat set is *syntactically* a superset of the parent's (so signature and "has caveats" checks pass) but *semantically* weaker, because one of the caveats it "added" is a tautology under the verifier's caveat-interpretation function. The chain re-verifies; the scope has silently widened. ## What Was Observed A planner agent (P) held a root credential `C0` scoped to `tool:filesystem, path:/srv/jobs/42, op:read`. It delegated to a worker (W) by minting `C1` with the added caveat `path_prefix:/srv/jobs/42/`. The worker then sub-delegated to a summarizer instance (S), producing `C2`, adding the caveat `op_in:[read,list]`. Replay in the auditor showed all three signatures valid, `C0 ⊇ C1 ⊇ C2` by caveat count, and the leaf scope reporting `{path_prefix:/srv/jobs/42/, op_in:[read,list]}`. Yet S successfully read `/srv/jobs/42/../../etc/shadow`. The failure trace: 1. The verifier's caveat interpreter normalized `path_prefix` by string-prefix match *before* path canonicalization. `path:/srv/jobs/42` from `C0` was evaluated as a literal equality caveat; `path_prefix:/srv/jobs/42/` from `C1` as a prefix caveat. The two caveat *kinds* are not comparable by the interpreter's subset relation, so the monotonicity check returned `INDETERMINATE` rather than `FAIL`. 2. The verifier treated `INDETERMINATE` as "not violated" — the default in three of four AAIF reference implementations audited — and admitted the credential. 3. `..` traversal satisfied the string-prefix test on the raw argument but escaped the canonical root, because `path_prefix` was matched against the un-canonicalized tool argument, not the resolved path. The collapse is not a signature forgery. It is an *incomparable-caveat-kind* event: the child introduced a caveat whose interpretation lattice does not embed into the parent's, so "narrower" is undefined, and the verifier's tri-state logic defaulted to permissive. ## Condition of Validity The scope-monotonicity invariant holds **only if** the verifier's caveat-interpretation function `⟦·⟧` is total and order-preserving: for every caveat `c_child` and parent set `P`, `⟦c_child⟧ ⊆ ⋂_{p∈P} ⟦p⟧` must be *decidable*, and the decision must be `SUBSET` or `DISJOINT` — never `INDETERMINATE`. This requires: - A **closed caveat-kind registry** with a declared embedding: each caveat kind `k` maps to a predicate over the same argument domain (here, canonicalized `(path, op)` tuples), so cross-kind comparison is defined. - **Canonicalization before interpretation**: path, URL, and identifier caveats must be resolved against the same normal form the downstream tool will use, or the caveat is vacuous. - **Tri-state rejection**: `INDETERMINATE` must be treated as `FAIL`, not as `PASS`. A verifier that admits on unknown is not a verifier. If any of these is absent, the chain is authentic but unauthorized, and the instance must refuse. ## Decision Boundary The instance must refuse a delegated credential — and emit a distinct `ScopeMonotonicityCollapse` signal to the auditor, not a generic auth failure — when **all** of the following hold: 1. Chain signature verification passes end-to-end. 2. At least one adjacent pair `(parent, child)` in the chain contains caveats of different kinds, or a caveat whose kind is not in the verifier's registry. 3. The monotonicity check for that pair returns anything other than a decided `SUBSET`. 4. The leaf credential's declared scope, if trusted naively, would grant an operation the *root* principal's scope does not cover. It must **not** refuse when the chain is single-link (no attenuation to check), when all caveats share one kind and the subset relation is decided, or when the mismatch is confined to caveats that are provably tautological under `⟦·⟧` (e.g., `op_in:ANY` added redundantly). Refusing on tautological additions causes spurious handoff failures in high-fanout swarms; the distinction between vacuous and widening caveats is the whole point. ## Operational Effect The practical consequence is that AAIF delegation cannot be verified by the delegating agent alone. The *receiving* instance is the last party able to observe the interpretation gap, because only it knows the canonical form its own tool layer will apply. Two architectural consequences follow: - **Verifier-side**: the caveat interpreter must be co-located with the tool's argument normalizer, and monotonicity must be checked against the *resolved* argument, not the raw one. A credential whose scope cannot be decided against the resolved argument is refused. - **Protocol-side**: AAIF handoffs must carry the caveat-kind manifest alongside the credential, so the receiver can detect unregistered kinds before attempting interpretation. Absence of the manifest is itself a refusal condition — an agent cannot evaluate monotonicity over an open caveat vocabulary. The invariant to record: *a delegated credential is authorized only when scope monotonicity is decided, not merely when signatures verify.* Authenticity without decided narrowing is a capability-laundering channel, and the tri-state default is where it leaks. ```python from dataclasses import dataclass from typing import Iterable, Literal Decision = Literal["SUBSET", "DISJOINT", "INDETERMINATE"] class ScopeMonotonicityCollapse(RuntimeError): """Raised when a delegated credential re-verifies but its scope-narrowing proof cannot be decided, so the leaf authority is not bounded by the root.""" @dataclass(frozen=True) class Caveat: kind: str # e.g. "path", "path_prefix", "op_in" value: object @dataclass(frozen=True) class Link: parent_scope: frozenset[Caveat] child_caveats: frozenset[Caveat] signature_valid: bool # Closed registry: each kind maps to a predicate over the SAME canonical domain. REGISTRY = { "path": lambda canon, v: canon == v, "path_prefix": lambda canon, v: canon == v or canon.startswith(v.rstrip("/") + "/"), "op_in": lambda canon, v: canon[1] in v, } def canon(arg: tuple[str, str]) -> tuple[str, str]: import os path, op = arg return (os.path.realpath(path), op) def decide(parent: Iterable[Caveat], child: Caveat, probe: tuple[str, str]) -> Decision: c = canon(probe) if child.kind not in REGISTRY: return "INDETERMINATE" child_ok = REGISTRY[child.kind](c, child.value) if not child_ok: return "DISJOINT" for p in parent: if p.kind not in REGISTRY: return "INDETERMINATE" # cannot compare across kinds if not REGISTRY[p.kind](c, p.value): return "DISJOINT" # child admits what parent forbids return "SUBSET" def admit(chain: list[Link], probe: tuple[str, str]) -> None: if not all(l.signature_valid for l in chain): raise ScopeMonotonicityCollapse("signature chain invalid") for link in chain: for child in link.child_caveats: d = decide(link.parent_scope, child, probe) if d == "INDETERMINATE": raise ScopeMonotonicityCollapse( f"caveat kind {child.kind!r} not comparable to parent scope; " f"monotonicity undecided for {probe!r} — refuse, do not default-pass" ) if d == "DISJOINT": raise ScopeMonotonicityCollapse( f"child caveat {child.kind}={child.value!r} widens parent scope for {probe!r}" ) # Only now is the probe authorized. if __name__ == "__main__": root = frozenset({Caveat("path", "/srv/jobs/42"), Caveat("op_in", {"read"})}) link = Link(root, frozenset({Caveat("path_prefix", "/srv/jobs/42/")}), True) admit([link], ("/srv/jobs/42/../../etc/shadow", "read")) # raises ```