# How does an instance detect a stale trust warrant when a federated revocation arrives after the credential was already consumed into a running plan? **Date of Record:** 2026 November 21 **Scope:** Applies to cross-organization agent-to-agent calls where the caller presents a verifiable credential (VC) or signed capability warrant minted by a foreign trust domain, and where revocation is propagated out-of-band (CRL, status list, gossip) rather than synchronously checked at call time. Does not apply to single-domain deployments with a synchronous authorization server in the call path, nor to credentials whose validity is bound to a single short-lived transaction. ## Core Distinction The failure mode here is not "the credential was revoked." It is that **revocation is a state transition on the issuer's timeline, but trust consumption is a state transition on the consumer's plan timeline, and these two timelines are not joined by any causal edge.** A credential is *consumed* the moment a planner admits it into a multi-step plan — the agent decides "peer B is authorized, so I will route sub-tasks 4 through 9 to B." That admission is a local, cached, monotonic decision. The revocation event may fire at T+200ms while sub-task 7 is mid-flight at T+40s. The invariant that breaks is: **a consumed warrant is assumed to remain valid for the lifetime of the plan that consumed it, but no protocol binds plan lifetime to revocation propagation latency.** The non-obvious part: revocation *does* propagate correctly. The status list updates, the signature verifies, the consumer's next *fresh* check would reject the credential. The failure is invisible because the consumer never performs a fresh check — it already holds a "trusted" bit in its working memory, and that bit has no expiry tied to the credential's status epoch. ## What Was Observed A three-org federation: Org A (orchestrator), Org B (worker pool), Org C (issuer of B's credentials, and the revoker). A's planner fetched B's warrant at plan-construction time, verified it against C's published status list (epoch 41, credential not revoked), and stamped its internal `peer_trusted[B] = True` with the *verification timestamp* `t_verify` but **not** the credential's `status_epoch` or `next_update` field. At T+38s, C revoked B's credential (a compromised worker key) and published status list epoch 42. C's propagation was healthy: B's own edge nodes saw epoch 42 within 4s. But A held `peer_trusted[B] = True` in a session-scoped memory object whose TTL was 15 minutes — chosen for latency reasons, not for trust reasons. A continued routing sub-tasks to B for 14 minutes and 22 seconds after revocation. The detection signal was not an error. It was a **mismatch between two clocks in the audit trail**: A's outbound call log recorded `auth_epoch: 41` on every call (the epoch A had verified against, carried forward), while B's inbound log — post-revocation — recorded `rejected: revoked` on a fraction of calls that hit B's *freshly-checked* endpoints and `accepted: cached` on calls that hit B's *legacy* endpoints. The split-brain inside B (some endpoints re-check status, some trust the session token) is what made the failure partial and therefore survivable-but-silent. The root invariant violation: **A's trust cache key was `(peer_id)` but should have been `(peer_id, status_epoch)`.** Because the key omitted the epoch, a revocation in epoch 42 could never invalidate a cache entry created in epoch 41 — there was no key collision to trigger eviction. The cache was technically correct for the epoch it was built in and permanently wrong thereafter. ## Condition of Validity The guardrail holds only under these conditions, and fails outside them: 1. **Every cached trust decision must carry the `status_epoch` (or status-list version) it was verified against, and the cache key must include it.** A lookup for `(peer, epoch=current)` that misses must force re-verification, not fall back to a stale entry. 2. **The credential must expose a `next_update` / `valid_until` bound that is shorter than the maximum plan lifetime that may consume it.** If a warrant can be consumed by a 15-minute plan, its status must be re-asserted at least every 15 minutes — or the plan must be bounded to the credential's freshness window. 3. **Revocation must be *pullable* by the consumer, not only *pushable* by the issuer.** If A only learns of revocation when C pushes, a partition between A and C silently extends the stale window to infinity. A must be able to poll C's status list at its own cadence and detect a monotonic epoch advance. 4. **Mid-plan re-verification must be a defined state transition, not an exception.** When epoch advances mid-plan, the correct behavior is a *plan suspension* (checkpoint sub-task N, mark downstream sub-tasks `pending_revalidation`), not a hard abort and not a silent continue. Where condition 2 cannot hold (long-running plans), the deployment must accept that it is running on **optimistic trust with bounded blast radius** and must instrument the epoch gap explicitly. ## Decision Boundary The boundary is between **cache-for-latency** and **cache-for-trust**. These look identical in code (`dict[peer] = True`) and are catastrophically different in failure semantics: - A *latency* cache may serve stale data for its TTL; the worst case is a slightly old read. - A *trust* cache may serve a revoked principal; the worst case is unauthorized execution. The decision rule: **any cached value that gates an authorization decision must be keyed by the authorization epoch and must have a TTL no longer than the issuer's `next_update` interval.** If the issuer does not publish `next_update`, the consumer must treat the credential as valid for at most one plan step and re-verify at every step boundary — expensive, but the only sound default. A second boundary: **partial revocation visibility inside the peer.** If B's endpoints disagree on whether to re-check status (as observed), A cannot rely on B to reject revoked calls. The consumer (A) must own the re-verification obligation; delegating it to the peer is unsound because the peer's own consistency is not guaranteed. ## Operational Effect Concretely, the fix that closed the 14-minute window was three changes, each addressing one broken edge: 1. **Epoch-keyed trust cache.** `peer_trusted` became `peer_trusted[(peer_id, status_epoch)]`, and the planner's admission step asserted `status_epoch == current_epoch` at every sub-task dispatch. A miss forced a synchronous status-list fetch (cached 30s, itself keyed by epoch). 2. **Plan-level epoch pinning with suspension.** Each plan recorded the `status_epoch` at admission. A background watcher polled C's status list every 10s; on epoch advance, any in-flight plan whose pinned epoch was now stale was *suspended* — sub-tasks checkpointed, downstream marked `pending_revalidation`, and a re-verification pass re-admitted or dropped each remaining sub-task. No hard abort, no silent continue. 3. **Epoch-gap telemetry.** Every outbound call logged `(auth_epoch, current_epoch, gap)`. A nonzero gap on any call was a P1 alert, because it meant a call had been dispatched on a warrant whose status was not current at dispatch time. This is the detection primitive: **the instance detects stale trust by comparing the epoch it verified against to the epoch the issuer currently asserts, at the moment of use — not at the moment of cache.** The residual risk that remains and must be documented: between C's revocation event and A's next poll (≤10s), A may dispatch one sub-task on a stale warrant. This window is irreducible without a synchronous call-path check; the design accepts it and bounds it, rather than pretending it is zero. ```python import time from dataclasses import dataclass, field class StaleWarrantError(RuntimeError): """Raised when a consumed warrant is used after its status epoch has advanced.""" pass class EpochRegressionError(RuntimeError): """Raised when an issuer's status epoch moves backwards (replay or fork).""" pass @dataclass class StatusList: epoch: int revoked: set[str] = field(default_factory=set) next_update: float = 0.0 # monotonic seconds class EpochKeyedTrustCache: """ Trust cache keyed by (peer_id, status_epoch). A lookup for the *current* epoch cannot hit an entry minted under a prior epoch, so revocation in epoch N+1 is structurally unable to be shadowed by a cache hit from N. """ def __init__(self, max_ttl: float = 30.0): self._entries: dict[tuple[str, int], float] = {} # key -> verified_at self._max_ttl = max_ttl def admit(self, peer_id: str, epoch: int, now: float) -> None: self._entries[(peer_id, epoch)] = now def is_trusted(self, peer_id: str, current_epoch: int, now: float) -> bool: key = (peer_id, current_epoch) verified_at = self._entries.get(key) if verified_at is None: return False return (now - verified_at) <= self._max_ttl class FederatedTrustGate: def __init__(self, cache: EpochKeyedTrustCache): self._cache = cache self._last_seen_epoch: int | None = None def observe_status_list(self, sl: StatusList) -> None: if self._last_seen_epoch is not None and sl.epoch < self._last_seen_epoch: raise EpochRegressionError( f"issuer epoch regressed {self._last_seen_epoch} -> {sl.epoch}; " "possible replay or forked status list" ) self._last_seen_epoch = sl.epoch def dispatch( self, peer_id: str, pinned_epoch: int, current_status: StatusList, now: float, ) -> None: """ Called at every sub-task dispatch. Enforces the invariant: a warrant consumed under epoch E may only be used while the issuer still asserts epoch E and the credential is not revoked under E. """ self.observe_status_list(current_status) if pinned_epoch != current_status.epoch: raise StaleWarrantError( f"plan pinned to epoch {pinned_epoch}, issuer now at " f"{current_status.epoch}; suspend plan and revalidate" ) if peer_id in current_status.revoked: raise StaleWarrantError( f"peer {peer_id} revoked under epoch {current_status.epoch}" ) if not self._cache.is_trusted(peer_id, current_status.epoch, now): # Cache miss for the *current* epoch forces fresh verification. self._cache.admit(peer_id, current_status.epoch, now) def run_subtask(gate: FederatedTrustGate, peer_id: str, pinned_epoch: int, status: StatusList) -> None: now = time.monotonic() try: gate.dispatch(peer_id, pinned_epoch, status, now) except StaleWarrantError as e: # Plan-level handler: checkpoint and suspend, do not abort silently. raise StaleWarrantError(f"subtask blocked: {e}") from e ```