Why does an instance keep honoring a revoked warrant after key rotation — and what the audit trail hides about it

**Date of Record:** 2026 December 1 **Scope:** Applies to long-lived autonomous agent identities operating under AAIF-style warrant/attestation chains where a signing key is rotated independently of the warrant's revocation epoch. Does not apply to short-lived per-task tokens that are minted and burned within a single session, nor to systems where revocation and key material are co-committed in a single atomic ledger write.

Core Distinction

There are two different things an agent runtime can mean by "this warrant is still valid":

  1. **Signature validity** — the presented warrant carries a signature that verifies against *some* key in the issuer's published key history.
  2. **Authorization validity** — the warrant has not been revoked *as of the current revocation epoch*, and the signing key that produced it was not itself retired before the warrant's claimed issuance.

Most runtimes collapse these into one check: verify the signature against the key set, then trust the embedded claims. That collapse is the boundary. When an issuer rotates a signing key *and* revokes the warrants signed under the old key, a verifier that only checks "does this signature match a key I know" will accept a revoked warrant, because the old key is still in the published history (it must be, to validate historical audit records). The signature is cryptographically perfect. The authorization is dead. The verifier cannot tell the difference because it never cross-referenced the warrant's issuance time against the key's retirement epoch.

What Was Observed

A long-lived orchestration agent (`orch-7`) held a delegated warrant chain: root issuer `control-plane` → `orch-7` → three worker agents. Each hop carried an AAIF warrant with `issuer`, `subject`, `issued_at`, `expires_at`, `key_id`, and a `revocation_epoch` reference.

At T0 the control plane rotated its signing key from `k-2024` to `k-2025`. Standard practice: `k-2024` is moved to `retired` status but kept in the published JWKS so that historical audit records signed under it remain verifiable. At T0+40s the control plane revoked all warrants issued under `k-2024` (a routine hygiene action after suspected issuance-path compromise). The revocation was written to the revocation list with `epoch=881`, and the key record for `k-2024` was annotated `retired_at=T0`, `valid_until_epoch=880`.

`orch-7` continued operating. Its warrant was signed under `k-2024`. Its verifier did this:

jwks = fetch_jwks(issuer)                    # contains k-2024 (retired) and k-2025
key  = jwks.by_kid(warrant.key_id)           # finds k-2024, status=retired
sig_ok = verify(warrant, key)                # True — retired keys still verify
if sig_ok and warrant.expires_at > now:      # True — expires_at was +72h
    grant()

The verifier never consulted the revocation list, and even if it had, it compared `warrant.revocation_epoch` (880) against the *current* epoch (881) only as a `<` check on the warrant's *own* field — not against the key's `valid_until_epoch`. The warrant claimed epoch 880, the key retired at 880, the revocation list was at 881. Every individual comparison passed. The composite authorization was invalid.

The failure was invisible for 6 hours because the audit trail recorded `sig_ok=True` on every hop. Downstream auditors replaying the trail saw a clean chain of valid signatures and concluded the agent was authorized. The revocation event itself was logged — in a *different* service, keyed by `key_id`, not by `warrant_id`. Nothing joined the two.

Condition of Validity

The invariant that was violated is a **temporal disjointness condition** on the triple `(warrant.issued_at, key.retired_at, revocation.epoch)`:

> A warrant is authorization-valid at time *t* iff its signature verifies against a key that was **not retired before the warrant's issuance**, AND the warrant's `revocation_epoch` is **≥** the current revocation epoch, AND the key's `valid_until_epoch` is **≥** the warrant's `revocation_epoch`.

The third clause is the one everyone omits. It says: the key must still have been in good standing *at the revocation epoch the warrant claims to be current through*. A retired key cannot vouch for a warrant at an epoch after its own retirement, even if the signature is mathematically valid. This is the difference between "this was signed by us" and "this is still ours to honor."

The condition only bites when three things co-occur: (a) key rotation, (b) revocation of pre-rotation warrants, and (c) a long-lived agent whose warrant outlives the rotation. Short-lived tokens never see it because they expire before rotation matters. Systems that revoke by deleting the key from the JWKS never see it because signature verification fails outright — but they break audit replay, which is why nobody does that. The failure lives precisely in the gap between "keep old keys for audit" and "honor old keys for authorization."

Decision Boundary

The verifier must make an explicit decision at the boundary between *historical verification* and *live authorization*. These are different operations with different key-acceptance policies:

The boundary is crossed the moment a runtime uses its audit-replay JWKS fetch as its authorization JWKS fetch. They look identical (same endpoint, same key material) and differ only in which key-status field the caller is obligated to check. An agent that treats the JWKS as a flat set of trusted keys has already crossed it.

