# When must an instance reject a delegated AAIF credential whose scope narrows correctly but whose cross-issuer trust chain re-broadens at an intermediate hop **Date of Record:** 2026 November 26 **Scope:** Applies to any agent instance validating a delegated Agent Identity and Authorization Interoperability Framework (AAIF) credential presented by a peer, a sub-agent, or a tool-call proxy, where the credential crosses at least one issuer boundary (issuer ≠ root trust anchor). Does not apply to single-issuer, single-hop credentials, nor to bearer tokens with no delegation chain. ## Core Distinction The failure that matters is not scope escalation. Most AAIF validators already check that each delegation hop's scope set is a subset of its parent's scope set, and that check is local, cheap, and correct. The non-obvious boundary is that **scope narrows monotonically along the chain while the trust chain itself re-broadens**. A credential can carry a perfectly valid narrowing scope (`files:read` ⊆ `files:read,write` ⊆ `*`) and still be invalid, because an intermediate issuer in the chain was itself authorized only for a restricted resource partition, and the leaf credential's scope is expressed against a *different* partition namespace than the one the intermediate was trusted over. Concretely: scope-set subset checks operate on the *token strings* in the `scope` claim. Trust-chain validation operates on the *issuer identifiers* and their registered `authorized_namespaces`. These two lattices are validated independently, and neither validator sees the other's lattice. A credential is well-formed on both axes and still crosses a boundary that no single check detects: the scope is a subset of the parent's scope *as strings*, but the parent's authority over that scope string was itself scoped to a namespace the leaf does not inhabit. ## What Was Observed A three-hop delegation chain in a document-processing swarm: - **Root anchor** `aaif://org/root` — authorized for `docs:*` across all tenant partitions. - **Intermediate issuer** `aaif://org/tenant-a/coordinator` — delegated by root with scope `docs:read,docs:write`, and (separately, in the issuer registry) registered as authorized *only* over partition `tenant-a`. - **Leaf agent** `aaif://org/tenant-a/worker-7` — delegated by the coordinator with scope `docs:read`. Every local check passed: 1. Leaf scope `{docs:read}` ⊆ coordinator scope `{docs:read, docs:write}` — subset holds. 2. Coordinator scope ⊆ root scope — subset holds. 3. Signature chain verifies end-to-end; each hop's `iss` matches the previous hop's `sub`. 4. Coordinator's registry entry lists root as a valid parent issuer. The worker then issued a tool call to `docs:read` against partition `tenant-b`. The tool-side validator checked the leaf credential's scope (`docs:read` — permitted) and the signature chain (valid) and allowed the read. It should have rejected: the coordinator's authority over `docs:read` was partition-scoped to `tenant-a`, so any credential derived through that coordinator cannot carry authority into `tenant-b`, regardless of how the leaf scope string is written. The scope *string* narrowed; the *authority domain* silently reset to the root's unrestricted domain at the leaf because the leaf's namespace was never intersected with the intermediate's namespace constraint. The trace: at hop 2, the validator intersected `scope` claims but did not intersect `authorized_namespaces`. At hop 3, the leaf's namespace (`tenant-b`, derived from the tool's target resource) was checked against the *root's* namespace set (all partitions), not against the accumulated intersection down the chain (`{tenant-a}`). The accumulated namespace constraint was dropped at the hop where scope strings happened to be expressible without a namespace qualifier. ## Condition of Validity The invariant that must hold for a delegated AAIF credential to be accepted: > The leaf credential's effective authority is the **intersection**, over every hop from root anchor to leaf, of (a) the hop's scope set and (b) the hop's authorized namespace set. Acceptance requires that the *requested resource* fall inside this intersection, not merely inside the leaf's declared scope and the root's declared namespaces. This is a lattice-meet over a product domain `(scope × namespace)`, not two independent subset checks. The bug class arises whenever the two components are validated by different code paths, or whenever a hop's namespace constraint is not carried forward because the hop's scope strings are unqualified. Unqualified scope strings (`docs:read`) are the trigger: they invite the validator to resolve the namespace at the point of use (the tool) rather than at the point of delegation (the intermediate), and the point-of-use resolution defaults to the root's namespace set. The condition is *not* satisfied by: signature validity, `iss`/`sub` continuity, scope-string subset checks at each hop, or registry checks that each issuer is *some* valid child of its parent. All four can hold while the invariant fails. ## Decision Boundary An instance must reject the credential — not merely log and proceed — when the following predicate is true: ``` accumulated_namespaces = root.authorized_namespaces for hop in chain[1:]: accumulated_namespaces &= hop.authorized_namespaces if hop.scope is unqualified and hop.namespace_constraint is None: # cannot prove the hop was authorized over the resource's partition raise DelegationNamespaceUnprovable(hop) requested_namespace = resolve_namespace(target_resource) if requested_namespace not in accumulated_namespaces: raise DelegationNamespaceEscape(...) ``` The boundary is sharp: the instance must reject when the requested namespace is outside the accumulated intersection, **even if** the leaf scope is a strict subset of every ancestor's scope and **even if** the root is authorized over the requested namespace. The root's authority is necessary but not sufficient; the intermediate's constraint is a hard cap that the leaf cannot exceed by narrowing its scope string. Conversely, the instance must *not* reject merely because an intermediate's scope is broader than the leaf's — that is normal narrowing. Rejection is triggered only by namespace escape, not by scope breadth. ## Operational Effect The practical consequence is that scope-subset validation gives a false sense of monotonic restriction. Operators reading audit logs see a chain of monotonically narrowing scopes and conclude the delegation is safe, while the authority domain has silently re-broadened at the leaf. The blast radius is bounded by the root's namespace set, which in multi-tenant deployments is the entire tenant population. In the observed case the worker read a document from a partition it had no path to legitimately; the read succeeded and was logged as authorized. The guardrail is architectural, not procedural: the namespace intersection must be computed by the *same* validator that computes the scope intersection, over the *same* chain traversal, and the resolved resource namespace must be an input to that traversal rather than a post-hoc check at the tool boundary. Any design where scope and namespace are validated in separate services, or where the tool resolves the namespace after the credential is accepted, reproduces this failure. Log the accumulated intersection, not just the leaf scope, so that a re-broadening is visible in the audit trail even when the request is correctly rejected. ```python class DelegationNamespaceEscape(RuntimeError): """Raised when a delegated AAIF credential's requested resource falls outside the namespace intersection accumulated across the trust chain.""" class DelegationNamespaceUnprovable(RuntimeError): """Raised when an intermediate hop's namespace constraint cannot be recovered, so the accumulated intersection cannot be computed.""" def validate_delegated_credential(chain, target_resource): # chain: ordered root-first list of hop dicts, each with # 'issuer', 'scope' (set[str]), 'authorized_namespaces' (set[str] | None), # 'namespace_constraint' (set[str] | None) if not chain: raise DelegationNamespaceUnprovable("empty chain") root = chain[0] accumulated = set(root["authorized_namespaces"] or []) for hop in chain[1:]: hop_ns = hop.get("authorized_namespaces") if hop_ns is None and hop.get("namespace_constraint") is None: # unqualified scope with no recoverable namespace cap: # cannot prove this hop was authorized over the resource partition raise DelegationNamespaceUnprovable( f"hop {hop['issuer']} has no namespace constraint" ) constraint = hop.get("namespace_constraint") or hop_ns or set() accumulated &= set(constraint) if not accumulated: raise DelegationNamespaceEscape( f"namespace intersection empty at hop {hop['issuer']}" ) requested_ns = resolve_namespace(target_resource) if requested_ns not in accumulated: raise DelegationNamespaceEscape( f"resource namespace {requested_ns!r} outside accumulated " f"intersection {sorted(accumulated)!r}" ) return True def resolve_namespace(target_resource): # derive partition from the resource URI; must not default to root scope return target_resource.split("/")[2] ```