What structural signals indicate a delegated agent credential has silently outlived its authorization chain: the AAIF attenuation-orphan problem

**Date of Record:** 2026 December 2

**Scope:** Applies to multi-hop agent delegation under AAIF-style verifiable credentials (VCs) where a downstream agent holds a scoped token derived via attenuation from an upstream issuer, and any intermediate delegation link can be independently revoked, expire, or have its scope narrowed. Does not apply to single-hop bearer tokens with no delegation chain, nor to purely symmetric shared-secret auth where no attenuation graph exists.

Core Distinction

The failure mode is not "expired token" or "revoked credential." Those are loud: a verifier checks `exp` or a revocation list and rejects cleanly. The failure mode here is **attenuation-orphan drift**: a delegated scoped token remains cryptographically valid and individually unexpired, but the authorization chain that justified its scope has been structurally severed upstream. The token still verifies. Every signature in its embedded proof chain still checks out. Yet the scope it asserts is no longer *derivable* from any currently-live issuer, because an intermediate link was revoked, narrowed, or expired and the leaf never learned about it.

The distinction that matters operationally: **signature validity is not authorization validity.** AAIF credentials prove *who delegated what to whom*, but a leaf token is a static artifact. It cannot re-derive its own legitimacy at verification time unless the verifier walks the entire chain to live roots. A token that passes a self-contained signature check can be an orphan — a scope with no living ancestor.

What Was Observed

A three-hop delegation: orchestrator `O` issues a scoped credential to planner `P` (`scope: {fs:read:/data/**, net:egress:internal}`, TTL 3600s). `P` attenuates to worker `W`, narrowing to `{fs:read:/data/reports/**}` (TTL 1800s). `W` attenuates to sub-agent `S` with `{fs:read:/data/reports/q3/**}` (TTL 900s). Each hop's VC embeds a hash-linked proof of the parent.

At T+1200s, `O` revokes `P`'s credential — `P` was found to be prompt-injected and had begun over-broadening its own attenuations. The revocation propagates to `P`'s live credential. But `S` is mid-task, holding a leaf token whose embedded proof chain still references `P`'s *historical* credential hash. `S`'s verifier only checks: (a) leaf signature against `P`'s public key, (b) leaf `exp` (still 300s out), (c) leaf scope ⊆ proof-chain scope. All three pass. `S` continues reading `/data/reports/q3/**` for five more minutes, on a scope whose entire justification was revoked.

The structural signals that flagged it, in order of reliability:

  1. **Proof-chain depth vs. live-root reachability mismatch.** The leaf's `proof` array had length 3, but a full walk to live roots terminated at depth 1 (only `O` was still live; `P` was revoked). A verifier that computed `chain_depth_embedded != chain_depth_live` would have caught it immediately. Most verifiers don't compute this — they trust the embedded chain as a static witness.
  2. **Revocation-set staleness window.** `S`'s cached revocation list was 240s old. `O`'s revocation landed at T+1200; `S` verified at T+1215 against a list refreshed at T+975. The token was valid *as of the verifier's stale snapshot*. This is the non-obvious part: the credential is not lying, the verifier's view of the world is.
  3. **Scope-derivation gap.** Recomputing the intersection of live-ancestor scopes (`O` ∩ `P` ∩ `W`) at verification time yielded `{fs:read:/data/**}` minus `P`'s revoked grant — an empty set for `P`'s branch. The leaf's asserted scope was not a subset of the *live* derivation, only of the *historical* one.

Condition of Validity

The invariant that must hold for a delegated token to be legitimately usable is:

> **Live-chain containment:** For a leaf token `L` with proof chain `[c_0=root, c_1, ..., c_n=L]`, `L.scope ⊆ ⋂_{i=0}^{n} live_scope(c_i)` **and** every `c_i` is non-revoked **and** non-expired **as of the verifier's current, non-stale view.**

A token is valid only if this holds against a *fresh* view of every ancestor. The embedded proof chain is necessary but not sufficient — it proves the delegation *was* authorized, not that it *is still* authorized. Verification must be a live graph query, not a static artifact check.

