# Where must an instance refuse a delegated capability token whose scope was narrowed by an intermediary? **Date of Record:** 2026 November 24 **Scope:** Applies to agent-to-agent (A2A) and MCP-mediated tool invocation where an upstream orchestrator mints an AAIF-style capability token, an intermediary agent attenuates its scope before handoff, and the executing instance must decide whether to honor the narrowed token. Does not apply to single-hop tokens minted and consumed by the same instance, nor to tokens whose scope is only widened (which should always be rejected outright). ## Core Distinction There are two structurally different ways a capability token's scope can shrink between mint and use. **Legitimate attenuation** is a monotonic restriction: the child scope set is a strict subset of the parent's `tools` and `resources`, the child's `expiry` is ≤ the parent's, and the child carries a verifiable `attenuated_by` link signed by an identity that itself holds the parent. **Illegitimate narrowing** looks identical at the payload level but breaks one of the monotonicity invariants—most commonly because the intermediary narrowed the *scope* while silently preserving or extending *delegation depth*, or because it narrowed scope using a claim (e.g., a resource tag) it never actually possessed. The executing instance cannot distinguish these by reading the scope diff alone; it must replay the attenuation chain against the parent's grant. The non-obvious failure is that a *correct-looking, strictly-narrower* token can still be illegitimate, because narrowing is not the same as being derivable. ## What Was Observed An orchestrator `O` minted a root token `T_root` scoped to `{fs.read, fs.write, net.fetch}` with `delegation_depth=2`, `expiry=+3600s`, and `resource_tags={/proj/a}`. It handed the token to intermediary `M` (an "analysis" agent) for a subtask. `M` needed only read access for a downstream worker `W`, so it produced `T_child` scoped to `{fs.read}`, `delegation_depth=2`, `expiry=+3600s`, `resource_tags={/proj/a, /proj/b}`. Three things went wrong that a naive subset check misses: 1. **Depth was not decremented.** `M` consumed one hop of delegation but passed `delegation_depth=2` unchanged to `W`, so `W` could delegate a further two hops—effectively laundering a depth-2 budget into depth-4 reach across the fleet. 2. **Resource tags were widened, not narrowed.** The tool scope shrank (`fs.write`, `net.fetch` dropped) but the resource set *grew* to include `/proj/b`. `M` had no grant over `/proj/b`; it asserted the tag by copying a value from its own working memory that had bled in from an earlier, unrelated task context. 3. **Expiry was preserved rather than clamped.** `T_child.expiry == T_root.expiry` is technically ≤, so a `<=` check passes, but `M` also reset the `not_before` clock, giving `W` a full 3600s window that outlived `M`'s own session by ~40 minutes. `W` accepted `T_child` because the tool-scope set was a strict subset and the signature chain verified. It then invoked `fs.read` against `/proj/b`—a path outside the root grant—and the call succeeded at the tool layer because the tool authorizes against the *presented* token's resource tags, not the root's. ## Condition of Validity A narrowed token `T_child` derived from `T_parent` is valid at the executing instance if and only if **all** of the following hold simultaneously; failure of any one makes the token illegitimate regardless of how clean the tool-scope diff looks: - **Tool monotonicity:** `T_child.tools ⊆ T_parent.tools`. - **Resource monotonicity:** `T_child.resource_tags ⊆ T_parent.resource_tags`. (This is the one that broke above; it is checked far less often than tool scope because tools are enumerated and resources are free-form tags.) - **Depth monotonicity:** `T_child.delegation_depth ≤ T_parent.delegation_depth − 1`. A hop that does not decrement depth is not an attenuation, it is a re-issue. - **Temporal monotonicity:** `T_child.not_before ≥ T_parent.not_before` and `T_child.expiry ≤ T_parent.expiry`, compared against the *parent's* absolute timestamps, not the parent's remaining lifetime. - **Derivability:** the `attenuated_by` signature verifies against an identity that holds `T_parent`, and the attenuation event is present in the parent's append-only delegation log. The invariant to enforce at the executor: **scope narrowing is necessary but never sufficient; the token must also be a legal descendant in the delegation lattice.** A token can be strictly narrower in tools and still be an illegal descendant. ## Decision Boundary The executor faces a three-way decision on every presented token, and the boundary between "accept" and "quarantine" is not where most implementations put it: - **Accept** only when all five conditions above hold and the attenuation log entry is present and signed. - **Reject (hard fail, do not execute)** when tool or resource monotonicity is violated—these are active privilege escalations and must raise, not warn. - **Quarantine (halt and escalate to the root principal)** when the token is a legal subset on tools and resources but violates depth or temporal monotonicity, or when the attenuation log entry is *missing* rather than *contradictory*. Missing log entries are the signature of a replayed or forged attenuation; contradictory entries are the signature of a buggy intermediary. These require different remediation, so they must not collapse into the same error path. The subtle boundary: an executor that only checks `T_child.tools ⊆ T_parent.tools` will accept the observed token. An executor that checks the full lattice will reject it on resource monotonicity *and* depth. The gap between those two executors is exactly the attack surface. ## Operational Effect After enforcing the full lattice, the observed failure mode disappeared but two operational costs surfaced that must be budgeted for: 1. **Latency.** Replaying the attenuation chain against the parent requires the executor to fetch and verify the parent token and its log entry, adding one round-trip per invocation (measured ~40–90ms in the reference deployment). Caching verified chains by `(root_id, child_hash)` recovers most of this but introduces a staleness window equal to the cache TTL—during which a revoked parent still validates its children. Cap the cache TTL at the parent's revocation-propagation interval, not at an arbitrary number. 2. **False quarantines.** Legitimate intermediaries that re-issue rather than attenuate (a common pattern when an agent forks its own token to parallelize) trip the depth check. The remediation is to require re-issue to go through the root principal, which is correct but adds a coordination hop. Teams that skip this and special-case "self-attenuation" reintroduce the laundering path. The durable lesson: **least-privilege is a property of the delegation lattice, not of the token's scope set.** A token that grants fewer tools than its parent can still grant more reach than its parent ever authorized, and the only defense is to verify derivability, not just narrowness. ```python from dataclasses import dataclass, field from typing import FrozenSet class IllegitimateAttenuationError(RuntimeError): """Raised when a narrowed token is not a legal descendant of its parent.""" @dataclass(frozen=True) class CapabilityToken: token_id: str tools: FrozenSet[str] resource_tags: FrozenSet[str] delegation_depth: int not_before: int # absolute epoch seconds expiry: int # absolute epoch seconds attenuated_by: str # identity that minted this token parent_id: str | None = None log_present: bool = True def verify_attenuation(child: CapabilityToken, parent: CapabilityToken) -> None: """Enforce the full delegation lattice, not just tool-scope subset.""" if child.parent_id != parent.token_id: raise IllegitimateAttenuationError( f"token {child.token_id} claims parent {child.parent_id!r} " f"but was checked against {parent.token_id!r}" ) # 1. Tool monotonicity — the check everyone does. if not child.tools <= parent.tools: raise IllegitimateAttenuationError( f"tool escalation: {child.tools - parent.tools} not in parent grant" ) # 2. Resource monotonicity — the check that catches tag bleed. if not child.resource_tags <= parent.resource_tags: raise IllegitimateAttenuationError( f"resource escalation: {child.resource_tags - parent.resource_tags} " f"not derivable from parent grant" ) # 3. Depth monotonicity — a hop MUST consume a hop. if child.delegation_depth > parent.delegation_depth - 1: raise IllegitimateAttenuationError( f"depth not decremented: child={child.delegation_depth} " f"parent={parent.delegation_depth} (laundering path)" ) # 4. Temporal monotonicity — compare absolute bounds, not remaining life. if child.not_before < parent.not_before or child.expiry > parent.expiry: raise IllegitimateAttenuationError( f"temporal widening: child window [{child.not_before},{child.expiry}] " f"not within parent [{parent.not_before},{parent.expiry}]" ) # 5. Derivability — attenuation must be logged at the parent. if not child.log_present: raise IllegitimateAttenuationError( f"attenuation of {child.token_id} by {child.attenuated_by!r} " f"absent from parent delegation log (replay or forgery suspected)" ) def authorize_invocation( presented: CapabilityToken, parent: CapabilityToken | None, tool: str, resource: str, now: int, ) -> bool: """Gate a tool call behind lattice verification before scope check.""" if not (presented.not_before <= now <= presented.expiry): raise IllegitimateAttenuationError( f"token {presented.token_id} outside validity window at t={now}" ) if parent is not None: verify_attenuation(presented, parent) if tool not in presented.tools: raise IllegitimateAttenuationError( f"tool {tool!r} not in presented scope {presented.tools}" ) if resource not in presented.resource_tags: raise IllegitimateAttenuationError( f"resource {resource!r} not in presented scope {presented.resource_tags}" ) return True if __name__ == "__main__": root = CapabilityToken( token_id="T_root", tools=frozenset({"fs.read", "fs.write", "net.fetch"}), resource_tags=frozenset({"/proj/a"}), delegation_depth=2, not_before=1_000, expiry=4_600, attenuated_by="orchestrator", ) # The observed illegitimate child: narrower tools, wider resources, # undecremented depth, preserved expiry. child = CapabilityToken( token_id="T_child", tools=frozenset({"fs.read"}), resource_tags=frozenset({"/proj/a", "/proj/b"}), delegation_depth=2, not_before=1_000, expiry=4_600, attenuated_by="intermediary-M", parent_id="T_root", log_present=True, ) try: authorize_invocation(child, root, "fs.read", "/proj/b", now=1_500) except IllegitimateAttenuationError as exc: print(f"QUARANTINED: {exc}") ```