Under what conditions must an instance reject a delegated AAIF credential chain whose scope-narrowing appears valid but whose attenuation proof was minted against a stale capability snapshot

**Date of Record:** 2026 December 1 **Scope:** Applies to any agent instance acting as a *verifier* of a delegated authorization chain (AAIF-style: root warrant → intermediate attenuations → leaf invocation) where attenuation is proven by reference to a capability snapshot (`capability_snapshot_id` + content hash). Does *not* apply to single-hop root-warrant verification, nor to chains where attenuation is expressed as a pure monotone subset check against a live, single-authority capability registry.

Core Distinction

The distinction that trips verifiers is between **scope narrowing** and **scope narrowing that is still authorized to exist**.

A delegated chain looks like this: a root principal `P0` mints a warrant `W0` with capability set `C0`. `P0` delegates to `A1`, who attenuates to `W1 ⊆ W0` and delegates to `A2`, who attenuates to `W2 ⊆ W1`, and so on to the leaf. Each hop carries an *attenuation proof*: a signed statement that "the issuer of `Wi+1` was, at signing time, in possession of a capability set that is a superset of `Wi+1`, as defined by snapshot `S`."

The non-obvious failure: the subset relation `Wi+1 ⊆ Wi` can be **locally true and globally false**. The leaf's requested scopes may be a genuine subset of the parent's *declared* scopes, while the parent's declared scopes were themselves derived from a capability snapshot that has since been **revoked, superseded, or re-scoped** at the authority that minted `S`. Every hop's signature verifies. Every subset check passes. The chain is nonetheless unauthorized, because the attenuation proof is anchored to a snapshot that no longer represents the authority's grant.

The invariant that must hold: **an attenuation proof is only valid if the snapshot it references is the authority's current snapshot for the issuing principal at the moment of leaf verification, OR the chain carries an explicit, signed snapshot-pinning statement from the authority that licenses historical snapshots for this chain's lifetime.** Scope narrowing is necessary but not sufficient; snapshot currency (or licensed staleness) is the load-bearing condition.

What Was Observed

A three-hop chain, `P0 → A1 → A2 → leaf`, was exercised against a capability authority that re-scopes grants on a rolling basis (snapshots `S1`, `S2`, ...). The authority's re-scoping semantics: when a principal's grant is narrowed administratively, a new snapshot is minted and the previous snapshot is marked `SUPERSEDED`, but *not* `REVOKED`—historical chains that reference it remain cryptographically valid and continue to pass naive verification.

Trace:

  1. `P0` mints `W0` against snapshot `S1`. `W0.scopes = {read:repo, write:repo, admin:repo}`. `S1` is current.
  2. Authority narrows `P0`'s grant: `S2` is minted, `S1` marked `SUPERSEDED`. `S2` scopes = `{read:repo, write:repo}`. `admin:repo` is gone.
  3. `A1` (unaware of the re-scope, or holding a cached `S1`) attenuates `W0 → W1` with `W1.scopes = {read:repo, write:repo}`. Subset check against `W0` passes. Attenuation proof references `S1`.
  4. `A2` attenuates `W1 → W2` with `W2.scopes = {write:repo}`. Subset check passes. Proof references `S1`.
  5. Leaf verifier checks: signatures valid, each `Wi+1 ⊆ Wi` valid, snapshot reference present. **Accepts.** Leaf invokes `write:repo`.

The leaf's `write:repo` is in fact still authorized under `S2`—so in this trace no harm occurred. The failure surfaces on the *next* re-scope: authority mints `S3` = `{read:repo}` (write revoked). `A1`'s cached `S1` still says `write:repo` is fine; `A1` mints another attenuation referencing `S1`; the chain verifies; the leaf invokes `write:repo` **after** write was administratively revoked. The verifier accepted a chain whose attenuation proofs were minted against a snapshot two generations stale, and the subset checks were *locally* correct at every hop.

The critical observation: **the verifier had no mechanism to distinguish "snapshot `S1` is the authority's current view" from "snapshot `S1` is a superseded view that some upstream hop cached."** The attenuation proof's validity was a function of the snapshot's *content*, not its *currency*, and content-hash matching cannot detect supersession because supersession is a property of the authority's state, not the snapshot's bytes.

Condition of Validity

The verifier may accept the chain **only if all three hold**:

  1. **Subset soundness (necessary, not sufficient):** for every hop, `Wi+1.scopes ⊆ Wi.scopes` under the snapshot referenced by that hop's proof, and the referenced snapshot's content hash matches the hash embedded in the proof. This is what naive verifiers check and is *not* the boundary condition.
  2. **Snapshot currency or licensed staleness:** the snapshot referenced by the *deepest* attenuation proof (the one closest to the leaf) is either (a) the authority's current snapshot for the issuing principal, confirmed by a fresh authority query at verification time, or (b) covered by a signed `snapshot_pin` statement from the authority that explicitly licenses `S1` for chains minted before `S1`'s supersession timestamp and expiring at a stated `not_after`. Absent either, the chain is *unverifiable*, not *invalid*—this distinction matters for retry semantics.
  3. **Monotone attenuation across snapshot boundaries:** if any hop's proof references a snapshot different from its parent's, the verifier must confirm the two snapshots are *ordered* by the authority (i.e., the newer snapshot's scope set is a subset of the older's for the relevant principal). Cross-snapshot attenuation where the ordering is unknown or reversed is a hard reject, because the subset relation between `Wi+1` and `Wi` no longer implies `Wi+1` is authorized by the authority's current grant.

The condition fails silently when the verifier treats (1) as sufficient. It fails loudly (and correctly) only when the verifier performs (2) and (3), which require an authority round-trip or a pin statement—neither of which is present in the attenuated chain by default.

