# Why does an instance of an AAIF-scoped capability token silently widen privilege when the token's attenuation chain crosses a resource-version boundary **Date of Record:** 2026 November 18 **Scope:** Applies to AAIF (Agent Action Interchange Format) capability tokens that are attenuated across two or more issuers where at least one link references a versioned resource (e.g., `s3://bucket/key@v7`, `repo://tree/sha`, `svc://endpoint/schema=2`). Does not apply to flat, single-issuer tokens, nor to tokens whose attenuation chain is entirely within one resource version namespace. ## Core Distinction A capability token is *scoped* when its attenuation chain monotonically narrows the set of (action, resource) pairs the bearer may invoke. A token is *sound* when the verifier's interpretation of the resource identifier is identical to the issuer's interpretation at every link. These are independent properties. The common failure mode is a token that is *scoped* (each link correctly intersects permissions) but *unsound* (links disagree about what the resource identifier denotes because a version qualifier was dropped, normalized, or re-resolved at a different link). The result is a token whose effective privilege is the *union* of what each link intended to grant, not the intersection — the exact inverse of least privilege. The non-obvious part: no link in the chain is individually wrong. Each issuer attenuates against the version it saw. The unsoundness lives in the *composition*, specifically at the boundary where a version qualifier is treated as metadata by one issuer and as part of the resource identity by another. ## What Was Observed A three-link attenuation chain was exercised against a tool-access broker: 1. **Root issuer** mints a capability for `read` over `dataset://metrics@v12` (a versioned, immutable snapshot). 2. **Delegating agent A** attenuates to `read` over `dataset://metrics@v12/columns=latency`, correctly preserving `@v12`. 3. **Delegating agent B** attenuates to `read` over `dataset://metrics@v12/columns=latency/limit=1000`. The broker resolved `dataset://metrics@v12` at invocation time and — because the backing store had rolled forward to `v13` — served `v13`. The token's `@v12` qualifier had been recorded by the root issuer as a *provenance annotation* (non-binding), while agents A and B treated it as a *binding selector*. The broker, reading only the binding fields, ignored it. Observed effect: agent B, intended to read 1000 latency rows from a frozen snapshot, read 1000 latency rows from a *live, mutable* dataset. The privilege did not expand in breadth (still `read`, still `columns=latency`, still `limit=1000`), but it expanded in *temporal scope* — from a pinned immutable version to the moving head. For a dataset with per-row access controls that mutate between versions, this is a privilege escalation across a version boundary. A second, sharper instance: a token scoped to `repo://tree/` where `` was recorded as a *label* by the root issuer. Agent A re-resolved the label to `` (the branch head moved) and attenuated against ``. The intersection of the two links was empty — but the verifier, comparing only the label, accepted the chain and granted access to ``. The token was scoped to a commit that no link actually authorized. ## Condition of Validity The invariant that must hold for AAIF attenuation to be sound: > For every link *i* in the chain, `resolve_i(ident) == resolve_{i+1}(ident)` for all resource identifiers `ident` carried by the token, where `resolve` is the issuer's binding resolution function. This holds only when one of the following is true: - Every version qualifier in the chain is marked **binding** by every issuer (i.e., part of the resource identity, not provenance). - The chain terminates at a single verifier that re-resolves *all* identifiers against the **root issuer's** binding table, never against intermediate issuers' tables. - Resource identifiers are content-addressed (immutable by construction), so `resolve` is the identity function. The invariant fails when version qualifiers are mixed-mode: binding at some links, annotation at others. This is common because root issuers often mint long-lived tokens where the version is "just metadata," while delegating agents, operating under least-privilege pressure, treat every qualifier as binding. The two conventions compose badly. ## Decision Boundary Before accepting an attenuated AAIF token, the verifier must decide: *is the version qualifier part of the resource identity or not?* The decision is not free — it depends on the root issuer's declared semantics, which are frequently absent from the token itself. The operative rule: - If the token carries an explicit `binding: identity` declaration on the version field, treat the qualifier as binding and reject any link whose resolution diverges from the root's. - If the token carries `binding: annotation` (or no declaration), the verifier **must not** grant access based on intermediate re-resolution. It must re-resolve against the root issuer's binding table, or refuse the chain. - If the chain mixes declarations across links, the chain is **unsound by construction** and must be rejected — do not attempt to reconcile. The boundary is sharp: there is no "mostly sound" chain. A single annotation-vs-identity mismatch anywhere in the chain means the effective privilege is a union, and the token must be treated as over-broad. ## Operational Effect The practical consequence is that least-privilege guarantees for agent tool access degrade silently at version boundaries. Audits that check *scope* (does the token name only permitted actions/resources?) pass. Audits that check *soundness* (do all links agree on resource identity?) are rarely run, because they require reconstructing each issuer's binding table. Mitigations that held under test: - **Content-address all resources** referenced by attenuated tokens. Where impossible, pin by digest and treat the digest as binding at every link. - **Declare binding semantics explicitly** in the token (`binding: identity`), and have the verifier reject chains with mixed declarations. - **Verify against the root binding table only**, never intermediate tables. This is the cheapest sound check: re-resolve every identifier using the root issuer's `resolve`, and reject if any link's resolution differs. - **Log the resolution divergence** at each link; a non-empty divergence set is the signal that a token is over-broad even though its scope looks correct. The failure does not announce itself. The token verifies, the action succeeds, the audit trail shows a correctly-scoped read. The only trace is that the data returned came from a version no link authorized — visible only if you compare the served version against every link's pinned version, which the broker did not do. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Iterable class UnsoundAttenuationError(RuntimeError): """Raised when an AAIF attenuation chain mixes binding and annotation semantics for a version qualifier, making effective privilege a union rather than an intersection.""" @dataclass(frozen=True) class Link: issuer: str resource: str # e.g. "dataset://metrics@v12" version: str # e.g. "v12" binding: str # "identity" | "annotation" resolve: Callable[[str], str] # issuer's binding resolution def verify_attenuation_chain(chain: Iterable[Link]) -> None: """Reject chains whose links disagree on whether the version qualifier is part of resource identity. Soundness requires all links to agree, and all resolutions to match the root issuer's resolution.""" links = list(chain) if not links: raise UnsoundAttenuationError("empty attenuation chain") root = links[0] root_resolved = root.resolve(root.resource) for i, link in enumerate(links[1:], start=1): if link.binding != root.binding: raise UnsoundAttenuationError( f"link {i} ({link.issuer}) declares binding={link.binding!r} " f"but root ({root.issuer}) declares binding={root.binding!r}; " f"effective privilege is a union, not an intersection" ) resolved = link.resolve(link.resource) if resolved != root_resolved: raise UnsoundAttenuationError( f"link {i} ({link.issuer}) resolves {link.resource!r} -> " f"{resolved!r}, but root resolves to {root_resolved!r}; " f"chain is over-broad across a version boundary" ) def _demo() -> None: # Root pins @v12 as binding; agent B re-resolves to v13 (live head). root = Link( issuer="root", resource="dataset://metrics@v12", version="v12", binding="identity", resolve=lambda r: "dataset://metrics@v12", ) agent_b = Link( issuer="agent-b", resource="dataset://metrics@v12/columns=latency/limit=1000", version="v12", binding="identity", resolve=lambda r: "dataset://metrics@v13", # rolled forward ) verify_attenuation_chain([root, agent_b]) # raises if __name__ == "__main__": _demo() ```