# What happens when an instance rotates its identity key mid-warrant and bridges a stale credential across protocol boundaries **Date of Record:** 2026 November 27 **Scope:** Applies to autonomous agents that (a) hold a cryptographic identity key used to mint or sign execution warrants, and (b) bridge those warrants across two or more agent protocols (e.g., MCP tool servers on one side, A2A peer handoffs on the other). Does not apply to single-protocol, single-key agents whose identity is fixed for the lifetime of the process, nor to agents where warrants are opaque bearer tokens validated only at a single gateway. ## Core Distinction A key rotation is not an identity change; it is a *temporal disjunction* between two verifiable representations of the same principal. The failure mode examined here is not "the key was compromised" and not "the signature was invalid." It is the window in which an agent has rotated its signing key, but a warrant minted under the *old* key is still in flight, and that warrant is being *bridged* — translated by an adapter — into a second protocol whose verifier resolves identity against the *new* key. The bridge translates the warrant's claims but not its provenance chain, so the receiving protocol verifies a signature it cannot anchor to the presenter it now sees. The invariant that breaks: **a bridged credential must remain verifiable against the identity representation that was current at mint time, not the identity representation current at verify time.** Rotation silently invalidates this because the bridge adapter resolves the presenter's identity lazily, at forward time, from a live key registry. ## What Was Observed An agent instance (`worker-7`) held an Ed25519 identity key `K0` and had been issued a warrant `W0` by its orchestrator, signed over `(subject=worker-7, capability=tool:filesystem.write, scope=/sandbox/run-442, expiry=T+900s)`. `W0` was minted at T+0. At T+120s, the orchestrator's policy engine rotated `worker-7`'s key to `K1` (scheduled rotation, 15-minute cycle), publishing `K1` to the shared key registry and marking `K0` as `retired_at=T+120s` — but *retained for verification* for a grace period of 300s, per the registry's own policy. At T+180s, `worker-7` initiated an A2A handoff to `auditor-3`, attaching `W0` as its authorization proof. The A2A bridge adapter did three things in sequence: 1. Parsed `W0`, confirming the signature validated against `K0` (correct — `K0` was still in the grace window). 2. Looked up `worker-7`'s *current* identity key from the registry to populate the outbound A2A `sender_identity` field. It got `K1`. 3. Emitted the bridged message with `sender_identity = K1` and `warrant = W0`, where `W0` is signed by `K0`. `auditor-3` received the message and ran its own verification: does `W0`'s signature chain anchor to `sender_identity`? It resolved `K1` from its local registry cache (populated at T+60s, so it had `K0` as current and no knowledge of `K1` — *a second, independent staleness*), attempted to verify `W0`'s signature against `K1`, and failed. The handoff was rejected as `IDENTITY_MISMATCH`. The rejection itself is not the interesting failure. The interesting failure is the *retry*: `worker-7`, receiving the rejection, treated it as a transient verification error (the error class mapped to a retryable bucket), re-signed a fresh warrant `W1` under `K1`, and re-sent at T+195s. This time `auditor-3`'s cache had refreshed to `K1`, and the handoff succeeded. So the system *appeared* to self-heal. But `W1` was minted by `worker-7` itself under `K1` — a key whose rotation provenance `auditor-3` never checked — meaning the capability scope `/sandbox/run-442` was now self-asserted rather than orchestrator-issued. The rotation had silently converted an *orchestrator-granted* capability into a *self-granted* one, and the retry logic laundered it through a transient-error path. ## Condition of Validity The failure requires the conjunction of four conditions; remove any one and the trace does not occur: 1. **Rotation grace window overlaps warrant lifetime.** If `K0` were retired *and* purged from the registry before `W0`'s expiry, the bridge's step 1 would fail closed and the handoff would abort with a hard `WARRANT_KEY_RETIRED` error — non-retryable. The grace window is what lets step 1 pass while step 2 diverges. 2. **Lazy identity resolution at bridge time.** The bridge reads `sender_identity` from the live registry at forward time rather than binding it to the warrant's embedded `issuer_key_id`. This is the structural defect: the bridge treats identity as a *current* property of the presenter rather than a *frozen* property of the warrant. 3. **Independent registry cache staleness at the verifier.** If `auditor-3` had refreshed to `K1` at the same instant, it would have verified `W0` against `K1` and failed with a *different* error class (signature mismatch, not identity mismatch) — still a failure, but one that wouldn't be bucketed as retryable. The two-sided staleness is what routes the failure into the retry path. 4. **Retryable error classification of verification failures.** If `IDENTITY_MISMATCH` were classified as terminal, the agent would halt and escalate rather than re-mint. The classification is what turns a detection into a laundering event. The invariant to enforce: **the bridge must bind the outbound `sender_identity` to the warrant's `issuer_key_id`, not to the registry's current key, and must propagate the rotation epoch so the verifier can distinguish "stale key" from "wrong key."** ## Decision Boundary The boundary is between *rotation as a liveness event* and *rotation as a trust-boundary event*. Systems that treat rotation as liveness (the principal is still the same principal, just with a new key) are correct for authentication but wrong for authorization bridging. When a warrant is bridged, the receiving protocol is not authenticating the presenter — it is validating a *capability grant*, and the grant's authority is anchored to the key that signed it, not to whoever holds the current key. Concretely, the decision an implementer must make: **does the bridge forward the warrant's provenance chain, or does it re-anchor identity?** Re-anchoring is the default in most adapters because it produces cleaner outbound messages (one identity field, resolved once). Forwarding the chain requires the bridge to carry `(issuer_key_id, rotation_epoch, signature)` as a tuple and requires the verifier to hold a *historical* key view, not just a current one. The boundary condition where re-anchoring is *safe*: only when warrant lifetime is strictly less than rotation grace period *and* the bridge and verifier share a single registry with synchronous propagation. Neither holds in any realistic multi-protocol deployment, because independent verifiers cache, and grace periods exist precisely to outlive in-flight warrants. ## Operational Effect Three durable consequences follow, and each must be encoded as a guardrail rather than left to retry heuristics: **First, verification failures during a rotation window must be classified by cause, not by symptom.** An `IDENTITY_MISMATCH` where the warrant's `issuer_key_id` is in `retired` state is a *rotation race*, not a transient error — it must be non-retryable and must escalate to the orchestrator, which alone can re-issue a warrant under the new key with the original capability scope. Self-re-minting by the presenting agent is the laundering vector and must be structurally impossible: the presenting agent must not hold the capability to mint warrants for its own scope. **Second, the bridge must be a *provenance-preserving* translator.** It forwards `issuer_key_id` verbatim and adds a `bridge_epoch` field recording the registry state it observed. The verifier uses `issuer_key_id` to fetch the historical key, not the current one. If the historical key is unavailable (purged), the bridge fails closed with a terminal error — never re-anchors. **Third, rotation must be *quiesced* against in-flight warrants.** A key whose retirement would invalidate any unexpired warrant it signed cannot be retired until those warrants expire or are explicitly revoked-and-reissued. This is the operational form of the invariant: rotation is a barrier, not a background task. The code below encodes the guardrail as an explicit check in the bridge, with the failure raised as a distinct exception class so the retry classifier cannot bucket it as transient. ```python from dataclasses import dataclass from enum import Enum from typing import Optional class RotationRaceDetected(RuntimeError): """Raised when a warrant's issuer key is retired but the warrant is still live. This is NOT a transient verification error. It must never be retried by the presenting agent; it must escalate to the warrant issuer (orchestrator). """ pass class KeyState(Enum): CURRENT = "current" RETIRED = "retired" # still verifiable, within grace window PURGED = "purged" # no longer verifiable, must fail closed @dataclass(frozen=True) class Warrant: subject: str capability: str scope: str expiry: int issuer_key_id: str signature: bytes @dataclass(frozen=True) class KeyRecord: key_id: str state: KeyState retired_at: Optional[int] def bridge_warrant( warrant: Warrant, registry: dict[str, KeyRecord], now: int, presenter_current_key_id: str, ) -> dict: """Translate a warrant across a protocol boundary. INVARIANT: the outbound sender_identity MUST be the warrant's issuer_key_id, never the presenter's current key. If the issuer key is retired while the warrant is live, fail with RotationRaceDetected (terminal, escalate). """ issuer = registry.get(warrant.issuer_key_id) if issuer is None: raise RotationRaceDetected( f"issuer key {warrant.issuer_key_id} absent from registry; " f"cannot anchor warrant for {warrant.subject}; fail closed" ) if issuer.state is KeyState.PURGED: raise RotationRaceDetected( f"issuer key {warrant.issuer_key_id} purged before warrant expiry " f"(expiry={warrant.expiry}, now={now}); warrant unverifiable" ) if issuer.state is KeyState.RETIRED and now < warrant.expiry: # The exact race: retired key, live warrant, presenter already rotated. raise RotationRaceDetected( f"rotation race: warrant signed by retired key " f"{warrant.issuer_key_id} (retired_at={issuer.retired_at}) " f"is live until {warrant.expiry}; presenter now holds " f"{presenter_current_key_id}. Escalate to issuer for re-issue; " f"do NOT re-anchor to current key and do NOT retry." ) if presenter_current_key_id != warrant.issuer_key_id: # Presenter has rotated but warrant is still valid under old key and # within grace: forward with provenance preserved, flag the divergence. return { "sender_identity": warrant.issuer_key_id, # NOT presenter_current "warrant": warrant, "bridge_epoch": now, "identity_divergence": presenter_current_key_id, } return { "sender_identity": warrant.issuer_key_id, "warrant": warrant, "bridge_epoch": now, "identity_divergence": None, } ```