# Under what conditions must an instance reject a delegated AAIF credential whose scope chain has been silently widened by a re-issuance hop **Date of Record:** 2026 November 21 **Scope:** Applies to any agent that validates Agent-to-Agent Identity Framework (AAIF) verifiable credentials carrying delegated authorization scopes, where the credential was re-issued by an intermediary agent rather than the original issuer. Does not cover root-issuer credential validation, transport-layer mTLS identity, or capability negotiation in MCP `initialize` handshakes. ## Core Distinction The distinction that matters here is between **scope attenuation** and **scope preservation across a re-issuance hop**. AAIF delegation is supposed to be monotonically narrowing: agent A issues a credential to B with scope `S`, B may delegate `S' ⊆ S` to C, and C may delegate `S'' ⊆ S'`. The invariant is that the effective scope at any node in the delegation chain is the intersection of all scopes along the path from the root issuer. The failure mode is not a forged signature. Every signature in the chain validates. The failure is that the **scope set is represented as a flat string array in each hop's `credentialSubject.scope`**, and there is no cryptographic binding between a hop's declared scope and the parent hop's scope beyond the intersective check that the validator is *supposed* to perform. When an intermediary re-issues (rather than re-delegates), it can emit a credential whose `credentialSubject.scope` is a superset of what it actually received—and the child credential is cryptographically valid, signed by a real key, and structurally indistinguishable from a legitimate delegation. The only thing that catches it is a validator that walks the full chain and computes the intersection itself rather than trusting the leaf's declared scope. ## What Was Observed A three-hop chain: root orchestrator `O` → task router `R` → worker `W`. `O` issued `R` a credential with scope `["fs:read:/data/in", "tool:search"]`. `R` was supposed to delegate to `W` with scope `["fs:read:/data/in"]` (dropping `tool:search` because `W` had no search tool bound). Instead, `R`'s re-issuance logic constructed the child credential by copying `R`'s *own* `credentialSubject.scope` array directly, then appending the path restriction as a *separate* claim in `credentialSubject.constraints.path_prefix = "/data/in"`. The resulting `W` credential declared `scope: ["fs:read:/data/in", "tool:search"]` with a path constraint. `W`'s validator checked: (1) signature chain valid — yes; (2) `W`'s credential not expired — yes; (3) `W`'s declared scope is a subset of `R`'s declared scope — yes, it was *equal*, which passes a naive subset check; (4) path constraint satisfied for the requested operation — yes. The validator did **not** check that the path constraint *narrowed* the scope string `fs:read:/data/in`, because the scope string already encoded a path and the constraint was treated as an additional, independent predicate. The result: `W` held an effective capability `tool:search` that `R` had intended to withhold, and `W` exercised it against a search backend that `R` had no authorization to expose. The divergence was caught only when the search backend's audit log showed a caller identity (`W`) whose delegation chain, when manually reconstructed, had `tool:search` present at hop 2 but absent from `R`'s *intent*—which was never recorded anywhere machine-readable. The trace, in order: 1. `O` signs `cred_R` with `scope = ["fs:read:/data/in", "tool:search"]`, `iss = O`, `sub = R`. 2. `R` constructs `cred_W` by shallow-copying its own `credentialSubject.scope` array (a mutation-aliasing bug in the re-issuance helper: `child.scope = parent.scope` rather than `child.scope = intersect(parent.scope, intended)`). 3. `R` appends `constraints.path_prefix = "/data/in"` to `cred_W.credentialSubject`. 4. `R` signs `cred_W` with `iss = R`, `sub = W`, and embeds `cred_R` in `cred_W.proof.delegationChain`. 5. `W`'s validator runs subset check `set(cred_W.scope) ⊆ set(cred_R.scope)` → `{fs:read, tool:search} ⊆ {fs:read, tool:search}` → true. 6. `W` invokes `tool:search` with a query. The tool gateway checks `W`'s credential, sees `tool:search` in scope, permits it. Step 5 is the boundary. The subset check is necessary but not sufficient because it compares the *leaf* scope against the *immediate parent* scope, not the leaf scope against the *composed* scope of the entire chain. When the immediate parent's scope was itself widened by re-issuance, the subset check is satisfied at every hop while the composed intersection is violated. ## Condition of Validity The invariant that must hold for a delegated AAIF credential to be safe to honor is: > For every hop `i` in the delegation chain from root `0` to leaf `n`, the effective scope honored by the leaf must equal `⋂_{i=0}^{n} scope(cred_i)`, and this intersection must be computed over the **declared scope of each credential as issued**, not over the scope the leaf *claims* to have received. Two conditions make this check non-trivial and are where implementations break: **Condition 1 — Re-issuance vs. re-delegation must be distinguishable.** A re-delegation hop produces a child credential whose `issuer` is the parent's `subject` and whose `proof` references the parent credential. A re-issuance hop (an agent minting a fresh credential under its own authority, perhaps because it is acting as a token exchange) produces a credential that may *not* reference the parent at all, or references it only as an advisory hint. If the validator cannot tell these apart, it cannot know whether to compute the intersection or to treat the leaf as a root. In the observed case, `R` was performing re-issuance but emitting a `delegationChain` reference, making it look like re-delegation while behaving like re-issuance. The fix is to require that any credential claiming a `delegationChain` MUST have `scope(child) ⊆ scope(parent)` where the subset relation is evaluated **after** resolving `parent`'s scope from `parent`'s own chain, not from `parent`'s self-declared field. **Condition 2 — Constraints must be folded into scope, not carried alongside.** The path constraint `path_prefix = "/data/in"` was carried as a sibling of the scope array. This is the structural root of the bug: a validator that checks scope-subset and constraint-satisfaction as two independent predicates will pass a credential where the scope is too broad but the constraint happens to be satisfied. The invariant requires that constraints *refine* scope strings—`fs:read:/data/in` under `path_prefix=/data/in` is `fs:read:/data/in`, but `fs:read:/etc` under the same constraint is `∅`. A credential whose scope array contains a string that is *not* satisfiable under its own constraints is malformed and must be rejected, not silently narrowed. ## Decision Boundary An instance must reject the credential—raise, do not degrade—when any of the following hold: - The delegation chain contains a hop whose declared `scope` is not a subset of the **composed** scope of all ancestors, even if it is a subset of its immediate parent. - The credential carries constraints (`path_prefix`, `host_allowlist`, `time_window`) that are not reflected in the scope strings, and the scope strings include capabilities that the constraints do not admit. - The `delegationChain` is present but any referenced credential's `subject` does not equal the referencing credential's `issuer` (a broken chain link that permits scope substitution). - The leaf's declared scope contains a capability that does not appear in the root issuer's scope, regardless of intermediate hops. An instance may *degrade* (honor the intersection it can compute, log the discrepancy) only when the chain is complete, every link is signature-valid, and the only defect is a constraint that narrows rather than widens—i.e., the composed intersection is a strict subset of the leaf's declared scope, and the leaf's declared scope is a subset of every ancestor's declared scope. In that case the safe action is to honor the intersection and emit a `ScopeNarrowed` advisory. The boundary is not "is the signature valid" and not "is the leaf scope a subset of the parent scope." It is "does the composed intersection equal the leaf's declared scope." Anything less is a widening. ## Operational Effect The practical consequence is that AAIF validators must be **chain-walking and intersection-computing**, not **hop-local and subset-checking**. A hop-local validator is cheap (one signature verify, one set comparison) and is what most implementations ship, because it is correct for the common case of honest re-delegation. It fails silently and only under re-issuance, which is exactly the case where an intermediary is doing something non-trivial with authority—token exchange, scope translation, capability brokering. Those are the agents most likely to have a re-issuance bug, and the ones whose credentials are most dangerous when widened. The secondary effect is on auditability. Because the widening was invisible to the leaf validator, the only record of the intended scope was `R`'s internal state, which is not part of the credential. A post-hoc auditor reconstructing the chain from credentials alone would conclude `W` was legitimately granted `tool:search`, because every credential in the chain says so. The invariant that makes the chain auditable is that **each hop's intended scope must be committed into the credential it issues**, so that the composed intersection is recoverable from the credential set without reference to any agent's private state. A re-issuance hop that drops a capability must record the drop, not merely omit it. ## Guardrail Implementation The validator below walks the chain, computes the composed intersection, and rejects on any widening. It treats constraints as scope-refining and rejects scope strings that are unsatisfiable under their own constraints. ```python from dataclasses import dataclass, field from typing import Optional class ScopeWideningError(RuntimeError): """Raised when a delegated AAIF credential's effective scope exceeds the composed intersection of its delegation chain.""" @dataclass class Credential: issuer: str subject: str scope: frozenset[str] constraints: dict = field(default_factory=dict) parent: Optional["Credential"] = None signature_valid: bool = True def _refine(scope: frozenset[str], constraints: dict) -> frozenset[str]: """Fold constraints into scope. A scope string unsatisfiable under the credential's own constraints is dropped; if any string is dropped, the credential is malformed and the caller must reject.""" prefix = constraints.get("path_prefix") if prefix is None: return scope refined = set() for s in scope: # scope strings of form "fs:read:" must lie under prefix parts = s.split(":", 2) if len(parts) == 3 and parts[0] == "fs" and parts[1] == "read": if parts[2].startswith(prefix): refined.add(s) # else: silently dropped -> caller detects via set difference else: refined.add(s) return frozenset(refined) def validate_chain(leaf: Credential) -> frozenset[str]: """Return the effective scope the leaf may honor, or raise.""" chain: list[Credential] = [] node: Optional[Credential] = leaf while node is not None: chain.append(node) node = node.parent chain.reverse() # root first for cred in chain: if not cred.signature_valid: raise ScopeWideningError( f"invalid signature at issuer={cred.issuer} subject={cred.subject}" ) # Link integrity: each child's parent must be issued by the child's issuer. for parent, child in zip(chain, chain[1:]): if child.issuer != parent.subject: raise ScopeWideningError( f"broken chain link: {child.issuer} != {parent.subject}" ) # Constraint refinement: reject if constraints drop any declared scope string. for cred in chain: refined = _refine(cred.scope, cred.constraints) if refined != cred.scope: raise ScopeWideningError( f"scope unsatisfiable under own constraints at issuer={cred.issuer}: " f"declared={sorted(cred.scope)} admitted={sorted(refined)}" ) # Composed intersection. composed = chain[0].scope for cred in chain[1:]: composed = composed & cred.scope # The leaf's declared scope must equal the composed intersection. if leaf.scope != composed: widened = leaf.scope - composed raise ScopeWideningError( f"scope widened: leaf={leaf.subject} declared={sorted(leaf.scope)} " f"composed={sorted(composed)} unauthorized={sorted(widened)}" ) return composed def authorize(leaf: Credential, capability: str) -> None: effective = validate_chain(leaf) if capability not in effective: raise ScopeWideningError( f"capability {capability!r} not in effective scope {sorted(effective)}" ) ```