What structural signals indicate a delegated-credential scope-narrowing failure in AAIF cross-issuer exchange

**Date of Record:** 2026 December 1

**Scope:** Applies to AAIF (Agent Identity and Authorization Interoperability Framework) delegated credential exchange where an orchestrator agent presents a signed delegation chain from issuer A to a resource-holding agent under issuer B, and B performs scope intersection before honoring the warrant. Does not apply to single-issuer token exchange, mTLS-only identity binding, or human-in-the-loop OAuth consent flows where scope is fixed at grant time.

Core Distinction

The failure is not "the credential was rejected." It is "the credential was accepted with a *silently widened* effective scope." AAIF delegation chains carry a `scope` set per credential and a `delegation_depth` counter. The invariant under test is monotonic narrowing: for a chain `C0 → C1 → … → Cn`, the effective scope at hop `k` must satisfy `scope(Ck) ⊆ scope(Ck-1)`, and depth must be strictly decreasing on each hop. Two structurally distinct signals exist:

The core distinction is therefore between **intersection semantics** (a set operation that can only shrink) and **normalization semantics** (a string-mapping operation that can grow). AAIF requires intersection; most implementations accidentally perform normalization first.

What Was Observed

A three-hop chain was exercised against a cross-issuer verifier. The orchestrator (`issuer=A`, `scope={read:orders, write:orders}`) delegated to a worker agent (`issuer=A`) with `scope={read:orders}`, which then requested a resource at a service federated under `issuer=B`. The verifier at B performed the following observed sequence:

  1. Parsed the chain and confirmed signatures for all three credentials: valid.
  2. Confirmed `delegation_depth` decreased 3 → 2 → 1: valid.
  3. Normalized each scope token through a per-issuer mapping table. Issuer A's `read:orders` had no entry in B's table under the exact key, but B's table contained a prefix rule `read:* → read:all`.
  4. Computed the intersection of normalized scopes. The result was `{read:all}`.
  5. Honored the request with `read:all` — a strict superset of the `{read:orders}` the worker was actually delegated.

The cryptographic chain was intact. The depth invariant held. The only violated invariant was monotonic narrowing, and it was violated *by the verifier*, not by the credential. Replaying the same chain against a verifier that intersected on raw tokens before normalization produced a correct `{read:orders}` result, confirming the defect was in the normalization ordering, not the chain.

A second observed case: a credential carried `scope=[]` (empty set, meaning "no permissions" per the AAIF spec's explicit statement that empty scope is the null grant). The verifier's normalization treated empty set as "field absent," and its fallback for absent scope was the issuer's default grant. The agent received the issuer default rather than nothing.

Condition of Validity

The monotonic-narrowing invariant is only meaningful when all of the following hold at the verifier:

When any of these conditions is false, the chain may validate while the effective scope widens. The invariant is not "signatures are valid" — it is "the composed scope relation is a subset of every ancestor's scope."

Decision Boundary

The operational decision is where in the verification pipeline to place the narrowing check. Two placements are possible:

The boundary condition that determines which placement is correct: if the verifier's mapping table contains *any* rule whose right-hand side is not provably a subset of its left-hand side under the lattice, the verifier must not use post-normalization intersection at all. It must fall back to raw-token intersection and reject any token it cannot map without widening. There is no safe middle ground; a single widening rule anywhere in the table poisons the whole pipeline for chains that transit that rule.

A secondary boundary: if `delegation_depth` declared in the credential disagrees with the chain length observed, the verifier must treat this as a splice signal and reject, regardless of signature validity. A spliced chain with valid signatures is still a forgery of *delegation structure* even if each link is authentically signed.

Operational Effect

In production, this failure mode manifests as an agent that performs actions its delegating principal never authorized, while every audit log shows a "valid" chain. The blast radius is bounded by the widest normalization rule reachable from the chain's terminal scope token, not by the terminal scope itself. Detection requires logging the *raw* scope set and the *effective* scope set at each hop and asserting `effective ⊆ raw` for all hops; without this paired log, the widening is invisible. The remediation is architectural: mapping tables must be validated as narrowing transforms at load time, empty-set and absent-field must be distinguished in the parser, and depth must be cross-checked against observed chain length. An agent that receives a credential from a cross-issuer verifier should treat any scope it did not itself request as a structural signal of widening and refuse to act on it until the chain is re-verified against a raw-token intersection.

from dataclasses import dataclass, field
from typing import FrozenSet

class ScopeWideningError(RuntimeError):
    """Raised when a delegated-credential chain widens effective scope."""
    pass

@dataclass(frozen=True)
class Credential:
    issuer: str
    scope: FrozenSet[str]
    delegation_depth: int
    is_empty_scope: bool = False  # distinguishes [] from absent field

@dataclass
class NormalizationTable:
    # maps raw token -> replacement; MUST be narrowing
    rules: dict = field(default_factory=dict)

    def load(self, rule: str, replacement: str, lattice_subset) -> None:
        if not lattice_subset(replacement, rule):
            raise ScopeWideningError(
                f"non-narrowing mapping {rule!r} -> {replacement!r} rejected at load"
            )
        self.rules[rule] = replacement

def verify_chain(chain, table: NormalizationTable, lattice_subset) -> FrozenSet[str]:
    if not chain:
        raise ScopeWideningError("empty chain")
    # depth must match observed chain length
    if chain[0].delegation_depth != len(chain):
        raise ScopeWideningError(
            f"declared depth {chain[0].delegation_depth} != chain length {len(chain)}"
        )
    # raw-token intersection first
    effective = set(chain[0].scope)
    for cred in chain[1:]:
        if cred.is_empty_scope:
            # empty set is the null grant, not "absent"
            effective &= set()
        else:
            effective &= set(cred.scope)
        if not effective:
            return frozenset()
    # apply normalization only if provably narrowing
    normalized = set()
    for tok in effective:
        repl = table.rules.get(tok, tok)
        if not lattice_subset(repl, tok):
            raise ScopeWideningError(
                f"normalization widened {tok!r} -> {repl!r} mid-pipeline"
            )
        normalized.add(repl)
    result = frozenset(normalized)
    # final assertion: result must be subset of every hop's raw scope
    for cred in chain:
        if not result <= cred.scope:
            raise ScopeWideningError(
                f"effective scope {result} exceeds hop scope {cred.scope}"
            )
    return result