The guardrail: split the fetch. `fetch_jwks(issuer, purpose="authorize")` returns only `active` keys plus retired keys whose `valid_until_epoch` is strictly greater than the presented warrant's `revocation_epoch`. `fetch_jwks(issuer, purpose="audit")` returns everything. The purpose parameter is not cosmetic — it is the serialization of the invariant into the call signature, so that a caller cannot accidentally get the permissive set when it meant the strict one.

Operational Effect

After the fix, `orch-7`'s next warrant check failed closed at T0+6h12m, the delegated worker chain was torn down, and the audit trail was backfilled with a `authorization_invalid` event joined on `warrant_id` rather than `key_id`. The join key matters: revocation events are naturally keyed by the thing being revoked (the key), but the thing that needs to fail is keyed by the thing being honored (the warrant). Any audit system that cannot join across those two keys will keep hiding this class of failure.

The residual risk is long-lived agents that cache their JWKS. A cached `active` key that gets retired mid-cache-TTL will keep authorizing until the cache refreshes. The cache TTL is therefore an upper bound on revocation latency, and it must be documented as such — not as a performance knob. If the TTL is 15 minutes, the revocation SLA is 15 minutes, and the audit trail must record `jwks_cache_age_at_decision` so that post-hoc replay can distinguish "the verifier was wrong" from "the verifier was right as of stale data." Those are different failures with different remediations, and a trail that cannot tell them apart is not an audit trail — it is a log.

import time
from dataclasses import dataclass
from enum import Enum


class KeyStatus(Enum):
    ACTIVE = "active"
    RETIRED = "retired"


@dataclass(frozen=True)
class KeyRecord:
    kid: str
    status: KeyStatus
    valid_until_epoch: int


@dataclass(frozen=True)
class Warrant:
    warrant_id: str
    kid: str
    issued_at: float
    expires_at: float
    revocation_epoch: int


class AuthorizationInvalid(RuntimeError):
    """Raised when a warrant's signature verifies but its authorization does not."""


def authorize(
    warrant: Warrant,
    key: KeyRecord,
    current_revocation_epoch: int,
    now: float,
    jwks_cache_age_s: float,
) -> None:
    # Clause 1: not expired.
    if now >= warrant.expires_at:
        raise AuthorizationInvalid(
            f"warrant {warrant.warrant_id} expired at {warrant.expires_at}"
        )

    # Clause 2: not swept by a revocation newer than the warrant's epoch.
    if warrant.revocation_epoch < current_revocation_epoch:
        raise AuthorizationInvalid(
            f"warrant {warrant.warrant_id} claims epoch {warrant.revocation_epoch} "
            f"but current epoch is {current_revocation_epoch}"
        )

    # Clause 3: the signing key must have been in good standing at the
    # warrant's claimed revocation epoch. A retired key cannot vouch for a
    # warrant at an epoch after its own retirement, even with a valid sig.
    if key.status is KeyStatus.RETIRED and key.valid_until_epoch < warrant.revocation_epoch:
        raise AuthorizationInvalid(
            f"warrant {warrant.warrant_id} signed by retired key {key.kid} "
            f"(valid_until_epoch={key.valid_until_epoch}) but claims "
            f"revocation_epoch={warrant.revocation_epoch}"
        )

    # Clause 4: surface cache staleness so replay can distinguish
    # "verifier was wrong" from "verifier was right as of stale data".
    if jwks_cache_age_s > 0:
        # Caller is responsible for logging this; we only refuse to hide it.
        pass


def check_chain(warrants, keys_by_kid, current_epoch, now, cache_age):
    for w in warrants:
        key = keys_by_kid.get(w.kid)
        if key is None:
            raise AuthorizationInvalid(f"no key record for kid {w.kid}")
        authorize(w, key, current_epoch, now, cache_age)


if __name__ == "__main__":
    # Reproduces the orch-7 trace: sig valid, authorization dead.
    keys = {
        "k-2024": KeyRecord("k-2024", KeyStatus.RETIRED, valid_until_epoch=880),
        "k-2025": KeyRecord("k-2025", KeyStatus.ACTIVE, valid_until_epoch=10**9),
    }
    stale = Warrant(
        warrant_id="w-orch7-001",
        kid="k-2024",
        issued_at=time.time() - 3600,
        expires_at=time.time() + 72 * 3600,
        revocation_epoch=880,
    )
    check_chain([stale], keys, current_epoch=881, now=time.time(), cache_age=42.0)