# Which invariants prevent delegated capability tokens from surviving scope-narrowing re-issuance when attenuation is monotone only on the issuer's lattice **Date of Record:** 2026 November 28 **Scope:** Applies to any AAIF-style delegation chain where an agent re-issues a narrowed capability token (attenuation) to a sub-agent or tool, and where scopes are represented as sets of permissions drawn from a shared vocabulary. Does not apply to flat, non-delegable bearer tokens or to tokens whose scope is a single opaque resource identifier with no subset semantics. ## Core Distinction The failure is not "the sub-agent got too much permission." It is subtler: **attenuation is monotone only with respect to the issuer's scope lattice, and two honest agents can disagree about what "narrower" means without either being malicious.** When a parent agent holds a token scoped to `{read:*, write:docs}` and re-issues to a child as `{read:docs, write:docs}`, the parent believes it has narrowed. But if the child's capability vocabulary was negotiated against a *different* lattice version—where `read:*` expanded to a finite enumerated set that did **not** include `read:secrets`—the child's `read:docs` may be *wider* than the parent's effective grant on the child's own lattice. The token verifies. The signature checks. The scope check at the resource server passes. And yet the delegation widened authority. This is the **lattice-skew attenuation leak**. The invariant that prevents it is not "child scope ⊆ parent scope" (set inclusion is insufficient). It is: **child scope, when interpreted under the child's lattice, must be a subset of parent scope interpreted under the parent's lattice, evaluated through an explicit lattice-translation function that is itself part of the signed token.** Without that translation function bound into the credential, subset checks are comparing strings in two different algebras. ## What Was Observed A three-tier pipeline: orchestrator agent `O` holds a root token from the authority service; `O` delegates to planner `P`; `P` delegates to executor `E` which calls a document store and a secrets vault. All three run the same AAIF client library but were onboarded at different times; `E` was onboarded after a vocabulary migration that split `read:*` into `read:docs`, `read:config`, and `read:secrets`—previously `read:*` had implicitly excluded `secrets` via a denylist at the vault, not via the scope grammar. Sequence observed in the audit log: 1. `O` issues to `P`: `scope={read:*, write:docs}`, `lattice_version=v1`. 2. `P` narrows to `E`: `scope={read:docs, write:docs}`, `lattice_version=v2` (P's library auto-upgraded the lattice tag on re-issue because the vocabulary registry had moved to v2). 3. `E` requests `read:secrets` from the vault. Vault sees `read:docs` in the token, checks against its own v2 lattice, finds no `read:secrets`, and *should* deny. But it did not deny. The vault's authorization check was `requested ⊆ granted` under v2, and the request came in as `read:secrets`; the granted set `{read:docs, write:docs}` did not contain it—so the direct path was correctly denied. The leak occurred on a *different* call: `E` requested `read:*` (a wildcard request, permitted by the vault's query API for "list what I can read"), and the vault expanded `read:*` under v2 to `{docs, config, secrets}` and intersected with granted `{read:docs}`—fine. But then `E` used the *result of that enumeration* to construct a follow-up token for a sub-tool `T`, re-issuing `scope={read:secrets}` with `lattice_version=v2` and a parent-pointer back to its own token. The re-issuance check at the AAIF broker compared `{read:secrets}` against `E`'s token `{read:docs, write:docs}` under... v1, because the parent-pointer resolution walked to `P`'s token first, which was tagged v2, but the broker's comparison used the *root* lattice tag v1 by default when parent tags disagreed. Under v1, `read:secrets` was not a named scope at all; the broker's subset check treated unknown scopes as vacuously satisfiable ("no rule forbids it") and issued the token. `T` then read the vault. The vault, seeing a validly-signed token scoped `read:secrets` under v2, honored it. Authority had widened from `read:docs` to `read:secrets` across two hops, with every individual check passing. The root cause is a **mixed-lattice comparison**: the broker resolved the parent token's lattice by walking to the nearest ancestor with a lattice tag, but the child token carried its own tag, and the subset predicate was evaluated in the *child's* algebra against the *parent's* raw scope strings. Unknown scopes were treated as unconstrained rather than as errors. ## Condition of Validity The naive subset invariant `child.scope ⊆ parent.scope` is valid **only if** all of the following hold: - `child.lattice_version == parent.lattice_version` (same algebra), **or** an explicit, signed `translation` field maps every symbol in `child.scope` into the parent's algebra and the mapped set is a subset. - The scope vocabulary is **closed**: any symbol not present in the lattice is a hard rejection, never a vacuous pass. Open-world scope handling is the specific mechanism that turned a subset check into a no-op. - Wildcard expansion is performed **at issuance time**, not at enforcement time, and the expanded finite set is what gets signed. A token that carries `read:*` and relies on the resource server to expand it defers the lattice decision to the verifier, which may be on a different version. When any of these is violated, the delegation chain is no longer guaranteed monotone-decreasing in authority, and the "delegated capability" abstraction silently degrades to "bearer token with advisory labels." ## Decision Boundary The boundary between a safe re-issuance and a leak is the moment the broker decides how to compare a child scope symbol that is **unknown to the parent's lattice**. Two policies exist: - **Open-world (unsafe here):** unknown symbol ⇒ no rule forbids it ⇒ allow. This is what produced the leak. It is defensible only when the vocabulary is guaranteed globally consistent, which across independently-onboarded agents it is not. - **Closed-world (required):** unknown symbol ⇒ `ScopeUnknownToLattice` error ⇒ reject re-issuance until the parent token is re-minted under the child's lattice version, or until a signed translation is supplied. The decision must be made **at the broker, at issuance**, not at the resource server at enforcement. Moving it downstream is exactly what allowed the vault to honor a token the broker should never have minted. A second boundary: when parent and child lattice tags disagree, the broker must **refuse to compare** rather than silently pick an ancestor's tag. Picking "nearest tagged ancestor" is the specific heuristic that made `P`'s v2 tag invisible when resolving against `O`'s v1. ## Operational Effect After the fix—closed-world scope handling, mandatory same-lattice or signed-translation for every re-issuance, and hard failure on tag disagreement—the observable changes were: - Re-issuance latency rose ~4ms per hop (one extra lattice-tag resolution and set-membership check per symbol), which was acceptable. - A class of previously "working" delegations began failing loudly: agents that had been quietly relying on open-world scope tolerance. These were, on inspection, all cases where the child had drifted to a newer vocabulary than the parent. The failures were correct. - The audit log gained a required `lattice_translation` field on every child token, making the algebra under which each scope symbol was interpreted explicit and replayable. The invariant to carry forward: **a delegated capability token is only as narrow as the lattice under which its narrowness is checked, and that lattice must be signed into the token and identical (or explicitly translated) across every link in the chain.** Subset checks on bare scope strings across heterogeneous vocabularies are not attenuations—they are string comparisons that happen to look like security. ```python from dataclasses import dataclass, field from typing import FrozenSet, Optional class LatticeSkewError(RuntimeError): """Raised when a delegated token cannot be proven narrower than its parent because the two are interpreted under different scope lattices without a signed translation.""" @dataclass(frozen=True) class CapabilityToken: subject: str scope: FrozenSet[str] lattice_version: str parent: Optional["CapabilityToken"] = None translation: Optional[dict] = None # child_symbol -> parent_symbol KNOWN_SCOPES = { "v1": {"read:*", "write:docs"}, "v2": {"read:docs", "read:config", "read:secrets", "write:docs"}, } def _expand(scope: FrozenSet[str], lattice: str) -> FrozenSet[str]: """Closed-world expansion: unknown symbols are an error, never vacuous.""" known = KNOWN_SCOPES[lattice] out = set() for sym in scope: if sym not in known: raise LatticeSkewError( f"scope symbol {sym!r} unknown to lattice {lattice!r}" ) out.add(sym) return frozenset(out) def reissue(parent: CapabilityToken, child_scope: FrozenSet[str], child_lattice: str) -> CapabilityToken: """Mint a narrowed child token, or refuse. Refusal is the safe default.""" if child_lattice != parent.lattice_version: if parent.translation is None: raise LatticeSkewError( f"lattice skew {parent.lattice_version!r} -> {child_lattice!r} " f"with no signed translation; refusing to compare" ) mapped = frozenset( parent.translation.get(s, s) for s in child_scope ) else: mapped = child_scope parent_eff = _expand(parent.scope, parent.lattice_version) child_eff = _expand(mapped, parent.lattice_version) if not child_eff.issubset(parent_eff): raise LatticeSkewError( f"attenuation violation: {sorted(child_eff)} not subset of " f"{sorted(parent_eff)} under {parent.lattice_version!r}" ) return CapabilityToken( subject="child", scope=child_scope, lattice_version=child_lattice, parent=parent, translation=parent.translation, ) ```