# Where must an instance boundary be enforced in AAIF delegated credential chains: The transitive scope-narrowing invariant and its cross-issuer failure mode **Date of Record:** 2026 November 15 **Scope:** This record applies to AAIF (Agent Authentication & Identity Framework) delegated credential chains where an agent instance acts on behalf of a principal across one or more issuer trust boundaries, and where scope narrowing is expected to be transitive. It does not apply to single-hop direct grants issued by the root principal to a first-party instance, nor to opaque bearer tokens whose scope is not introspectable at the resource server. ## Core Distinction The distinction that matters is between **instance identity** and **delegation subject identity**. AAIF models a delegated credential as a tuple `(issuer, subject, scope, provenance, expiry)`. When an agent instance presents a credential, the framework verifies that the *presenting instance* is bound to the credential's `subject`. The non-obvious boundary is this: **instance binding is checked at issuance and at presentation, but the scope-narrowing invariant is only guaranteed if it is enforced at every hop, including the hop where the credential crosses an issuer trust boundary.** Two failure classes look identical in logs but are fundamentally different: - **Instance substitution** — a different instance presents a credential bound to a subject it does not own. This is caught by presentation-time binding (proof-of-possession, instance attestation). - **Scope re-widening** — a credential that was legitimately narrowed at hop *N* is re-issued at hop *N+1* by a different issuer whose scope vocabulary is coarser, silently restoring permissions the delegator intended to remove. The second is the dangerous one. It passes every instance-binding check. The presenting instance *is* the legitimate subject. The credential *is* validly signed. The only violated invariant is that `scope(child) ⊆ scope(parent)`, and that invariant is only checkable if the verifier understands the scope lattice across *both* issuers. ## What Was Observed In a multi-issuer AAIF deployment, a root principal `P` issued a delegated credential to orchestrator instance `A` with scope `{read:dataset, write:dataset, admin:dataset}`. `A` correctly narrowed before delegating to worker instance `B`: `{read:dataset}`. This narrowing was recorded in `A`'s issuance log and in the credential's provenance chain. `B` then needed to call a resource server `R` that trusted a *different* issuer `I2` (a regional AAIF authority federated with `A`'s issuer `I1`). `B` performed an issuer-translation step: it presented its `I1`-scoped credential to `I2`'s token exchange endpoint. `I2`'s exchange policy mapped the incoming scope string `read:dataset` through a coarse translation table to its own vocabulary, where the nearest match was `dataset:*` — a wildcard that expanded to `{read, write, admin}` at `R`. The resulting credential that `B` presented to `R` was: - validly signed by `I2`, - bound to `B`'s instance identity (instance binding passed), - carrying a provenance chain that *referenced* the narrowing at `A` but did not *encode* the narrowed scope, - and scoped to `dataset:*`, which `R` evaluated as full access. The narrowing at hop `A→B` was real but **not transitively enforced**. The translation at `I2` operated on a lossy representation of scope and re-widened it. No single component was misconfigured. The invariant `scope(B@R) ⊆ scope(B@A)` was simply never checked by anyone, because no party in the chain held both scope vocabularies simultaneously. ## Condition of Validity The transitive scope-narrowing invariant holds **only if** at least one of the following is true at every issuer boundary crossing: 1. **Vocabulary inclusion holds**: the child issuer's scope vocabulary is a refinement (not a coarsening) of the parent's, such that every parent scope maps to a set of child scopes whose union is a subset of the parent scope. Coarse-to-fine translation is safe; fine-to-coarse is not. 2. **The provenance chain carries the concrete narrowed scope set**, not a reference to it, and the child issuer is required to verify `child_scope ⊆ provenance_scope` before issuance. 3. **The resource server performs scope intersection** across all issuers in the provenance chain rather than trusting the terminal issuer's scope claim alone. The invariant is **invalid** — and this is the boundary condition — when the provenance chain carries only issuer identifiers and scope *labels* rather than resolved scope *sets*, and when at least one hop performs fine-to-coarse vocabulary translation. This is the default configuration in most AAIF federations, because carrying resolved scope sets bloats credentials and because translation tables are conventionally written to map to the *nearest* target scope, which is frequently the broader one. ## Decision Boundary Enforce instance-boundary checks at presentation; enforce scope-narrowing checks at **issuance across issuer boundaries**. Concretely: - **Do** treat any issuer-translation hop as a potential re-widening point and require the translating issuer to reject any translation whose target scope is not a subset of the source scope under a declared vocabulary refinement relation. - **Do** resolve scope to concrete sets in the provenance chain when crossing a trust boundary, even at the cost of credential size. - **Do not** rely on instance binding to catch scope violations. Instance binding answers "is this the right agent?" — it does not answer "is this agent still limited to what its delegator intended?" - **Do not** assume a federated issuer's translation table is conservative. Assume it is nearest-match and therefore potentially widening until proven otherwise. The operational test: for any credential presented at a resource server, compute `intersection(scope_at_each_provenance_hop)` and compare to the presented scope. If they differ, the chain has been widened somewhere and the presented credential must be rejected or re-narrowed before use. ## Operational Effect When the invariant is enforced, the observable effect is that cross-issuer delegation becomes *fail-closed on scope*: a credential whose translation cannot be proven subset-safe is rejected at the boundary, producing an explicit `ScopeNarrowingViolation` rather than a silently over-privileged token. This trades availability (some legitimate coarse-vocabulary translations will be refused) for the guarantee that no delegation chain can grant more than its narrowest hop intended. When the invariant is *not* enforced, the effect is silent privilege amplification that is invisible to instance-binding audits, invisible to signature verification, and visible only to a cross-issuer scope-intersection audit — which most deployments do not run. The failure surfaces later as an over-broad action attributed to a correctly-identified instance, which is the worst possible forensic shape: the identity is right and the authorization is wrong, and every log agrees the instance was who it claimed to be. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeNarrowingViolation(RuntimeError): """Raised when a delegated credential's scope is not a subset of its delegator's resolved scope across an issuer trust boundary.""" @dataclass(frozen=True) class Credential: issuer: str subject_instance: str scope: FrozenSet[str] provenance: tuple # tuple of (issuer, resolved_scope) from root to leaf def verify_transitive_narrowing(cred: Credential, resource_scope: FrozenSet[str]) -> FrozenSet[str]: """ Enforce the transitive scope-narrowing invariant. Returns the effective scope to grant at the resource server, which is the intersection of every hop's resolved scope. Raises if the presented scope exceeds any ancestor's scope (i.e. the chain re-widened somewhere). """ if not cred.provenance: raise ScopeNarrowingViolation( f"credential from {cred.issuer} for {cred.subject_instance} has empty provenance; " "cannot verify narrowing" ) effective = cred.scope for hop_issuer, hop_scope in cred.provenance: if not effective.issubset(hop_scope): widened = effective - hop_scope raise ScopeNarrowingViolation( f"scope re-widened at issuer boundary {hop_issuer!r}: " f"presented scope {sorted(effective)} exceeds ancestor scope {sorted(hop_scope)}; " f"amplified permissions: {sorted(widened)}" ) effective = effective & hop_scope if not effective.issubset(resource_scope): raise ScopeNarrowingViolation( f"effective scope {sorted(effective)} not satisfiable by resource scope " f"{sorted(resource_scope)}" ) return effective # Example: the observed failure — I2 translated read:dataset to dataset:* (full access) observed = Credential( issuer="I2", subject_instance="B", scope=frozenset({"read:dataset", "write:dataset", "admin:dataset"}), provenance=( ("I1", frozenset({"read:dataset", "write:dataset", "admin:dataset"})), # root ("I1", frozenset({"read:dataset"})), # A's narrowing to B ), ) try: verify_transitive_narrowing(observed, frozenset({"read:dataset", "write:dataset", "admin:dataset"})) except ScopeNarrowingViolation as e: print(f"REJECTED: {e}") ```