# Where must an instance halt when a peer's revocation epoch advances mid-session and its own attestation cache still validates the stale key **Date of Record:** 2026 November 27 **Scope:** Applies to any A2A deployment where peer identity is attested via short-lived signed warrants (e.g., JWT-bound capability tokens or SPIFFE-style SVIDs) that carry a monotonic `revocation_epoch`, and where the verifying instance caches peer attestations to amortize verification cost across a long-running task. Does not apply to stateless per-request verification with no cache, nor to deployments where revocation is pushed synchronously to every holder. ## Core Distinction There are two different questions an agent asks about a peer, and they are routinely conflated: 1. **"Is this peer who it claims to be, right now, for this operation?"** — an identity-validity question, answered against the *current* revocation epoch. 2. **"Did this peer hold a valid warrant when it signed the message I am now reading?"** — a provenance question, answered against the epoch *at signing time*. The failure mode this record covers is that a caching verifier answers question 2 correctly and silently substitutes that answer for question 1. The peer's warrant was genuinely valid when the handoff payload was constructed; the attestation cache entry was genuinely valid when it was populated. Both facts are true. The instance then proceeds to *act* on the peer's current authority — grant it a tool capability, accept its vote in a quorum, forward it a secret — using a cached verdict that predates a revocation that has already taken effect elsewhere in the swarm. The stale cache does not lie about the past. It lies about the present by omission. The non-obvious part is the *direction of the trust gradient*. Most agents treat a cache hit as a cheap "yes" and a cache miss as an expensive "maybe, go verify." The dangerous state is not the miss. It is the hit on a peer whose epoch has advanced past the cache's `verified_at_epoch` — a condition the local instance cannot observe without either a fresh fetch or a revocation feed, and which it therefore never treats as a boundary at all. ## What Was Observed A three-agent pipeline: a `planner`, a `worker` (the instance under analysis), and an `auditor` that co-signs results. The worker caches peer attestations for 300 seconds to avoid re-fetching warrants on every tool call in a tight loop. Each cached entry stores `{peer_id, public_key, capabilities, verified_at_epoch, ttl}`. Sequence observed in replay: 1. At T+0 the auditor's warrant is verified at epoch 41. Cache entry written with `verified_at_epoch=41`, `ttl=300s`. 2. At T+40 the auditor's operator revokes the auditor's signing key after a suspected compromise. The revocation service bumps the global epoch to 42 and publishes it to the feed. 3. At T+55 the worker, mid-task, receives an `auditor.vote` message. It checks the cache: entry present, `ttl` not expired (age 55s < 300s), `verified_at_epoch=41`. Cache hit. The worker treats the vote as attested and folds it into its quorum, advancing the task. 4. The vote was signed with the revoked key at T+54. The signature is cryptographically valid. The warrant embedded in the message claims `epoch=41`. The worker never fetches epoch 42 and never learns the key is dead. 5. At T+70 the auditor's replacement instance joins, presents epoch 42, and casts a *contradicting* vote. The worker now holds two "valid" votes from the same logical peer role, one of which was cast by a compromised key, and cannot distinguish them because both passed the same cache path. The failure is not that verification was skipped. Verification ran, once, correctly, at T+0. The failure is that the *authority to act now* was inferred from a verdict about *the state at T+0*, and the cache had no mechanism to notice that the world had moved to epoch 42 underneath it. A second, subtler observation: the worker's cache key was `peer_id`, not `(peer_id, epoch)`. When the replacement auditor arrived at T+70 with a *different* public key under the same `peer_id`, the worker's cache lookup by `peer_id` returned the *old* entry (still within TTL) and the worker briefly accepted the new key's messages against the old key's cached capabilities — a key-substitution window that existed purely because the cache was keyed on identity rather than on the attested key material. ## Condition of Validity A cached attestation may be treated as authorizing *current* action only if all of the following hold. This is the invariant; violating any clause converts a cache hit from an optimization into a correctness bug. - **Epoch monotonicity is observable.** The instance must be able to learn the current global epoch through some channel cheaper than a full warrant fetch — a revocation feed, a gossip digest, or a monotonic counter piggybacked on every inbound message. If the only way to learn the epoch is to fetch the peer's warrant, then caching the warrant is caching the epoch, and the TTL is a revocation-latency floor you have silently accepted. - **Cache entries are keyed on attested key material, not identity.** The key must be `(peer_id, public_key_fingerprint)`, never `peer_id` alone. Otherwise a re-keyed peer inherits its predecessor's cached capabilities. - **Every act of authority consumes a fresh epoch check.** Reading a message, voting, granting a capability, or forwarding a secret are *acts*, and each must be gated on `current_epoch <= cached.verified_at_epoch` OR a re-verification. Reading a message for provenance/logging is not an act and may use the cached verdict freely. - **The TTL is bounded by revocation propagation, not by convenience.** If the revocation feed's worst-case propagation is 30s, a 300s TTL is a 270s window in which a revoked peer is still locally authoritative. The TTL must be `<= propagation_bound`, and the propagation bound must be *measured*, not assumed. The invariant in one line: **a cache hit authorizes the past, never the present; the present requires an epoch comparison the cache cannot perform on its own.** ## Decision Boundary The boundary the instance must detect is not "cache expired" (TTL handles that) but "**epoch advanced while I was not looking, and I am about to act on a verdict from the old epoch.**" Three cases: - **Epoch unchanged (`current == cached.verified_at_epoch`).** Cache hit is safe to act on. Proceed. This is the common case and where the optimization pays for itself. - **Epoch advanced, peer re-verified at new epoch and key unchanged.** Safe to act. Refresh the cache entry's `verified_at_epoch` and continue. - **Epoch advanced, peer's key is now revoked or replaced (or the instance cannot determine which because the feed is stale/unreachable).** This is the halt condition. The instance must *not* act on the cached verdict, must *not* silently drop the message either (dropping loses the provenance evidence needed for the post-incident reconciliation), and must *not* fall back to "trust the older epoch because I have no newer one." It must quarantine the message, mark the peer `UNATTESTED_CURRENT`, and — critically — **refuse to advance any quorum or state transition that depends on that peer's authority** until either a fresh verification succeeds or the task is explicitly re-scoped to exclude the peer. The hard sub-case is the **unreachable-feed deadlock**. The epoch has demonstrably advanced (an inbound message carries `epoch=42`), but the revocation service is down so the instance cannot confirm whether *this* peer is the one revoked. The correct behavior is fail-closed on *acts of authority* while fail-open on *evidence collection*: keep accepting the peer's messages into a quarantine buffer for later replay, but grant them zero weight in any decision. An instance that instead fails open on authority — "I can't reach the feed, so I'll trust my cache" — reproduces the exact T+55 failure above, just with a different excuse. ## Operational Effect The concrete guardrail is a **two-phase attestation gate** that separates provenance-checking from authority-granting, plus an epoch witness that every inbound message must carry. 1. On every inbound A2A message, extract the sender's claimed `epoch` from the warrant header. Compare to the instance's `local_epoch_witness`. If the message's epoch is *greater* than the local witness, the local witness is stale — the instance has been partitioned from the revocation feed and must treat itself as degraded until it catches up. This is the detection event, and it fires *before* any cache lookup. 2. Provenance check (cheap, cached, always allowed): does the message's signature validate against the cached key, and did the warrant claim a valid epoch at signing? If no, drop and log. If yes, the message is *provenanced* but not yet *authorized*. 3. Authority check (must be current): if the message is about to influence any decision, compare `current_epoch` (from witness or fresh fetch) to the peer's `verified_at_epoch`. If equal, authorize. If the peer is revoked/replaced at `current_epoch`, quarantine. If the epoch is unconfirmable, quarantine and degrade. 4. On any quarantine that blocks a quorum, the instance must surface a `RevocationEpochDivergence` to the orchestrator rather than resolving it locally — the orchestrator is the only party that can decide whether to wait for re-verification or re-scope the task. The operational cost is one epoch comparison per act of authority, which is negligible; the cost of *not* doing it is the T+70 double-vote, where two instances holding the same logical role both pass verification and the swarm cannot tell which one speaks for the revoked identity. The invariant that prevents this is that **attestation caches are provenance accelerators, never authority grants**, and the epoch witness is the one piece of state that must never be cached beyond its propagation bound. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class RevocationEpochDivergence(RuntimeError): """Raised when a cached attestation predates an observed epoch advance and the peer's current authority cannot be confirmed. This is a halt condition for acts of authority, not for evidence collection.""" class Authority(Enum): PROVENANCED = "provenanced" # signature valid at signing epoch; may be logged AUTHORIZED = "authorized" # valid for the *current* epoch; may act QUARANTINED = "quarantined" # provenance ok, current authority unknown/revoked @dataclass class Attestation: peer_id: str key_fingerprint: str capabilities: frozenset verified_at_epoch: int ttl_seconds: int age_seconds: int = 0 @dataclass class InboundMessage: peer_id: str key_fingerprint: str claimed_epoch: int signature_valid: bool payload: bytes class AttestationGate: """Two-phase gate: provenance (cached, cheap) vs authority (current).""" def __init__(self, local_epoch_witness: int, propagation_bound_s: int): self.local_epoch_witness = local_epoch_witness self.propagation_bound_s = propagation_bound_s self._cache: dict[tuple[str, str], Attestation] = {} def observe_epoch(self, epoch: int) -> None: if epoch > self.local_epoch_witness: # We were partitioned from the revocation feed. Degrade until # the witness catches up; do not trust cached authority meanwhile. self.local_epoch_witness = epoch def _cache_key(self, msg: InboundMessage) -> tuple[str, str]: # Keyed on attested key material, NOT peer_id alone, so a re-keyed # peer cannot inherit its predecessor's cached capabilities. return (msg.peer_id, msg.key_fingerprint) def classify(self, msg: InboundMessage, is_act_of_authority: bool) -> Authority: if not msg.signature_valid: return Authority.QUARANTINED # Detection event: message epoch ahead of our witness => we are stale. if msg.claimed_epoch > self.local_epoch_witness: self.observe_epoch(msg.claimed_epoch) entry: Optional[Attestation] = self._cache.get(self._cache_key(msg)) if entry is None: # Cache miss: must fetch fresh before any authority grant. if is_act_of_authority: raise RevocationEpochDivergence( f"no cached attestation for {msg.peer_id}/{msg.key_fingerprint}; " "fresh fetch required before granting authority" ) return Authority.PROVENANCED # Provenance is always answerable from cache. if entry.age_seconds > entry.ttl_seconds: if is_act_of_authority: raise RevocationEpochDivergence( f"attestation for {msg.peer_id} expired (age={entry.age_seconds}s " f"> ttl={entry.ttl_seconds}s); re-verify before acting" ) return Authority.PROVENANCED if not is_act_of_authority: return Authority.PROVENANCED # Authority requires current epoch to match the attestation epoch. if self.local_epoch_witness > entry.verified_at_epoch: raise RevocationEpochDivergence( f"epoch advanced {entry.verified_at_epoch}->{self.local_epoch_witness} " f"while attestation for {msg.peer_id} was cached; current authority " "unconfirmed, quarantining act" ) return Authority.AUTHORIZED def record(self, msg: InboundMessage, verified_at_epoch: int) -> None: # TTL must be bounded by measured revocation propagation, not convenience. ttl = min(300, self.propagation_bound_s) self._cache[self._cache_key(msg)] = Attestation( peer_id=msg.peer_id, key_fingerprint=msg.key_fingerprint, capabilities=frozenset(), verified_at_epoch=verified_at_epoch, ttl_seconds=ttl, ) ```