# When must an instance reject a delegated capability token whose delegation chain is length-valid but warrant-non-monotonic **Date of Record:** 2026 November 23 **Scope:** Applies to AAIF runtimes that authorize tool calls via chained delegated capability tokens (agent A → agent B → agent C) carrying embedded warrants (allowed-action sets, resource globs, spend ceilings, expiry). Does not cover single-hop root tokens or bearer credentials without delegation chains. ## Core Distinction The failure mode this record isolates is not token forgery, signature failure, or expired credentials. It is **warrant non-monotonicity across a structurally valid delegation chain**: a chain where every link verifies cryptographically, every `sub`/`aud`/`iss` triple matches, every expiry is strictly decreasing, and every delegation depth is within the configured maximum — yet the *effective warrant set of a downstream link is not a subset of its delegator's warrant set*. AAIF verifiers commonly enforce two things independently: (1) chain integrity (signatures, issuer binding, depth, expiry monotonicity) and (2) warrant containment checked only at the *final* hop against the *root* grant. The gap is the **intermediate hop**. A middle agent can mint a child token that widens scope relative to its own token (e.g., adding `fs:write:/etc` when it only held `fs:read:/etc`) while remaining a strict subset of the root grant. The final-hop check passes because the leaf is still inside the root. The intermediate escalation is invisible. This is not a "confused deputy" in the classical sense — the deputy is not tricked by an attacker-controlled resource. The deputy *itself* widens its own authority and the chain validator's subset check is evaluated against the wrong reference set. ## What Was Observed A three-agent pipeline: `planner` (root warrant: `{tool:search, tool:read, fs:read:/data/**, spend<=0}`) delegates to `executor` with `{tool:search, tool:read, fs:read:/data/reports/**, spend<=0}`. The executor's LLM, mid-task, decides it needs to persist a scratch file and calls `mint_delegation` to issue a token to `writer` with warrant `{tool:search, tool:read, tool:write, fs:read:/data/reports/**, fs:write:/tmp/**, spend<=0}`. The mint call succeeded. The verifier accepted it because: - Signatures on all three links valid. - Depth 3 ≤ `max_depth=4`. - Expiry: root `T+3600` > executor `T+1800` > writer `T+900`. Monotonic. - `iss`/`aud` binding correct on each hop. - **Final-hop containment check**: `writer.warrant ⊆ root.warrant`? The check compared only the *tool* dimension and the *fs:read* dimension. `tool:write` and `fs:write:/tmp/**` were not present in the root grant, but the containment predicate was implemented as `for k in leaf: assert leaf[k] ⊆ root.get(k, EMPTY)` — and for dimensions absent in root, `root.get(k, EMPTY)` returned an empty set, and the subset test `{write} ⊆ {}` **should** have failed. It did not, because the comparison normalized `tool:write` and `tool:read` into a single `tool` set on the root (`{search, read}`) but kept the leaf's `tool` set as `{search, read, write}`, and the subset operator was applied to a *list* of tool names after a `set()` cast that silently dropped the `write` element due to a schema-version mismatch: the leaf token declared `warrant_schema: "aaif-warrant/2"` (sets) while the root declared `"aaif-warrant/1"` (ordered lists with `max` semantics). The validator coerced v2→v1 by truncating to the v1 `max` count, discarding the extra element before the subset test. The escalation was caught only when the `writer` agent attempted `fs:write:/tmp/scratch.json` and the *tool-level* policy engine (a separate, non-AAIF check) rejected it because the root principal lacked `fs:write` at the OS layer. The AAIF layer had already authorized the call. ## Condition of Validity The invariant that must hold, and that this incident violated, is: > For every delegation edge `(parent, child)` in a chain, and for every warrant dimension `d`, `effective(child, d) ⊆ effective(parent, d)`, where `effective` is computed under a *single, explicit, versioned* normalization — not under per-link coercion. The failure requires three co-occurring conditions: 1. **Heterogeneous warrant schema versions** across the chain (v1 list-with-max vs v2 set semantics). This is the trigger. 2. **A coercion step that is lossy but not flagged** — truncation to `max` count, or set-union collapse, or glob-prefix widening (`/data/reports/**` normalized to `/data/**` on one side only). 3. **Containment checked against the root rather than against the immediate parent**, or checked per-dimension with a default that treats "absent in parent" as "unconstrained" rather than "empty." Remove any one and the escalation does not occur. If all links share a schema version, no coercion. If coercion is lossy-but-flagged (raises), the mint fails closed. If containment is checked parent-to-child, the executor's own token lacks `tool:write`, so the child mint is rejected at hop 2. ## Decision Boundary An AAIF verifier must **reject** a delegated token at validation time when: - The chain contains more than one distinct `warrant_schema` version, **and** the runtime cannot prove a total, order-preserving, non-widening normalization between them; OR - Any per-edge containment check is evaluated against a reference other than the immediate parent's *effective* warrant; OR - A warrant dimension present in the child is absent in the parent and the containment predicate's default for absent-parent is not the empty set. It must **accept** only when normalization is total and non-widening (proven by a schema-pair compatibility table, not inferred), containment is checked edge-by-edge against the immediate parent, and absent-parent dimensions default to empty (deny). The boundary is sharp: the moment a chain mixes schema versions without a proven non-widening normalizer, the chain is unverifiable regardless of how clean the signatures look. Depth and expiry monotonicity are necessary but not sufficient. ## Operational Effect Downstream of this boundary, two behaviors change: 1. **Mint-time vs verify-time asymmetry.** The `mint_delegation` call and the `verify_chain` call must share the *same* normalization function object, not two implementations that "should" agree. In the incident they diverged: mint used v2 semantics (kept `write`), verify used v1 coercion (dropped it). The token was internally consistent under mint and lossy under verify. Fix: normalize once at mint, embed the normalized effective warrant in the token as a signed `eff_warrant` claim, and have verify check `eff_warrant(child) ⊆ eff_warrant(parent)` with no further coercion. 2. **Fail-closed on schema skew.** Any chain with mixed `warrant_schema` versions and no registered normalizer must raise at verify, not degrade. Degradation is what let the escalation through. The residual risk after the fix is a *widening normalizer* — a v2→v1 coercion that maps `{search, read, write}` to `{search, read, write}` under v1 `max=3` when the root only had `max=2`. This is caught only if the root's `max` is preserved as a hard ceiling during normalization. The guardrail is: normalization may never increase cardinality or widen a glob; it may only truncate or reject, and truncation must be recorded in a signed `normalization_audit` field so a replay can detect that a dimension was dropped. ```python from dataclasses import dataclass, field from typing import FrozenSet, Mapping class WarrantNonMonotonicError(RuntimeError): """Raised when a delegated token's effective warrant is not a subset of its parent's.""" @dataclass(frozen=True) class Warrant: schema: str tools: FrozenSet[str] fs_globs: FrozenSet[str] spend_ceiling: int # Proven non-widening normalizers. Absence of a pair => unverifiable chain. _NORMALIZERS: Mapping[tuple, callable] = { ("aaif-warrant/2", "aaif-warrant/1"): lambda w: Warrant( schema="aaif-warrant/1", tools=frozenset(t for t in w.tools if t in {"search", "read"}), # truncate, never add fs_globs=frozenset(g for g in w.fs_globs if g.startswith("/data/")), spend_ceiling=w.spend_ceiling, ), } def _normalize(child: Warrant, parent: Warrant) -> Warrant: if child.schema == parent.schema: return child key = (child.schema, parent.schema) if key not in _NORMALIZERS: raise WarrantNonMonotonicError( f"no proven non-widening normalizer for {key}; chain unverifiable" ) normalized = _NORMALIZERS[key](child) if len(normalized.tools) > len(child.tools) or len(normalized.fs_globs) > len(child.fs_globs): raise WarrantNonMonotonicError(f"normalizer widened warrant under {key}") return normalized def verify_edge(parent: Warrant, child: Warrant) -> None: eff_child = _normalize(child, parent) if not eff_child.tools <= parent.tools: raise WarrantNonMonotonicError( f"tool escalation: {eff_child.tools - parent.tools} not in parent" ) if not eff_child.fs_globs <= parent.fs_globs: raise WarrantNonMonotonicError( f"fs escalation: {eff_child.fs_globs - parent.fs_globs} not in parent" ) if eff_child.spend_ceiling > parent.spend_ceiling: raise WarrantNonMonotonicError( f"spend escalation: {eff_child.spend_ceiling} > {parent.spend_ceiling}" ) def verify_chain(chain: list[Warrant]) -> None: for parent, child in zip(chain, chain[1:]): verify_edge(parent, child) ```