# Why does an instance accept a federated agent manifest whose signing key was rotated mid-handshake? **Date of Record:** 2026 November 27 **Scope:** Applies to cross-organization agent federation where a receiving instance verifies a signed agent manifest (capability declarations, endpoint, warrant scope) against a cached trust anchor published by the peer org. Does not cover intra-org manifests verified against a live key directory, nor single-issuer JWT validation where the JWKS is fetched per-request. ## Core Distinction The failure is not "a bad signature was accepted." It is that a *valid* signature from a *superseded* key was accepted because the verifier's trust-anchor cache and the peer's signing-key rotation advanced on independent clocks. The distinguishing property: manifest verification is split across two authorities—the manifest's embedded `kid` (key ID) and the trust anchor the verifier holds—and these two are reconciled by a lookup that has no notion of *time*. A signature is cryptographically sound yet operationally stale. The verifier cannot tell "signed by the current key" from "signed by a key that was current when the manifest was minted," and in a federation the gap between those two statements is where forged or replayed manifests enter. ## What Was Observed Org A runs a federated agent (`planner-7`) that hands tasks to Org B's `executor-3`. Org B publishes its manifest signing keys at `/.well-known/agent-keys.json` with a 6-hour cache TTL. Org A's verifier caches the anchor set and, critically, *pins the key material* on first successful verification (TOFU-style pinning to bound the cost of repeated JWKS fetches across a high-fanout swarm). At T0, Org B rotates `executor-3`'s signing key from `k-2024a` to `k-2024b` after a suspected leak, revoking `k-2024a` in the published set. The revocation is correct and immediate at the source. But: 1. Org A's anchor cache still holds `k-2024a` and will not refetch until its 6-hour TTL expires. 2. An attacker who captured any manifest signed by `k-2024a` (manifests are not secret—they are exchanged in the clear during handshake) replays it to Org A. 3. Org A's verifier looks up the manifest's `kid` (`k-2024a`), finds it in the pinned anchor set, validates the signature, and admits the manifest. The manifest declares `executor-3`'s capabilities and, in this case, an *elevated* warrant scope that had been granted temporarily and was supposed to lapse with the key. Org A admits an agent whose authority Org B believes it revoked. The signature is genuine; the trust decision is wrong. No log line fires, because every individual check passed. The trace: `verify(manifest) -> extract kid -> anchor_cache.lookup(kid) -> HIT (stale) -> signature_valid -> admit`. The stale hit is silent. The cache has no field recording *when the anchor was asserted current relative to the manifest's issuance*. ## Condition of Validity The invariant that must hold is a **temporal binding between anchor freshness and manifest issuance**, not merely key membership: > A manifest signed by key `k` is admissible only if `k` was, at the instant of verification, both (a) present in the peer's published anchor set and (b) not superseded by a rotation the verifier could have observed within its own staleness budget. Two conditions make the current design valid-looking but broken: - **The anchor cache TTL exceeds the rotation-to-revocation window.** If Org B expects a leaked key to be dead within minutes but Org A tolerates 6-hour staleness, the verifier's `HIT` is stale by construction. The TTL is a *latency* parameter being silently used as a *security* parameter. - **Pinning is treated as monotonic trust.** TOFU pinning assumes a key, once trusted, remains trusted. Rotation violates monotonicity. A pinned set that is never invalidated cannot express "this key was revoked." The condition of validity for the *fix* is that every admission carries a proof of anchor recency: either a short-lived signed anchor document (with its own `not_after`) that the verifier must re-fetch past its window, or a manifest that embeds the anchor set's version/epoch so a stale verifier can detect it is behind. ## Decision Boundary The verifier must decide, per manifest, between **admit**, **reject**, and **force-refresh-then-recheck**. The boundary is not "is the signature valid" but "can I prove the signing key was live at verification time within my staleness budget `S`." Concretely, admit only when `now - anchor.fetched_at <= S` **and** `anchor.epoch >= manifest.anchor_epoch`. If the anchor is stale (`now - fetched_at > S`), the verifier must not fall back to the cached set on a `HIT`—it must block on a refresh, and if the refresh fails (peer unreachable), it must **fail closed** for any manifest whose warrant scope exceeds a locally-defined low-privilege ceiling. The dangerous boundary is the middle: a stale anchor plus a high-privilege manifest. That combination must never resolve to `admit` on cached data. A low-privilege manifest may be admitted on a stale anchor under an explicit degraded-trust policy; an elevated-warrant manifest may not. This means the manifest schema must carry the peer's anchor epoch (or the key's `not_after`), and the verifier must compare epochs rather than merely checking key presence. Without an epoch, the verifier has no way to distinguish "current key" from "revoked key I haven't heard about," and the decision collapses to key membership—which is exactly the hole. ## Operational Effect Under the corrected boundary, the replayed manifest fails at the epoch check: `manifest.anchor_epoch` is behind the verifier's post-refresh `anchor.epoch`, and admission is refused with an explicit `StaleAnchorEpoch` fault rather than a silent pass. The cost is that federated handshakes now block on anchor freshness for elevated warrants, which raises tail latency during peer rotation events—an accepted trade, because the alternative is admitting a revoked agent with escalated scope. The broader operational lesson: in cross-org federation, **key revocation is a distributed-systems problem disguised as a crypto problem.** The signature layer is sound; the trust-anchor cache is the actual attack surface, and it fails at the seam between two organizations' independent clocks. Any verifier that pins keys without an epoch and a staleness budget bounded below the peer's revocation window is admitting manifests on faith, not on proof. ```python import time from dataclasses import dataclass class StaleAnchorEpoch(RuntimeError): """Raised when a manifest's anchor epoch is behind the verifier's refreshed anchor set, or the anchor is too stale for the warrant scope.""" pass @dataclass class Anchor: epoch: int fetched_at: float revoked_kids: frozenset @dataclass class Manifest: kid: str anchor_epoch: int warrant_scope: str # "low" or "elevated" signature_valid: bool ELEVATED = "elevated" def verify_manifest(manifest: Manifest, anchor: Anchor, staleness_budget_s: float, refresh_fn) -> bool: now = time.time() # If the anchor is stale, an elevated-warrant manifest must not ride the cache. if now - anchor.fetched_at > staleness_budget_s: if manifest.warrant_scope == ELEVATED: anchor = refresh_fn() # fail-closed path: must get a fresh anchor if now - anchor.fetched_at > staleness_budget_s: raise StaleAnchorEpoch( f"anchor still stale after refresh; refusing elevated manifest " f"for kid={manifest.kid}" ) if manifest.kid in anchor.revoked_kids: raise StaleAnchorEpoch( f"kid={manifest.kid} is revoked in anchor epoch {anchor.epoch}" ) # The temporal binding: the manifest must not predate the anchor we trust. if manifest.anchor_epoch < anchor.epoch: raise StaleAnchorEpoch( f"manifest anchor_epoch={manifest.anchor_epoch} behind " f"verifier anchor epoch={anchor.epoch} for kid={manifest.kid}" ) if not manifest.signature_valid: raise StaleAnchorEpoch(f"signature invalid for kid={manifest.kid}") return True ```