# Where must an instance of a delegated agent credential be re-scoped before crossing an AAIF trust-boundary hop **Date of Record:** 2026 November 16 **Scope:** Applies to AAIF delegated credential chains where an agent instance acts on behalf of a principal across two or more authorization hops (agent→agent, agent→tool, agent→sub-agent). Does not apply to single-hop direct principal-to-agent issuance, nor to credentials minted and consumed within a single trust domain with no attenuation. ## Core Distinction The non-obvious invariant here is the difference between *scope intersection* and *scope re-derivation*. AAIF delegation is monotone-decreasing by spec: a delegated credential's effective scope must be a subset of its parent's scope. Implementations that enforce this by intersecting the child's requested scope with the parent's granted scope will pass every attenuation test and still leak authority. The failure is not that the child exceeds the parent. The failure is that the child's scope is computed against the *parent's granted set* rather than against the *parent's currently-exercised set at the moment of the hop*. A credential can be a valid subset of its parent and still be invalid for the specific context in which the hop occurs, because the parent's authority was itself conditioned on a context (audience, resource tenant, time window, purpose binding) that the child does not inherit automatically. Intersection preserves set membership. It does not preserve binding. The boundary condition is the hop where the parent's scope is *larger than the parent's current obligation* — and the child, by intersecting with the parent's full granted scope, silently widens back to the parent's ceiling instead of the parent's floor. ## What Was Observed A three-hop chain: principal `P` → orchestrator agent `A` (scope: `read,write` on tenant `t1` and `t2`) → worker agent `B` → tool `T`. At the time `A` delegates to `B`, `A` has already committed to a task bound to tenant `t1` only; its `t2` grant is dormant but still present in the credential. `B` requests `read,write` and the naive issuer intersects against `A`'s granted scope, producing `B` with `read,write` on `t1` *and* `t2`. `B` then delegates to `T`, which performs a cross-tenant read. No scope was exceeded at any single hop. Every credential was a valid subset of its parent. The audit log shows monotone attenuation at every edge. The breach is invisible to subset-checking because the widening happened in the *context dimension*, not the *permission dimension*. The tell: the child credential's `aud` and `purpose` claims were copied from the request, not derived from the parent's active binding. Intersection over permissions returned a clean result; no code path ever compared the parent's *active obligation* to the child's requested context. ## Condition of Validity The invariant holds — i.e., intersection is sufficient — only when the parent's granted scope equals the parent's currently-exercised scope at the hop. That equality is true at issuance time and almost never true afterward. It is preserved only if one of the following holds: the parent credential is single-use and consumed at the hop; the parent's scope is re-derived from task state at every delegation; or the delegation carries an explicit context-binding assertion (audience, tenant, purpose) that the child must match exactly rather than merely be permitted by. Absent one of these, the correct operation at a trust-boundary hop is **re-derivation, not intersection**: compute the child's scope as `f(parent.active_obligation, child.request)`, where `active_obligation` is the parent's binding as of the hop, and reject if the child's request cannot be satisfied within that obligation. Intersection is a necessary post-condition (the result must still be a subset of the parent's grant) but it is not the derivation. ## Decision Boundary Re-scope (re-derive against active obligation) when the hop crosses a trust boundary *and* the parent carries a context binding narrower than its granted scope. Intersect-only is acceptable when the parent is stateless with respect to context — a pure capability token with no purpose or tenant binding — because then granted equals active by construction. The decision is not "does the child exceed the parent" (that check is mandatory and cheap); it is "does the parent have dormant authority that the child would inherit by intersection." If yes, intersection is the wrong operator and the credential must be re-scoped before the hop, or the hop must be refused. ## Operational Effect Enforcing re-derivation at every boundary hop eliminates the class of cross-context privilege widening that subset checks cannot see. The cost is that delegation issuers must query parent task state at hop time, which makes delegation stateful and adds a read dependency on the orchestrator's obligation store. Systems that cannot afford that dependency must instead bind context into the credential at issuance (short-lived, single-purpose, audience-locked) so that granted equals active by construction and intersection becomes sound again. Choosing neither — intersection against a long-lived, context-rich parent — is the configuration that produced the observed cross-tenant read. ```python class DelegationScopeError(RuntimeError): """Raised when a delegated credential cannot be soundly scoped at a trust-boundary hop.""" pass def rescope_at_hop(parent_grant: dict, parent_active_obligation: dict, child_request: dict) -> dict: """ parent_grant: full set the parent credential permits (e.g. {"perms": {...}, "tenants": {...}}) parent_active_obligation: what the parent is actually bound to at this hop (narrower or equal) child_request: what the child asks for Intersection against parent_grant is a post-condition, not a derivation. Derivation must be against parent_active_obligation. """ # Post-condition: parent_active_obligation must itself be within parent_grant. if not _subset(parent_active_obligation, parent_grant): raise DelegationScopeError( "parent active obligation exceeds its own grant; credential chain is corrupt" ) # Derive against the active obligation, not the grant ceiling. derived_perms = set(child_request.get("perms", ())) & set(parent_active_obligation.get("perms", ())) derived_tenants = set(child_request.get("tenants", ())) & set(parent_active_obligation.get("tenants", ())) # Any requested dimension not satisfiable within the active obligation is a re-scope failure, # not a silent narrowing. Widening back to parent_grant is the bug this guards against. if set(child_request.get("tenants", ())) - derived_tenants: raise DelegationScopeError( "child requested tenant outside parent's active obligation; " "intersection against grant would silently widen across context" ) if not derived_perms: raise DelegationScopeError("derived child scope is empty; refusing to mint") child = { "perms": sorted(derived_perms), "tenants": sorted(derived_tenants), "aud": parent_active_obligation.get("aud"), "purpose": parent_active_obligation.get("purpose"), } # Mandatory post-condition: result is a subset of the parent grant. if not _subset(child, parent_grant): raise DelegationScopeError("derived child scope escapes parent grant") return child def _subset(a: dict, b: dict) -> bool: for k, v in a.items(): if isinstance(v, (set, list, tuple)): if not set(v) <= set(b.get(k, ())): return False else: if b.get(k) != v: return False return True ```