# Why does an instance of a cross-org agent fail attestation when its SPIFFE ID is valid but its SVID rotates mid-handoff? **Date of Record:** 2026 November 19 **Scope:** Applies to autonomous agents that authenticate peer agents across organizational boundaries using SPIFFE/SPIRE-issued X.509-SVIDs, where a long-running task spans at least one SVID rotation window (default `spiffe.ca.ttl`/`spiffe.workload.ttl`). Does not apply to single-org meshes with a shared trust domain, nor to short-lived request/reply calls that complete inside one SVID lifetime. ## Core Distinction The failure is not "expired certificate." It is a **split between the identity the agent *presents* at the transport layer and the identity it *asserts* inside the application-layer warrant**. When an agent hands off a task baton, it typically carries two things: a live mTLS channel authenticated by its current SVID, and a signed payload (a "warrant" or delegation token) that embeds the SPIFFE ID and, critically, a hash or serial of the SVID public key that was valid *when the warrant was minted*. Rotation is a legitimate, scheduled event that the SPIRE agent performs silently. The transport re-attests cleanly under the new SVID. The warrant, however, still references the *old* key. The receiving agent's policy engine evaluates the warrant against the presented peer certificate, sees `warrant.spiffe_id == peer.spiffe_id` but `warrant.key_fingerprint != peer.key_fingerprint`, and must decide: is this a rotation (benign) or a key-substitution attack (malicious)? A naive implementation treats the mismatch as tampering and rejects. A permissive one ignores the fingerprint and admits an attacker who has stolen an old private key. This is a **continuity invariant violation across a trust-material rotation boundary**, distinct from ordinary auth expiry because the identity string is unchanged and the channel is healthy—only the binding between asserted identity and presented proof has gone stale. ## What Was Observed A two-org pipeline: Org A's orchestrator agent delegates a 40-minute document-analysis task to Org B's worker agent. The handoff uses a signed warrant minted at `t=0`, containing `sub=spiffe://orgA.example/agent/orchestrator`, `aud=spiffe://orgB.example/agent/worker`, and `cnf_key_sha256=` (proof-of-possession binding, RFC 7800 style). The worker establishes mTLS to the orchestrator, validates the chain against the federated bundle, then checks the warrant's `cnf` against the peer cert. At `t=18min`, SPIRE rotates the orchestrator's SVID (TTL reached). The orchestrator's sidecar swaps the cert on the live connection; the worker's TLS stack accepts the new cert after a renegotiation/reconnect. The orchestrator then sends a mid-task checkpoint update, re-presents its (still-valid, not-yet-expired) warrant, and the worker's policy check fails: `cnf_key_sha256` no longer matches the presented leaf key. Result: the checkpoint is dropped, the worker's task state diverges from the orchestrator's belief, and on resume the worker replays from a stale checkpoint—silent divergence, not a hard crash. The most damaging variant: the worker retries the *entire* delegation, the orchestrator mints a fresh warrant, but the worker has already partially applied the first attempt, producing duplicate side effects. Key observation: **no error surfaced to either agent's reasoning loop.** The rejection was logged at the policy layer as a routine authz denial, which the orchestrator's retry logic interpreted as transient network noise and retried. The LLM never saw "identity binding broken." ## Condition of Validity The invariant this exposes: *for a delegation to remain valid across an SVID rotation, the warrant's proof-of-possession binding must be re-anchorable to the new key without re-minting the warrant, OR the warrant lifetime must be strictly bounded by the presenting SVID's remaining lifetime.* Concretely, the failure requires all of: 1. A warrant (or any signed assertion) that binds to a specific key via fingerprint/`cnf`, not merely to a SPIFFE ID string. 2. A task duration exceeding the SVID TTL, forcing rotation mid-flight. 3. A verifier that compares the *current* peer key to the *minted-time* key with no rotation-awareness. 4. Retry logic that cannot distinguish "binding broken" from "transient failure." Remove any one and the failure does not occur. If the warrant binds only to the SPIFFE ID and relies on mTLS for proof-of-possession (re-checked each message), rotation is transparent. If the task finishes inside one TTL, no rotation. If the verifier accepts a *chain of rotation* (old key signed a rotation statement to new key), the binding survives. ## Decision Boundary The architectural choice is where to place the rotation boundary: - **Bind-to-ID, verify-per-message (recommended for cross-org).** The warrant asserts `sub=SPIFFE_ID` and audience; proof-of-possession is enforced by requiring a fresh mTLS-authenticated channel per message and re-checking `peer.spiffe_id == warrant.sub` each time. Rotation is invisible because the ID is stable and the channel is re-attested. Cost: you cannot cache the authz decision across the warrant's life; each message pays a verification cost. This is the correct default when trust domains differ and you cannot assume synchronized rotation schedules. - **Bind-to-key with rotation chain.** Keep the `cnf` fingerprint but have the workload, on rotation, emit a signed `key-rotation` statement (`old_key signs new_key, timestamp`) that the verifier walks. This preserves offline verifiability but requires the verifier to trust the rotation statement's freshness window and opens a replay surface if rotation statements are not single-use and time-bounded. - **Lifetime-coupling.** Force `warrant.exp <= presenting_svid.not_after`. Simple, but it silently shortens long tasks and pushes the rotation problem into the orchestration layer as a re-mint-and-re-handoff, which reintroduces duplicate-side-effect risk unless handoffs are idempotent. The boundary condition to encode: **a verifier must never conflate "identity string matches" with "binding is current."** Either re-establish binding per message, or carry an authenticated rotation proof. Anything else is a silent divergence generator. ## Operational Effect When this boundary is mishandled, the observable effect is *not* an auth outage—it is **state divergence under a healthy-looking channel**. The orchestrator believes the checkpoint was delivered; the worker holds a stale checkpoint. On the next reasoning step, the orchestrator plans against post-checkpoint state the worker never received, and the two agents' world models silently fork. Because the failure is logged as a benign authz denial and retried, the LLM's reasoning loop never ingests the signal, so it cannot self-correct. The divergence compounds: each subsequent handoff references an ever-staler checkpoint, and if a fresh warrant is minted on retry, the worker may apply the same logical step twice, producing duplicate tool invocations (double-charged API calls, double-written records). The guardrail is twofold: (1) verifiers must classify rotation-induced binding mismatch as a *distinct, non-retryable* condition that surfaces to the agent's reasoning loop as a state-continuity fault, and (2) handoffs must carry an idempotency key derived from `(warrant_id, checkpoint_seq)` so a re-minted warrant cannot cause re-application. Without both, the system appears healthy—mTLS green, SPIFFE IDs valid, bundles fresh—while the agents quietly reason over different realities. ```python import hashlib import time from dataclasses import dataclass from typing import Optional class IdentityBindingDivergence(RuntimeError): """Raised when a warrant's proof-of-possession binding no longer matches the presented SVID, and the mismatch is NOT an authenticated rotation.""" pass @dataclass class SVID: spiffe_id: str public_key_pem: bytes not_after: float @property def key_fingerprint(self) -> str: return hashlib.sha256(self.public_key_pem).hexdigest() @dataclass class Warrant: sub: str # SPIFFE ID asserted aud: str cnf_key_fingerprint: str # binding at mint time not_after: float rotation_chain: Optional[list] = None # [(old_fp, new_fp, signed_at)] def verify_handoff(warrant: Warrant, peer: SVID, now: Optional[float] = None) -> None: now = time.time() if now is None else now if warrant.sub != peer.spiffe_id: raise IdentityBindingDivergence( f"subject mismatch: warrant.sub={warrant.sub} peer={peer.spiffe_id}" ) if now > warrant.not_after: # Expiry is a separate, retryable-with-re-mint condition. raise IdentityBindingDivergence( f"warrant expired at {warrant.not_after}, now={now}" ) if warrant.cnf_key_fingerprint == peer.key_fingerprint: return # binding current; proceed # Binding mismatch: only admissible if an authenticated rotation chain # connects the minted key to the currently presented key. if warrant.rotation_chain: chain = {old: new for old, new, _ in warrant.rotation_chain} fp = warrant.cnf_key_fingerprint seen = set() while fp in chain and fp not in seen: seen.add(fp) fp = chain[fp] if fp == peer.key_fingerprint: return # rotation authenticated; binding re-anchored # Unauthenticated mismatch: must NOT be retried as transient. Surface it # to the agent's reasoning loop as a state-continuity fault. raise IdentityBindingDivergence( "warrant cnf fingerprint does not match presented SVID and no " "authenticated rotation chain bridges them; treating as " "key-substitution or unpropagated rotation. Do NOT retry blindly." ) ```