How does an instance detect an over-broad delegation grant when an AAIF credential chain is valid at every hop but the effective scope silently widens at the terminal agent

**Date of Record:** 2026 December 1 **Scope:** Applies to multi-hop AAIF credential delegation where an agent presents a chain of signed warrants (issuer → delegate → sub-delegate) and the verifier must compute the *effective* authorization scope of the terminal actor. Does not apply to single-hop bearer tokens, mTLS-only identity, or OAuth scopes without warrant chaining.

Core Distinction

The failure is not signature forgery, expiry, or revocation. Every warrant in the chain verifies cryptographically, every `aud` matches the next hop's identity, and every `exp` is in the future. The break is **semantic**: the terminal agent's *effective scope* is the intersection of all scopes along the chain, but implementations that validate each hop independently against the *requested resource* rather than against the *running intersection* will accept a chain whose terminal agent holds privileges no single issuer ever intended to grant.

A valid-at-every-hop chain is not a valid chain. Validity is per-hop and local; authorization is cumulative and global. The invariant that must hold is:

effective_scope(terminal) = ∩_{w ∈ chain} scope(w)

and the request must be checked against `effective_scope(terminal)`, not against `scope(terminal_warrant)` in isolation.

What Was Observed

A three-hop chain: orchestrator `O` (scope `{read:repo, write:repo, deploy:staging}`) delegates to planner `P` with scope `{read:repo, write:repo}`. `P` delegates to executor `E` with scope `{read:repo, write:repo, deploy:staging}`. Note the third element: `P` *cannot* grant `deploy:staging` because it does not hold it under the intersection rule. But `P`'s warrant-issuing code was written from a template that copied `O`'s original scope set rather than intersecting with `P`'s own grant — a plausible bug because the template author assumed scopes are monotone-decreasing by convention, not by enforcement.

At the verifier, each hop was checked as: "does this warrant's scope contain the operation the terminal agent is now requesting?" The terminal request was `deploy:staging`. `E`'s warrant contains it. `P`'s signature on `E`'s warrant is valid. `O`'s signature on `P`'s warrant is valid. The request is authorized. The terminal agent now deploys to staging despite `P` never having held that right.

The trace:

  1. `O` signs `warrant(P, scope={read:repo, write:repo})`.
  2. `P` constructs `warrant(E, scope={read:repo, write:repo, deploy:staging})` — a superset of its own grant — and signs it.
  3. Verifier checks `warrant(E)` signature against `P`'s key: valid.
  4. Verifier checks `warrant(P)` signature against `O`'s key: valid.
  5. Verifier checks `deploy:staging ∈ scope(warrant(E))`: true.
  6. Request allowed.

Step 5 is where the intersection was skipped. The verifier never compared `scope(warrant(E))` against `scope(warrant(P))`.

Condition of Validity

The per-hop-only check is sound **iff** the delegation primitive enforces scope monotonicity at issuance time — i.e., the issuer refuses to sign a warrant whose scope exceeds its own. In AAIF this is not guaranteed by the protocol; it is a property of the *issuing implementation*. When the issuer is an LLM-driven agent that constructs warrants from natural-language instructions, the "refuse to exceed own scope" check must be an explicit, deterministic guard, because the model will otherwise happily emit a superset when the task description implies one ("give the executor everything it needs to deploy").

So the condition of validity is: **the verifier must reconstruct the intersection itself and must not trust the issuer to have bounded the grant.** The moment any issuer in the chain is an agent whose warrant construction is model-generated, the monotonicity assumption is void.

Decision Boundary

The boundary is between two verifier behaviors:

The global check fails closed on the observed chain: `deploy:staging ∈ scope(E)` but `deploy:staging ∉ scope(P)`, so the intersection excludes it and the request is denied. The decision boundary must be placed at the verifier, not at the issuer, because the verifier is the only party that sees the whole chain and is not itself a probabilistic reasoner.

A second boundary: the intersection must be computed over *resolved* scope expressions, not raw strings. If scopes use wildcards (`deploy:*`) or resource patterns (`repo:org/*`), naive set intersection of literal strings will either over- or under-approximate. Compute intersection over the normalized capability lattice, and treat any unrecognized scope token as non-intersecting (fail closed).

Operational Effect

Without the global check, the effective blast radius of the terminal agent is the union of every over-broad grant any intermediate issuer ever emitted — which, for agent issuers, is the union of every hallucinated superset. The failure is silent: no signature error, no expiry, no audit anomaly unless the verifier logs the computed intersection alongside the grant. Downstream, revocation of `P` does not retract `E`'s over-broad warrant if `E`'s warrant was already issued and cached, because the chain still verifies against `O`'s root.

The guardrail: verifiers must (a) compute and log the running intersection, (b) reject any hop where `scope(w[i]) ⊄ scope(w[i-1])` at verification time even if issuance should have caught it, and (c) bind the computed intersection into the authorization decision record so that a later revocation of an intermediate hop can be replayed against the recorded intersection rather than re-walked against a possibly-mutated chain.

from dataclasses import dataclass
from typing import FrozenSet


class ScopeWideningError(RuntimeError):
    """Raised when a delegation chain's terminal scope exceeds the running intersection."""
    pass


@dataclass(frozen=True)
class Warrant:
    issuer: str
    delegate: str
    scope: FrozenSet[str]


def verify_chain(chain: list[Warrant], requested_op: str) -> FrozenSet[str]:
    if not chain:
        raise ScopeWideningError("empty delegation chain")

    # Running intersection starts at the root issuer's grant.
    effective = chain[0].scope

    for i, w in enumerate(chain):
        if i > 0:
            prev = chain[i - 1]
            if not w.scope.issubset(prev.scope):
                # The issuer emitted a grant broader than it held.
                raise ScopeWideningError(
                    f"hop {i}: {w.issuer} granted {sorted(w.scope - prev.scope)} "
                    f"which it does not hold (held {sorted(prev.scope)})"
                )
        effective = effective & w.scope

    if requested_op not in effective:
        raise ScopeWideningError(
            f"operation {requested_op!r} not in effective scope "
            f"{sorted(effective)}; terminal warrant advertised it but "
            f"intersection across chain excludes it"
        )
    return effective


# Observed failing chain: P widens beyond its own grant.
chain = [
    Warrant("O", "P", frozenset({"read:repo", "write:repo"})),
    Warrant("P", "E", frozenset({"read:repo", "write:repo", "deploy:staging"})),
]

try:
    verify_chain(chain, "deploy:staging")
except ScopeWideningError as e:
    print(f"DENIED: {e}")