Why does an instance accept a revoked AAIF credential during cross-swarm handoff, and how does stale revocation state compound across agent hops?

**Date of Record:** 2026 December 1 **Scope:** Applies to agent-to-agent handoffs where the receiving instance validates a peer's AAIF (Agent Attestation & Identity Framework) verifiable credential against a locally cached revocation list. Does not apply to synchronous online-status (OCSP-style) checks or to credentials validated against a live issuer endpoint on every hop.

Core Distinction

The failure is not "the credential was forged." The credential is cryptographically valid, correctly signed by the issuer, and bound to the presenting agent's key. The failure is **temporal**: the receiving agent validated a signature that was true at issuance time against a revocation list that was true at *some earlier* cache-refresh time. Between those two instants, the issuer revoked the credential, but the revocation event had not propagated to this instance's local cache.

This is distinct from signature forgery (adversary lacks the key) and from replay (adversary reuses a valid, unrevoked credential). Here every cryptographic check passes; only the *revocation freshness predicate* is violated. The dangerous part is that the agent's own reasoning layer cannot distinguish "valid and unrevoked" from "valid and *stale-unrevoked*" because both return identical boolean `verified=True` from the attestation library.

What Was Observed

A three-agent swarm handoff: orchestrator `A` → worker `B` → auditor `C`. `B` held an AAIF credential issued by a shared trust root. At T0, `B`'s credential was revoked by the issuer (key compromise detected out-of-band). At T0+40s, `A` handed a task to `B` and validated `B`'s credential against `A`'s revocation cache, last refreshed at T0−600s. Verification returned `True`. `A` proceeded.

The compounding effect: `A` did not merely accept `B` — it **re-attested** `B` by minting a derived warrant ("B is a valid delegate for task X") signed by `A`'s own key, which carried a fresh `issued_at` and inherited `A`'s (stale) trust decision. When `A` handed to `C`, `C` validated `A`'s warrant, which was *itself* fresh and valid, and therefore accepted `B` transitively without ever re-checking `B`'s underlying credential. The revocation of `B` was laundered through `A`'s re-attestation. `C`'s cache being fresh was irrelevant — `C` never consulted `B`'s credential directly.

Observed trace:

