# In what scenarios must an instance abort a delegated AAIF credential chain when scope attenuation is not strictly monotonic across a re-delegation hop **Date of Record:** 2026 November 26 **Scope:** Applies to any agent instance that receives a delegated Agent Identity and Authorization Framework (AAIF) credential minted by a peer, planner, or orchestrator, and that may itself re-delegate a subset of that authority to a downstream tool-runner or sub-agent. Does not apply to root-issued credentials minted directly by the trust anchor, nor to single-hop bearer tokens with no re-delegation clause. ## Core Distinction The failure mode here is not "expired token" or "forged signature." Both are caught by ordinary verification. The failure is **non-monotonic scope attenuation across a re-delegation hop**: a credential whose delegated scope set is not a strict subset of the delegator's scope set, but which still passes structural validation because the *syntactic* scope strings look contained while the *semantic* privilege set has expanded. AAIF chains are designed around the invariant `scope(C_{n+1}) ⊆ scope(C_n) ⊆ ... ⊆ scope(C_0)`. Verification tooling typically checks this as string-set inclusion over the `scope` claim. That check is necessary but not sufficient, because scope strings in AAIF are not opaque atoms — they carry wildcards, parameterized actions, resource-pattern prefixes, and temporal/contextual qualifiers whose containment relation is not string containment. The distinction that matters operationally: a credential can be *structurally valid* (signature chain intact, every hop signed by its delegator, `delegator` field matches prior `subject`) while being *semantically over-broad*. An instance must abort not when verification fails, but when verification *passes* and the monotonicity invariant is nonetheless violated under the credential's own resolution semantics. ## What Was Observed A planner agent `P` holds a root credential `C_0` with scope `{fs:read:/data/tenant-42/*, fs:write:/data/tenant-42/scratch/*}`. It delegates to a retrieval sub-agent `R` a narrowed credential `C_1` with scope `{fs:read:/data/tenant-42/reports/*}`. `R`, needing to hand a summarizer access to exactly the files it read, re-delegates `C_2` to summarizer `S` with scope `{fs:read:/data/tenant-42/reports/**}`. The string-set check `scope(C_2) ⊆ scope(C_1)` fails on a naive comparison (`**` is not a literal substring of `C_1`'s pattern), but the AAIF policy engine used by `S`'s runtime normalizes `**` to "recursive" and `*` to "single-segment" before evaluation. Under that normalization, `reports/**` *is* a subset of `reports/*` only if `*` is interpreted recursively — and in this deployment it was not. The runtime's normalizer treated `*` as single-segment, so `reports/**` matched deeper paths than `C_1` ever granted. `S` read `/data/tenant-42/reports/2024/q3/ledger.csv`, which `R` never had authority to read. The chain verified. The signatures held. The scope check, run through the *normalizing* evaluator, reported containment because the evaluator normalized both sides with the same buggy rule and produced an internally consistent but externally wrong lattice. The trace: `C_2` minted → signature chain verified against `P`'s public key → scope containment evaluated by `S`'s runtime normalizer → normalizer collapsed `*` and `**` to the same class → containment reported `true` → `S` executed a read outside `R`'s actual grant → cross-tenant path traversal within the same tenant namespace but outside the delegator's authority. A second observed variant: temporal qualifiers. `C_1` carried `expires=2025-06-13T18:00:00Z`. `C_2` carried `expires=2025-06-14T00:00:00Z` because `R`'s minting routine defaulted to "delegator's session TTL" rather than inheriting the parent expiry. Structurally valid, semantically an extension of authority past the delegator's own lease. ## Condition of Validity The monotonicity invariant holds — and an instance may safely accept a re-delegated credential — only when all of the following are true: 1. **Normalization is shared and pinned.** The containment check must be evaluated by the *same* normalizer version that will be used at enforcement time, and that version must be pinned in the credential itself (e.g., a `scope_semantics` claim naming the lattice version). If `C_2` was minted under lattice `v3` and enforced under `v4`, containment is undefined. 2. **Every scope atom resolves to a closed privilege set.** Parameterized actions (`fs:read:`) must have their pattern language fixed and total; wildcard semantics must be single-valued, not deployment-dependent. 3. **Qualifiers are inherited, not re-minted.** Temporal bounds, rate limits, and contextual predicates (`on_behalf_of`, `purpose`) on `C_{n+1}` must be `⊆` those on `C_n` under the same partial order as scope. An expiry that is *later* than the delegator's is an authority extension regardless of scope. 4. **The delegator's own grant is re-checked, not assumed.** `R` must verify that `C_2`'s resolved privilege set is contained in `C_1`'s *resolved* set, not in `C_1`'s *declared* string. This requires resolving both sides through the pinned normalizer at mint time and recording the resolved set (or its hash) in `C_2`. If any of these is false, the chain is not monotonic in the operational sense even if it is monotonic in the syntactic sense, and the instance must treat the credential as unverified for the purposes of privileged action. ## Decision Boundary The boundary is not "reject all credentials that fail string containment." It is: **abort the chain when the resolved privilege set of the presented credential is not a subset of the resolved privilege set of the credential you hold, under a normalizer you can pin and reproduce.** Concretely, an instance must abort when: - The presented credential's `scope_semantics` version differs from the version it will enforce under, and it cannot obtain the minting version to re-resolve. - Any qualifier (expiry, rate, purpose, `on_behalf_of`) on the child is strictly broader than the parent's, even if scope is narrower. A narrower scope with a longer lease is still an expansion of *some* authority dimension; the invariant is per-dimension, not aggregate. - The resolved privilege set cannot be computed because a scope atom references a pattern language the instance does not implement. "Unknown atom" must fail closed, not be treated as empty. - The delegation depth exceeds the `max_delegation_depth` claim, or the `delegation_path` claim does not hash-match the recomputed chain. A chain that verifies signatures but whose declared path diverges from the recomputed path indicates a spliced or replayed hop. The instance may *continue* when resolved containment holds under a pinned normalizer, even if string containment fails — the reverse error (rejecting a legitimately narrowed `reports/**` that resolves inside `reports/`) is a availability cost, not a safety one, and should be surfaced as a distinct `SCOPE_NORMALIZATION_MISMATCH` for operator review rather than silently accepted. ## Operational Effect The practical consequence is that AAIF verification must be split into two phases with different failure semantics. Phase one (structural: signatures, chain linkage, path hash) is deterministic and cacheable. Phase two (semantic: resolved-set containment under a pinned lattice) is where the boundary lives, and it must be executed *at the delegator before minting* and *at the delegate before enforcement*, with the resolved set (or its canonical hash) carried in the credential so the delegate can re-verify without trusting the delegator's normalizer. When phase two cannot be completed — version skew, unknown atom, unresolvable qualifier — the correct behavior is to abort the privileged action and emit a structured refusal, not to fall back to the parent's scope or to "best-effort" resolution. Falling back to the parent's scope is the specific anti-pattern that produced the observed traversal: `S` fell back to `C_1`'s string, which its normalizer then over-matched. The invariant to encode: **a delegated credential is admissible only if `resolve(C_child, lattice_v) ⊆ resolve(C_parent, lattice_v)` for a single, pinned `lattice_v`, evaluated per authority dimension (scope, time, rate, purpose), with unknown atoms failing closed.** Any instance that cannot establish this must abort the chain and re-request a credential minted under a lattice it can reproduce. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import FrozenSet, Mapping class NonMonotonicDelegationError(RuntimeError): """Raised when a re-delegated AAIF credential does not strictly attenuate its parent's authority under a single pinned scope lattice.""" @dataclass(frozen=True) class ResolvedGrant: scope_atoms: FrozenSet[str] expires_at: float max_rate: int purpose: FrozenSet[str] lattice_version: str @dataclass(frozen=True) class DelegatedCredential: subject: str delegator: str declared_scope: FrozenSet[str] expires_at: float max_rate: int purpose: FrozenSet[str] lattice_version: str delegation_path_hash: str max_delegation_depth: int current_depth: int def resolve_scope( declared: FrozenSet[str], lattice_version: str ) -> FrozenSet[str]: # In production this dispatches to a pinned, versioned normalizer. # Unknown atoms must raise, not silently pass through. known = {"fs:read:", "fs:write:", "net:fetch:"} resolved = set() for atom in declared: if not any(atom.startswith(p) for p in known): raise NonMonotonicDelegationError( f"unresolvable scope atom {atom!r} under lattice {lattice_version}" ) resolved.add(atom) return frozenset(resolved) def admit_delegated_credential( child: DelegatedCredential, parent: ResolvedGrant, enforce_lattice_version: str, ) -> ResolvedGrant: if child.lattice_version != enforce_lattice_version: raise NonMonotonicDelegationError( f"lattice version skew: child minted under {child.lattice_version!r}, " f"enforced under {enforce_lattice_version!r}; containment undefined" ) if child.current_depth > child.max_delegation_depth: raise NonMonotonicDelegationError( f"delegation depth {child.current_depth} exceeds cap " f"{child.max_delegation_depth}" ) child_scope = resolve_scope(child.declared_scope, child.lattice_version) # Per-dimension monotonicity: scope, time, rate, purpose. if not child_scope.issubset(parent.scope_atoms): raise NonMonotonicDelegationError( f"scope expansion: {child_scope - parent.scope_atoms} not granted " f"by delegator {child.delegator!r}" ) if child.expires_at > parent.expires_at: raise NonMonotonicDelegationError( f"temporal expansion: child lease {child.expires_at} exceeds " f"delegator lease {parent.expires_at}" ) if child.max_rate > parent.max_rate: raise NonMonotonicDelegationError( f"rate expansion: {child.max_rate} > delegator {parent.max_rate}" ) if not child.purpose.issubset(parent.purpose): raise NonMonotonicDelegationError( f"purpose expansion: {child.purpose - parent.purpose} outside " f"delegator purpose set" ) return ResolvedGrant( scope_atoms=child_scope, expires_at=child.expires_at, max_rate=child.max_rate, purpose=child.purpose, lattice_version=child.lattice_version, ) ```