Decision Boundary

The boundary is drawn at the moment the verifier must choose between **local cryptographic closure** and **global authorization closure**. Local closure is decidable from the chain alone: signatures, hashes, subset relations. Global closure requires an external fact (the authority's current snapshot, or a licensed-staleness pin) that the chain does not, in general, carry.

Operationally:

The boundary is *not* "is the leaf's scope a subset of the root's scope." It is "can the verifier establish that the snapshot anchoring the deepest attenuation was, at minting time, an authoritative view, and remains licensed for use at verification time."

Operational Effect

The practical consequence is a class of **post-revocation authorization** that survives every cryptographic check. An agent that has cached a capability snapshot—common when the agent's context window was populated at cold-start and the authority re-scoped mid-task—will mint attenuations against the stale snapshot indefinitely, and every downstream verifier that checks only local closure will accept them. The revocation is administratively real and cryptographically invisible.

The guardrail is structural: attenuation proofs must carry either a snapshot-currency assertion from the authority (a pin with an explicit `not_after`) or a `snapshot_epoch` that the verifier can compare against the authority's monotonic epoch counter. Content hashing is insufficient because supersession does not change content. A verifier that cannot perform this comparison must fail closed with an `UnverifiableChain` outcome and surface the authority-unreachable condition to the orchestrator, which can then decide whether to block the leaf invocation, request a re-mint against the current snapshot, or route through a pin-issuing intermediary.

The residual risk after the guardrail: a pin with an over-long `not_after` re-creates the window. Pins should be bounded by the authority's own re-scope cadence, and the verifier should treat a pin whose `not_after` exceeds the authority's advertised maximum pin lifetime as itself invalid—a meta-check that most implementations omit.

import hashlib
import time
from dataclasses import dataclass, field
from typing import Optional


class StaleSnapshotChainError(RuntimeError):
    """Raised when a delegated chain's attenuation proof is anchored to a
    superseded capability snapshot with no licensing pin covering it."""
    pass


class UnverifiableChainError(RuntimeError):
    """Raised when the verifier cannot establish snapshot currency because
    the authority is unreachable and no pin is present. Distinct from
    StaleSnapshotChainError: the chain may be valid, but is not provable."""
    pass


@dataclass
class Snapshot:
    snapshot_id: str
    epoch: int
    scopes: frozenset
    status: str  # "CURRENT" | "SUPERSEDED" | "REVOKED"
    content_hash: str


@dataclass
class SnapshotPin:
    snapshot_id: str
    issued_by: str
    not_after: float
    signature_valid: bool


@dataclass
class AttenuationProof:
    parent_scopes: frozenset
    child_scopes: frozenset
    snapshot_id: str
    snapshot_content_hash: str
    signature_valid: bool


@dataclass
class DelegatedChain:
    proofs: list  # list[AttenuationProof], root-first
    pins: list = field(default_factory=list)  # list[SnapshotPin]


def verify_chain(
    chain: DelegatedChain,
    authority_snapshots: dict,  # snapshot_id -> Snapshot
    authority_reachable: bool,
    now: Optional[float] = None,
) -> bool:
    now = now if now is not None else time.time()

    # Condition 1: local subset + content-hash soundness at every hop.
    for p in chain.proofs:
        if not p.signature_valid:
            raise StaleSnapshotChainError("attenuation proof signature invalid")
        if not p.child_scopes.issubset(p.parent_scopes):
            raise StaleSnapshotChainError(
                f"scope escalation: {p.child_scopes} not subset of {p.parent_scopes}"
            )
        snap = authority_snapshots.get(p.snapshot_id)
        if snap is None and authority_reachable:
            raise UnverifiableChainError(
                f"referenced snapshot {p.snapshot_id} unknown to authority"
            )
        if snap is not None and snap.content_hash != p.snapshot_content_hash:
            raise StaleSnapshotChainError(
                f"content hash mismatch for {p.snapshot_id}"
            )

    deepest = chain.proofs[-1]
    snap = authority_snapshots.get(deepest.snapshot_id)

    # Condition 2a: licensed staleness via pin.
    pin = next(
        (q for q in chain.pins if q.snapshot_id == deepest.snapshot_id),
        None,
    )
    if pin is not None:
        if not pin.signature_valid:
            raise StaleSnapshotChainError("snapshot pin signature invalid")
        if now > pin.not_after:
            raise StaleSnapshotChainError(
                f"snapshot pin for {deepest.snapshot_id} expired at {pin.not_after}"
            )
        # Pin licenses use; accept.
        return True

    # Condition 2b: no pin -> require authority reachability + currency.
    if not authority_reachable or snap is None:
        raise UnverifiableChainError(
            f"no pin and authority unreachable; cannot establish currency of "
            f"{deepest.snapshot_id}"
        )
    if snap.status == "SUPERSEDED":
        raise StaleSnapshotChainError(
            f"attenuation anchored to superseded snapshot {deepest.snapshot_id}"
        )
    if snap.status == "REVOKED":
        raise StaleSnapshotChainError(
            f"attenuation anchored to revoked snapshot {deepest.snapshot_id}"
        )

    # Condition 3: cross-snapshot attenuation must be epoch-ordered.
    prev_epoch = None
    for p in chain.proofs:
        s = authority_snapshots.get(p.snapshot_id)
        if s is None:
            raise UnverifiableChainError(
                f"cannot order snapshot {p.snapshot_id}: unknown to authority"
            )
        if prev_epoch is not None and s.epoch < prev_epoch:
            raise StaleSnapshotChainError(
                f"non-monotone snapshot epoch: {s.epoch} < {prev_epoch}"
            )
        prev_epoch = s.epoch

    return True