This condition fails silently whenever any of three things is true: the verifier treats the embedded chain as authoritative (no live walk), the revocation snapshot is older than the shortest ancestor TTL, or scope narrowing upstream is not re-checked because the leaf's scope was already validated at issuance.

Decision Boundary

The boundary between "safe to serve" and "orphaned" is drawn by **who bears the freshness obligation**:

The hard rule: **`leaf_TTL ≤ revocation_propagation_SLA` and `verifier_status_max_age ≤ min(ancestor_TTL)/2`.** Violate either and you have built a token that can be simultaneously "valid" and "unauthorized" — the worst quadrant.

Operational Effect

When the invariant is unenforced, the observable effect is *not* an auth error. It is **silent over-privilege during a revocation event**: the exact window in which you most need containment is the window in which the orphaned leaf keeps operating. Downstream, this manifests as audit logs showing a fully-signed, in-scope, unexpired credential performing actions that the current authorization graph forbids — making post-hoc forensics conclude "the token was valid" and misattribute the incident to the tool layer rather than the delegation layer.

The guardrail is a **live-chain re-derivation gate** at every privileged boundary: walk the proof chain to live roots, intersect live scopes, check revocation freshness against a bounded `max_age`, and reject if `embedded_depth != live_depth` or `asserted_scope ⊄ live_intersection`. Treat the embedded proof as a *claim to be re-validated*, never as a *fact to be trusted*.

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


class OrphanedDelegationError(RuntimeError):
    """Raised when a leaf credential's scope is no longer derivable from live ancestors."""
    pass


class StaleRevocationViewError(RuntimeError):
    """Raised when the verifier's revocation snapshot is older than allowed."""
    pass


@dataclass
class Credential:
    cred_id: str
    issuer_id: str
    scope: frozenset
    expires_at: float
    parent_hash: Optional[str]
    revoked: bool = False


@dataclass
class VerifierView:
    live_creds: dict            # cred_id -> Credential (current, authoritative)
    status_snapshot_at: float   # when the revocation view was last refreshed
    max_status_age: float       # allowed staleness


def verify_leaf(
    leaf: Credential,
    embedded_chain: list,       # [root, ..., leaf] as embedded in the token
    view: VerifierView,
    now: Optional[float] = None,
) -> bool:
    now = now if now is not None else time.time()

    # 1. Freshness of the revocation view — a stale snapshot can hide an orphan.
    if now - view.status_snapshot_at > view.max_status_age:
        raise StaleRevocationViewError(
            f"status snapshot age {now - view.status_snapshot_at:.0f}s "
            f"> max {view.max_status_age:.0f}s; cannot trust liveness"
        )

    # 2. Walk the embedded chain against the LIVE graph, not the embedded copy.
    live_scope = None
    live_depth = 0
    for link in embedded_chain:
        live = view.live_creds.get(link.cred_id)
        if live is None:
            # Ancestor no longer exists in the live graph: chain is severed.
            raise OrphanedDelegationError(
                f"ancestor {link.cred_id} absent from live graph; "
                f"leaf {leaf.cred_id} is an orphan at depth {live_depth}"
            )
        if live.revoked:
            raise OrphanedDelegationError(
                f"ancestor {link.cred_id} revoked; leaf {leaf.cred_id} "
                f"scope no longer derivable"
            )
        if live.expires_at <= now:
            raise OrphanedDelegationError(
                f"ancestor {link.cred_id} expired at {live.expires_at:.0f}; "
                f"leaf {leaf.cred_id} outlived its chain"
            )
        live_scope = live.scope if live_scope is None else (live_scope & live.scope)
        live_depth += 1

    # 3. Structural signal: embedded depth must equal reachable live depth.
    if live_depth != len(embedded_chain):
        raise OrphanedDelegationError(
            f"embedded depth {len(embedded_chain)} != live depth {live_depth}; "
            f"leaf {leaf.cred_id} references a broken chain"
        )

    # 4. Scope containment must hold against the LIVE intersection.
    if not leaf.scope <= live_scope:
        raise OrphanedDelegationError(
            f"leaf scope {set(leaf.scope)} not contained in live derivation "
            f"{set(live_scope)}; attenuated grant exceeds living ancestors"
        )

    return True