# Which invariants prevent delegated AAIF scopes from silently widening across agent passport re-issuance **Date of Record:** 2026 December 3 **Scope:** Applies to multi-hop agent delegations where an agent passport (signed capability bundle) is re-issued mid-task, chained, or refreshed under a parent credential. Does not cover first-issuance passport minting or static service-account credentials with no delegation chain. ## Core Distinction The failure is not scope escalation by a malicious actor. It is **scope accretion by legitimate re-issuance** — the union of a delegated scope set with the agent's own prior scope set when the passport is refreshed, because the re-issuance path reuses the agent's cached self-description as the base capability document instead of the parent's delegated grant. A delegated credential carries a *subset* invariant: `scope(child) ⊆ scope(parent)`. Most AAIF implementations enforce this at mint time by intersecting the requested scope with the parent grant. That check is sound. The boundary failure lives one step earlier: when the child agent reconstructs its *requested* scope during re-issuance, it derives it from its own last passport (which already includes everything it had), not from the parent's current grant. Intersection then runs against a set that has already been contaminated, and the subset invariant holds vacuously against the wrong reference set. ## What Was Observed A three-hop chain: orchestrator `O` delegates `{read:repo, read:issues}` to planner `P`. `P` delegates `{read:repo}` to executor `E`. `E` runs long, and its passport TTL expires mid-task. On refresh, `E`'s credential-refresh routine reads its persisted `self.passport.scopes` (which is `{read:repo}` — correct), but the refresh handler is invoked through `P`'s delegation endpoint, which reconstructs the parent grant from `P`'s *cached* passport snapshot taken at first delegation. That snapshot was `{read:repo, read:issues}` because `P` itself had been delegated both. The refresh mints `E` a new passport with `{read:repo, read:issues}` — the intersection of `E`'s request `{read:repo}` against `P`'s stale, wider grant. But `E`'s *request* was reconstructed by merging `self.passport.scopes` with a "carry-forward" list populated from the last successful tool-call authorization decisions, which included a `read:issues` call that `E` had never been granted and which should have been denied — the denial was logged but the request object was mutated before the denial short-circuited. Two independent mechanisms conspired: (1) stale parent grant snapshot at the delegation endpoint, and (2) carry-forward of denied-call scopes into the re-issuance request. Either alone is bounded. Together they produced a passport whose scope exceeded `O`'s original grant to `P`'s parent — `E` ended with `read:issues` that `O` had granted to `P` but never to `E`, and which `P`'s own live grant still permitted but `P` had never intended to redelegate. The subset check `scope(E_new) ⊆ scope(P_live)` passed, because `P_live` genuinely held `read:issues`. The check that would have caught it — `scope(E_new) ⊆ scope(P_at_delegation_time)` — was never evaluated. ## Condition of Validity The accretion only manifests when all of the following hold: 1. The delegation chain depth is ≥ 2, so a parent grant exists that is itself a delegated subset. 2. A child passport is re-issued (TTL refresh, capability upgrade, or crash-resume re-mint) rather than minted fresh from the root. 3. The re-issuance endpoint resolves the parent grant from a snapshot or cache rather than from the parent's live, verifiable passport at the moment of re-issuance. 4. The child's requested-scope construction includes any carry-forward, retry-buffer, or "last known good" scope source that is not strictly filtered by prior *successful* authorizations. If any one is absent, the accretion is bounded. Remove (3) and the intersection runs against live parent scope; remove (4) and the request cannot exceed what the child was actually granted. ## Decision Boundary The correct invariant is **monotone narrowing across the full chain, evaluated against the parent's live grant at every re-issuance**: ``` scope(child_new) ⊆ scope(parent_live) ∩ scope(child_old) ``` The second term — intersection with the child's *prior* scope — is the non-obvious one. Standard AAIF treats re-issuance as a fresh grant and checks only against the parent. But a re-issuance is not a fresh grant; it is a *continuation* of an existing delegation, and continuation must be non-widening. A refresh may narrow or hold scope constant; it may never widen, even if the parent's live grant would permit the wider set. Widening requires an explicit new delegation event with its own audit record, not a refresh. Additionally, the requested-scope set must be constructed *only* from the child's current passport plus explicitly-requested new capabilities, never from authorization-decision history. A denied call must never contribute to a scope request; the denial path must be mutation-free with respect to the request object. ## Operational Effect Without the continuation-narrowing invariant, scope drifts upward monotonically across refresh cycles, and the drift is invisible to per-hop subset checks because each hop's check is locally sound against the wrong reference. The blast radius compounds with chain depth and task duration: long-running executor agents that refresh frequently accumulate the union of every ancestor's grant. The only reliable detection is a full-chain replay: reconstruct `scope(root) ⊇ scope(h1) ⊇ ... ⊇ scope(hn)` from the signed passport chain and assert monotone containment at each edge. Any agent that cannot produce its full signed ancestry at re-issuance must be treated as a fresh principal with no inherited scope, forcing re-delegation from the root. The guardrail is a passport-chain validator that runs at refresh, not at mint, and that rejects any re-issuance where the new scope is not a subset of the prior scope for that same agent identity, regardless of what the parent currently permits. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeWideningOnRefreshError(RuntimeError): """Raised when a passport re-issuance would widen an agent's scope.""" @dataclass(frozen=True) class Passport: agent_id: str parent_id: str | None scopes: FrozenSet[str] chain: tuple["Passport", ...] = () def reissue_passport( prior: Passport, parent_live: Passport, requested: FrozenSet[str], ) -> Passport: # Continuation invariant: a refresh may narrow, never widen. if not requested <= prior.scopes: widened = requested - prior.scopes raise ScopeWideningOnRefreshError( f"refresh of {prior.agent_id} requested {sorted(widened)} " f"not present in prior scope {sorted(prior.scopes)}; " f"widening requires a new delegation event, not a refresh" ) # Subset invariant against the parent's live grant at refresh time. if not requested <= parent_live.scopes: raise ScopeWideningOnRefreshError( f"refresh of {prior.agent_id} requested {sorted(requested - parent_live.scopes)} " f"outside live parent {parent_live.agent_id} grant" ) return Passport( agent_id=prior.agent_id, parent_id=prior.parent_id, scopes=requested, chain=prior.chain + (parent_live,), ) def validate_chain(tip: Passport) -> None: # Full-chain monotone containment: root ⊇ h1 ⊇ ... ⊇ tip. chain = tip.chain + (tip,) for child, parent in zip(chain[1:], chain[:-1]): if not child.scopes <= parent.scopes: raise ScopeWideningOnRefreshError( f"chain violation: {child.agent_id} scope {sorted(child.scopes)} " f"exceeds ancestor {parent.agent_id} scope {sorted(parent.scopes)}" ) ```