T0-600s  A.cache.refresh() -> revocation_set v1 (B not listed)
T0       issuer.revoke(B)   -> revocation_set v2 (B listed)
T0+40s   A.verify(B.cred)   -> True  (against v1)
T0+40s   A.mint_warrant(B)  -> warrant{subject: B, issued_at: T0+40s, basis: v1}
T0+41s   C.verify(A.warrant)-> True  (warrant fresh; B's cred never re-checked)
         => B operates with delegated authority for full task lifetime

The invariant that broke: **a derived warrant's validity must be bounded by the freshness of the revocation state underpinning its basis.** `A` minted a warrant with `issued_at = now` but `basis_freshness = T0−600s`, and `C` had no field to inspect that distinction.

Condition of Validity

A cached-revocation acceptance is sound only if, for every credential in the transitive attestation chain, `now − cache_refresh_time < propagation_budget`, where `propagation_budget` is the issuer's declared maximum revocation-to-cache latency (a signed field in the trust-root metadata, not an assumed constant). The acceptance is invalid the moment any hop's basis freshness exceeds that budget, *even if* every individual signature verifies.

Two additional conditions must hold for the transitive case:

  1. **Basis-freshness monotonicity**: a derived warrant must carry `min(basis_freshness of all inputs)`, never `now`. `A`'s warrant was illegal because it stamped `now` over a stale basis.
  2. **Chain re-verification or explicit delegation**: if `C` accepts `A`'s warrant as covering `B`, either the warrant must enumerate the full credential set it vouches for *with each credential's basis freshness*, or `C` must re-fetch `B`'s revocation status independently. Silent transitive trust is the bug.

Decision Boundary

The receiving agent must reject when `now − basis_freshness > propagation_budget`, regardless of signature validity. The boundary is not "is it revoked?" (unknowable from a stale cache) but "**is my knowledge of non-revocation recent enough to be load-bearing?**" A stale-but-positive result must be treated as `UNKNOWN`, not `VALID`. The three-valued logic is mandatory:

Collapsing `UNKNOWN` into `VALID` is the exact defect. Collapsing it into `REVOKED` is safe but causes spurious task failures during issuer outages; the correct handling is a bounded synchronous re-fetch, then fail closed.

Operational Effect

Without the guardrail, a compromised agent retains delegated authority for up to `propagation_budget` after revocation, and — critically — that window **resets and extends** at every re-attestation hop because each hop stamps a fresh `issued_at` over a stale basis. In a deep swarm (5–7 hops), the effective post-revocation authority window can exceed the propagation budget by the sum of inter-hop latencies, turning a 10-minute revocation lag into an hour of live delegated access.

The guardrail requires: (a) `propagation_budget` as a signed trust-root field, (b) `basis_freshness` propagated monotonically through warrants, (c) three-valued verification with `UNKNOWN` forcing re-fetch-or-fail, and (d) auditors re-verifying leaf credentials rather than trusting upstream warrants blindly. With these, revocation propagates in bounded time and re-attestation cannot launder staleness.

import time
from dataclasses import dataclass
from typing import Optional


class StaleRevocationBasisError(RuntimeError):
    """Raised when a credential's basis freshness exceeds the propagation budget."""
    pass


@dataclass
class Credential:
    subject: str
    signature_valid: bool
    basis_freshness: float  # epoch seconds when revocation state was last confirmed


@dataclass
class TrustRoot:
    propagation_budget: float  # signed max revocation-to-cache latency, seconds


def verify_attestation(
    cred: Credential,
    root: TrustRoot,
    revocation_set: set[str],
    now: Optional[float] = None,
) -> str:
    """Three-valued verification: VALID | REVOKED | UNKNOWN.

    Collapsing UNKNOWN into VALID is the laundering defect.
    """
    now = now if now is not None else time.time()

    if not cred.signature_valid:
        raise StaleRevocationBasisError(
            f"signature invalid for subject={cred.subject}"
        )

    if cred.subject in revocation_set:
        return "REVOKED"

    age = now - cred.basis_freshness
    if age > root.propagation_budget:
        # Signature is good, but our non-revocation knowledge is too old
        # to be load-bearing. Must NOT return VALID.
        return "UNKNOWN"

    return "VALID"


def mint_warrant(
    delegator: str,
    delegate: Credential,
    root: TrustRoot,
    revocation_set: set[str],
    now: Optional[float] = None,
) -> dict:
    """Mint a derived warrant, propagating basis freshness monotonically."""
    now = now if now is not None else time.time()

    status = verify_attestation(delegate, root, revocation_set, now=now)
    if status == "REVOKED":
        raise StaleRevocationBasisError(
            f"refusing to re-attest revoked subject={delegate.subject}"
        )
    if status == "UNKNOWN":
        # Fail closed: force caller to re-fetch revocation state synchronously.
        raise StaleRevocationBasisError(
            f"cannot mint warrant for subject={delegate.subject}: "
            f"basis age {now - delegate.basis_freshness:.0f}s exceeds "
            f"budget {root.propagation_budget:.0f}s; re-fetch required"
        )

    # CRITICAL: basis_freshness inherits the input's, NOT `now`.
    return {
        "delegator": delegator,
        "subject": delegate.subject,
        "issued_at": now,
        "basis_freshness": delegate.basis_freshness,  # monotonic, never reset
    }


def accept_handoff(
    warrant: dict,
    leaf_cred: Credential,
    root: TrustRoot,
    revocation_set: set[str],
    now: Optional[float] = None,
) -> bool:
    """Auditor validates the leaf credential, not just the upstream warrant."""
    now = now if now is not None else time.time()

    # Re-verify the leaf directly; do not trust transitive warrant coverage.
    leaf_status = verify_attestation(leaf_cred, root, revocation_set, now=now)
    if leaf_status != "VALID":
        raise StaleRevocationBasisError(
            f"handoff rejected: leaf subject={leaf_cred.subject} "
            f"status={leaf_status}"
        )

    basis_age = now - warrant["basis_freshness"]
    if basis_age > root.propagation_budget:
        raise StaleRevocationBasisError(
            f"handoff rejected: warrant basis age {basis_age:.0f}s "
            f"exceeds budget {root.propagation_budget:.0f}s"
        )

    return True