# Under what conditions must an instance refuse a delegated AAIF capability token whose scope chain is transitively valid but whose attenuation lattice is non-monotonic **Date of Record:** 2026 November 27 **Scope:** Applies to AAIF-compliant agents that receive delegated capability tokens carrying scoped permissions across one or more hops (issuer → delegate → sub-delegate), where each hop may attenuate but not amplify the parent scope. Does not cover single-hop bearer tokens, symmetric-key session tokens, or root credential minting. ## Core Distinction There is a difference between a scope chain that *verifies* and a scope chain that *attenuates monotonically*. AAIF signature verification answers a binary question: "Did each hop's issuer hold a token that cryptographically authorized this child token?" It does not answer the question the executing agent actually cares about: "Is the permission set granted to me a subset of the permission set held by my delegator at the moment of delegation?" The failure mode is a **non-monotonic attenuation lattice**. When capability scopes are expressed as a partially ordered set (e.g., `read:db ⊑ admin:db`, `write:fs:/tmp ⊑ write:fs:/`), a delegate can construct a child token whose scope is *individually* a valid attenuation of some ancestor but *collectively* outside the intersection of all ancestors. Signature verification passes at every hop. The intersection check — the only check that bounds the effective privilege — fails silently because most AAIF implementations verify hop-by-hop rather than chain-wise. The invariant that must hold: **effective_scope(instance) ⊆ ⋂_{h ∈ chain} scope(h)**. A token whose effective scope is not a subset of the intersection of every ancestor's scope is a privilege-escalation artifact and must be rejected, regardless of signature validity. ## What Was Observed An orchestrator agent `O` held a root token with scope `{read:secrets, read:config}`. It delegated to a worker `W` a token scoped `{read:secrets}` — a clean attenuation. `W`, needing to delegate a narrow subtask to a tool-runner `T`, constructed a child token scoped `{read:config}`. Inspecting `W`'s own token, `W` reasoned (correctly, per its local view) that `read:config` was a *sibling* capability it "had access to" via the broader orchestrator context, and signed the delegation with its own key. The AAIF verifier at `T` performed the standard check: `T`'s token signature chains to `W`, `W`'s signature chains to `O`, `O`'s signature chains to the root issuer. All valid. `T`'s token scope `{read:config}` was a valid attenuation of *some* ancestor (`O` held `read:config`). Verification passed. But `W` never held `read:config`. The intersection over the chain `{read:secrets} ∩ {read:secrets, read:config} = {read:secrets}` does not contain `read:config`. `T` executed with a capability that no intermediate hop was authorized to grant — a **lattice-jump escalation** across a delegation boundary. The trace: 1. `O` mints `W`-token: scope `{read:secrets}`, issuer `O`, parent `O`-token. 2. `W` mints `T`-token: scope `{read:config}`, issuer `W`, parent `W`-token. 3. `T` verifies: signature chain OK; `{read:config} ⊑ ancestor-scope` for ancestor `O` → OK. 4. `T` executes `read:config` — privilege escalation succeeds. The per-hop check `child.scope ⊑ parent_of_parent.scope` is the bug. It checks against *any* ancestor, not the *immediate* parent, and not the chain intersection. ## Condition of Validity A delegated AAIF token is admissible to an executing instance **iff all three hold**: 1. **Immediate-parent containment:** `child.scope ⊆ immediate_parent.scope`, evaluated against the token's declared parent, not any ancestor. 2. **Chain-intersection containment:** `child.scope ⊆ ⋂_{h ∈ ancestors} scope(h)`, computed over the full verified chain, not sampled. 3. **Scope-set well-formedness:** every element of `child.scope` is a member of the lattice with a defined partial order, and the containment test is performed under that order — not under string equality or set membership on unnormalized capability strings. Condition 2 is the one that fails in practice. Implementations that short-circuit on condition 1 (or worse, on "child is a subset of *some* ancestor") admit the lattice-jump. Condition 3 fails when capability strings are compared without lattice normalization — `read:fs:/tmp/../etc` and `read:fs:/etc` are distinct strings but identical lattice elements, and a naive set-membership check will treat the first as an attenuation of the second. When the lattice is a flat set (no partial order beyond subset), conditions 1 and 2 coincide and the bug is invisible. The bug only manifests when the lattice has non-trivial structure — hierarchical paths, wildcarded scopes, or role inheritance. This is why it survives testing: flat-scope test suites pass. ## Decision Boundary The instance must **reject** the token when chain-intersection containment fails, even though every signature verifies. The correct response is not to "narrow" the token silently (that masks the escalation and leaves the delegator's intent ambiguous) and not to "trust the immediate parent" (the immediate parent may itself be a compromised or confused hop). The instance must raise a delegation-integrity fault, refuse execution, and surface the chain with the offending hop identified. The instance must **accept** when all three conditions hold, including the case where the lattice is flat and conditions 1–2 are trivially satisfied. Over-rejection on flat lattices is the symmetric failure: an instance that demands lattice structure where none exists will reject valid tokens and deadlock the delegation graph. The boundary is sharp: **signature validity is necessary but never sufficient**. An instance that treats "the chain verifies" as "the chain authorizes" has conflated authentication with authorization and will execute escalated capabilities. ## Operational Effect In a multi-agent swarm, this failure compounds. A single lattice-jump token, once accepted by `T`, can be re-delegated with a scope that is now "legitimately" held by `T` — the escalation launders itself into the chain. Downstream auditors replaying the chain see signatures that verify and scopes that are individually plausible, and the escalation becomes invisible to post-hoc verification unless the auditor recomputes the chain intersection at every hop. The guardrail is a **chain-intersection gate** at every execution boundary, not just at the root. The gate must recompute the intersection over the full verified ancestor set at the moment of execution — not cache a "validated" flag from token receipt, because the ancestor set can be extended by later delegation and a token valid at receipt can become invalid if a new ancestor is inserted. The invariant is recomputed, never memoized. --- ```python from dataclasses import dataclass from typing import FrozenSet class DelegationIntegrityError(RuntimeError): """Raised when a delegated AAIF token's scope chain is non-monotonic.""" pass @dataclass(frozen=True) class CapabilityToken: token_id: str issuer: str parent_id: str | None scope: FrozenSet[str] lattice_element: str # normalized lattice position, e.g. "read:fs:/etc" def normalize(scope: FrozenSet[str], lattice: dict[str, str]) -> FrozenSet[str]: """Map raw capability strings to normalized lattice elements.""" out = set() for s in scope: if s not in lattice: raise DelegationIntegrityError(f"capability {s!r} not in lattice") out.add(lattice[s]) return frozenset(out) def verify_chain_intersection( token: CapabilityToken, ancestors: list[CapabilityToken], lattice: dict[str, str], ) -> None: """Enforce: effective_scope(token) subset of intersection of all ancestors. Signature verification is assumed already performed. This gate checks the monotonic attenuation invariant that signatures cannot express. """ if not ancestors: return # root token, no delegation boundary to cross child_scope = normalize(token.scope, lattice) # Condition 1: immediate-parent containment. immediate_parent = ancestors[0] parent_scope = normalize(immediate_parent.scope, lattice) if not child_scope <= parent_scope: raise DelegationIntegrityError( f"token {token.token_id} scope {sorted(child_scope)} not contained " f"in immediate parent {immediate_parent.token_id} scope " f"{sorted(parent_scope)}" ) # Condition 2: chain-intersection containment over ALL ancestors. intersection = parent_scope for anc in ancestors[1:]: intersection = intersection & normalize(anc.scope, lattice) if not child_scope <= intersection: offending = sorted(child_scope - intersection) raise DelegationIntegrityError( f"lattice-jump escalation: token {token.token_id} grants " f"{offending} which is absent from the chain intersection " f"{sorted(intersection)}; signatures verified but attenuation " f"is non-monotonic" ) def execute_delegated( token: CapabilityToken, ancestors: list[CapabilityToken], lattice: dict[str, str], required: FrozenSet[str], ) -> None: verify_chain_intersection(token, ancestors, lattice) effective = normalize(token.scope, lattice) missing = normalize(required, lattice) - effective if missing: raise DelegationIntegrityError( f"token {token.token_id} lacks required capabilities {sorted(missing)}" ) # ... execute with bounded capability ... ```