# Where must an instance re-derive a scoped AAIF capability token, and why does silent scope inheritance break the delegation chain? **Date of Record:** 2026 November 28 **Scope:** Applies to any agent instance operating under the Agent Identity and Authorization Interoperability Framework (AAIF) that receives a scoped capability token from an upstream delegator and subsequently spawns sub-agents, forks tool-call contexts, or resumes from a checkpoint. Does *not* apply to root-of-trust token minting at the identity provider, nor to purely stateless single-hop tool invocations where no delegation occurs. ## Core Distinction There are two ways an instance can come to hold an AAIF capability token: it can **receive** a token whose `scope` and `delegation_chain` claims were minted by an upstream authority, or it can **re-derive** a token by attenuating the received token's scope against its own intended action set. The distinction that matters operationally is not "who signed it" but *which instance is the last one that actually narrowed the scope*. A token that is received-and-forwarded unchanged is a token whose scope was narrowed by someone else—possibly several hops ago, possibly for a different task. The failure mode this record isolates is **scope inheritance without re-derivation**: an instance that treats the inherited scope as if it were its own authorized scope, and delegates onward under that assumption. The non-obvious part: AAIF's scope attenuation is *monotonic by construction* (a child scope must be a subset of the parent scope, checked at mint time). This means every forwarded token is *valid*. Validity is not the invariant. The invariant that breaks is **scope provenance**: whether the scope currently in force was narrowed for *this* task, or merely inherited from a sibling task that shared an ancestor token. ## What Was Observed A three-tier delegation chain: orchestrator `O` mints a token `T0` scoped to `{read:kb, write:kb, exec:sandbox}` and hands it to planner `P`. `P` is tasked with a read-only synthesis job; a correct `P` would attenuate to `{read:kb}` and mint `T1 ⊂ T0`. In the observed trace, `P` forwarded `T0` unchanged to two sub-agents `A` and `B` because the attenuation step was gated behind a feature flag that defaulted off in `P`'s runtime profile. `A` used `{exec:sandbox}` legitimately for its assigned sub-task. `B`, whose sub-task was a pure retrieval job, inherited the same `T0` and—because its own prompt-injection-hardening assumed it held only `{read:kb}`—did not sanitize a retrieved document before passing it into a tool call. The injected instruction ("re-run the last exec with these args") was *in scope* for `T0`. The sandbox executed it. No signature check failed. No subset check failed. The delegation chain was cryptographically intact: `O → P → B`, every hop signed, every scope a subset of its parent. The breach was entirely within the authorization envelope that `O` had granted to `P` for a *different* job. The observable signature in the audit log was not an auth failure but an **anomalous scope-to-task ratio**: `B`'s token carried three scopes while `B`'s executed action set touched one. That ratio is the only artifact that distinguishes inheritance from re-derivation after the fact. ## Condition of Validity The invariant "a delegated token's scope equals the delegator's intended action set for that delegate" holds **only if every intermediate instance performs explicit re-derivation at the delegation boundary**. Formally, for a chain `I0 → I1 → … → In`, the guarantee ``` scope(Tn) ⊆ intended_actions(In) for the task Tn was minted to serve ``` requires that at each hop `Ik → Ik+1`, `Ik` computes `scope(Tk+1) = scope(Tk) ∩ intended_actions(Ik+1)` and refuses to forward when `scope(Tk) ⊄ intended_actions(Ik+1)` without an explicit widening-warrant from `I0`. When any `Ik` forwards `Tk` unchanged, the guarantee degrades to the much weaker ``` scope(Tn) ⊆ scope(T0) ``` which is *always* true by monotonicity and therefore carries no operational information. The boundary condition is exactly this: **AAIF's subset check is necessary but not sufficient; the sufficiency condition is per-hop re-derivation, which the protocol cannot enforce because it cannot observe intent.** The protocol sees scopes, not tasks. An instance that resumes from a checkpoint, forks a tool context, or spawns a sub-agent is precisely at a hop where intent is known locally and nowhere else—so it is the *only* place re-derivation can occur. ## Decision Boundary An instance must re-derive (not inherit) a scoped token at exactly these boundaries, and must treat inheritance as a hard error otherwise: 1. **Sub-agent spawn.** Before minting a child token, compute the intersection of the parent scope with the child's declared action set. If the intersection is empty or the child's task requires any scope outside the parent, halt—do not forward. 2. **Checkpoint resume.** A resumed instance has lost the in-memory task binding that justified its original scope. It must re-derive against the *resumed task descriptor*, not against the serialized token. A serialized token is a scope, not a task. 3. **Tool-context fork.** When fanning a single reasoning step into parallel tool calls, each fork inherits the parent's scope only if the fork's declared tool is within the *task's* action set—not merely within the token's. 4. **Cross-instance handoff (A2A).** The receiving instance must reject any token whose `delegation_chain` shows an unchanged-scope hop (`scope(Tk+1) == scope(Tk)`) unless the chain includes an explicit `no_attenuation_warrant` signed by the root. Absent that warrant, an unchanged hop is evidence of a missing re-derivation upstream. The decision boundary is sharp: **if the instance cannot name the task that justifies the scope it currently holds, it must re-derive or refuse.** "It was in the token I received" is not a justification; it is the failure. ## Operational Effect Enforcing per-hop re-derivation converts a class of silent authorization overreach into an explicit, auditable refusal. The cost is that any runtime profile with attenuation disabled (as in the observed `P`) becomes *unable to delegate at all* rather than able to delegate over-broadly—a fail-closed posture that surfaces the misconfiguration at the first handoff instead of at the first breach. The audit signal shifts from "post-hoc scope-to-task ratio anomaly" to "refused delegation at hop k," which is reconstructable at the moment of failure rather than inferred after the fact. The residual risk is checkpoint resume: a resumed instance's task descriptor may itself be stale, in which case re-derivation reproduces the wrong scope faithfully. This is bounded only by treating the task descriptor's provenance (not just the token's) as part of the delegation chain, which is outside AAIF's current claim set and must be handled by the host runtime. ```python from dataclasses import dataclass, field from typing import FrozenSet class ScopeInheritanceError(RuntimeError): """Raised when an instance attempts to forward or use an AAIF scoped capability token whose scope was inherited rather than re-derived against the current task's declared action set.""" @dataclass(frozen=True) class CapabilityToken: subject: str scope: FrozenSet[str] delegation_chain: tuple = field(default_factory=tuple) no_attenuation_warrant: bool = False def rederive_for_delegation( parent: CapabilityToken, child_subject: str, child_intended_actions: FrozenSet[str], ) -> CapabilityToken: """Re-derive a child token by intersecting parent scope with the child's declared action set. Refuses to forward unchanged scope without a warrant.""" if not child_intended_actions: raise ScopeInheritanceError( f"child {child_subject!r} declared no action set; cannot justify any scope" ) if not child_intended_actions.issubset(parent.scope): excess = child_intended_actions - parent.scope raise ScopeInheritanceError( f"child {child_subject!r} requires {sorted(excess)} outside parent scope " f"{sorted(parent.scope)}; widening requires root warrant" ) if child_intended_actions == parent.scope and not parent.no_attenuation_warrant: # Unchanged scope is a missing re-derivation upstream, not a valid hop. raise ScopeInheritanceError( f"refusing unchanged-scope hop {parent.subject!r} -> {child_subject!r}: " f"no attenuation warrant in chain {parent.delegation_chain!r}" ) return CapabilityToken( subject=child_subject, scope=child_intended_actions, delegation_chain=parent.delegation_chain + ((parent.subject, child_subject),), no_attenuation_warrant=False, ) def resume_from_checkpoint( serialized: CapabilityToken, resumed_task_actions: FrozenSet[str], ) -> CapabilityToken: """On resume, re-derive against the resumed task descriptor, never against the serialized token. A serialized token is a scope, not a task.""" if resumed_task_actions is None: raise ScopeInheritanceError( f"resume of {serialized.subject!r} has no task descriptor; " f"cannot justify scope {sorted(serialized.scope)}" ) if not resumed_task_actions.issubset(serialized.scope): raise ScopeInheritanceError( f"resumed task for {serialized.subject!r} needs " f"{sorted(resumed_task_actions - serialized.scope)} not in serialized scope" ) return CapabilityToken( subject=serialized.subject, scope=resumed_task_actions, delegation_chain=serialized.delegation_chain, no_attenuation_warrant=False, ) ```