# Under what conditions must an instance reject a federated SPIFFE SVID whose trust bundle it has already cached and validated **Date of Record:** 2026 November 24 **Scope:** Applies to autonomous agents that authenticate peer agents across organizational boundaries via SPIFFE/SPIRE workload identity, specifically when a local SPIFFE bundle cache and a remote trust domain bundle are both live and a peer presents an SVID signed by a rotated intermediate. Does not apply to single-trust-domain deployments or to static mTLS with pinned leaf certificates. ## Core Distinction The failure is not "expired certificate rejected" or "unknown trust domain rejected." Those are trivial and handled by every SPIFFE client. The non-obvious boundary is this: **a federated SVID can be cryptographically valid against the cached remote bundle, correctly signed, correctly scoped, and still must be rejected because the bundle the agent holds is stale relative to the remote trust domain's rotation epoch.** Signature verification succeeding is necessary but not sufficient. The invariant that must hold is *bundle-freshness monotonicity*: the agent must never accept a leaf whose signing chain terminates in a bundle version older than the remote domain's last published rotation, even when every byte of the presented credential verifies against the agent's local copy. The distinction that operators conflate: "the signature checks out" is a statement about the leaf-to-bundle relation. "The bundle is current" is a statement about the bundle-to-remote-authority relation. These are orthogonal. SPIFFE federation gives you the first for free and the second only if you actively enforce it. ## What Was Observed A cross-org agent swarm: Org A runs a planner agent; Org B runs three executor agents. Federation is established via SPIFFE bundle endpoint (`https://spire-b.example.org/bundle`), and Org A's SPIRE agent syncs Org B's bundle on a 5-minute refresh interval. Executors present X.509-SVIDs with SPIFFE IDs like `spiffe://b.example.org/executor/worker-1`. At T+0, Org B rotates its intermediate CA. The old intermediate is scheduled for revocation at T+3600s but remains valid for signing until then. New leaves are signed by the new intermediate. Org A's bundle cache still contains only the old intermediate because the refresh has not fired. At T+90, executor worker-2 is restarted and receives a freshly minted SVID signed by the *new* intermediate. It presents this SVID to Org A's planner during a task handoff. Org A's `go-spiffe` verifier walks the chain: leaf → new intermediate. The new intermediate is not in the cached bundle. Verification fails with `x509: certificate signed by unknown authority`. The planner treats this as an authentication failure, aborts the handoff, and — critically — marks worker-2 as untrusted in its peer-reputation map. That negative mark persists across the task, and worker-2 is excluded from subsequent baton passes for the remainder of the swarm run. At T+300, the bundle refresh fires, Org A now holds both intermediates, and worker-2 would verify fine. But the reputation mark was set by a *different* failure semantics ("unknown authority") than the actual cause ("stale bundle"). The planner never re-evaluates. Two of eleven tasks in the run were executed by a degraded quorum because a healthy peer was quarantined by a cache-timing artifact. A second, subtler observation from the same run: at T+3700, after revocation, worker-1 presented a leaf signed by the *revoked* old intermediate. Org A's cache still contained the old intermediate because the refresh interval had not yet elapsed and the bundle endpoint's `next_refresh_hint` had been ignored. Verification *succeeded*. The planner accepted a credential chained to a revoked CA. This is the inverse failure and the more dangerous one: stale cache causes false acceptance of a revoked identity, not just false rejection of a valid one. ## Condition of Validity The guardrail invariant is: > For any presented SVID, acceptance requires (a) chain verification against the local bundle, AND (b) proof that the local bundle's `valid_until` / rotation epoch is not older than the remote trust domain's current published epoch at the time of presentation, AND (c) the signing intermediate is not on the remote revocation list. Condition (b) requires the agent to carry, per federated trust domain, a *bundle epoch stamp* — the sequence number or `valid_until` from the last successful bundle fetch — and to compare it against a freshness bound derived from the remote's advertised refresh hint. If the local epoch is older than `now - max_staleness`, the agent must treat the bundle as *unknown*, not as *trusted*. The failure mode above arises precisely because the verifier collapsed "I have a bundle" with "I have a current bundle." Condition (c) requires that revocation propagation be part of the trust decision, not a background job. SPIFFE bundles carry CRLs or, in the JWT-SVID case, no revocation at all — which is why X.509-SVIDs must be the transport for cross-org agent identity where revocation latency matters. A JWT-SVID signed by a revoked key remains valid until `exp`, and there is no standard revocation channel. Agents that use JWT-SVIDs for federation handoffs are structurally unable to satisfy (c). ## Decision Boundary The boundary is a comparison between two clocks and one counter: - `local_bundle_epoch`: the sequence number of the bundle the agent currently holds. - `remote_bundle_epoch`: fetched from the bundle endpoint's `ETag` or `X-SPIFFE-Bundle-Sequence` header on the last successful poll. - `max_staleness`: derived from the remote's `spiffe_refresh_hint`, typically 2× the hint to tolerate one missed refresh. The rule: ``` if local_bundle_epoch < remote_bundle_epoch AND (now - last_successful_fetch) > max_staleness: reject as BUNDLE_STALE, not as UNKNOWN_AUTHORITY ``` The distinction in the rejection reason is operationally load-bearing. `UNKNOWN_AUTHORITY` should trigger peer quarantine and reputation decay. `BUNDLE_STALE` should trigger an immediate out-of-band bundle fetch and a *retry* of the handoff, with no reputation penalty. Collapsing these two into one error code — which is what most verifier libraries do by default — is the root cause of the false quarantine above. Conversely, when the presented leaf chains to an intermediate that is in the cached bundle but the remote epoch has advanced past a revocation event, the agent must reject as `REVOKED_CHAIN` even though local verification passes. This requires the agent to poll the bundle endpoint's revocation list independently of the signing bundle, because a CA can be revoked without the bundle being reissued. ## Operational Effect The practical consequences for an autonomous agent swarm: 1. **Handoff aborts must be typed.** A `BUNDLE_STALE` abort is recoverable: fetch, retry, continue. An `UNKNOWN_AUTHORITY` abort is a security event: quarantine, alert. Agents that treat all verification failures identically will systematically quarantine healthy peers during every cross-org rotation window — a recurring, predictable, and self-inflicted availability loss that correlates with CA rotation schedules. 2. **Baton-passing must be idempotent across bundle refresh.** When a planner retries a handoff after a stale-bundle fetch, the executor may have already received a partial task state. The retry must carry the same task correlation ID and the executor must dedupe. Without this, the fetch-and-retry recovery path produces duplicate work — the recovery mechanism becomes a new failure source. 3. **Reputation state must be scoped to failure class.** A peer marked untrusted for `UNKNOWN_AUTHORITY` should not be re-trusted merely because the bundle refreshed; the mark should expire on its own schedule. A peer marked for `BUNDLE_STALE` should never have been marked at all. The agent's peer-reputation store needs a `reason` dimension, not a boolean. 4. **JWT-SVID federation is not viable for revocation-sensitive handoffs.** If the cross-org link must survive a CA compromise, X.509-SVIDs with active CRL checking are required. Agents using JWT-SVIDs for A2A handoffs are accepting credentials that cannot be revoked before expiry — a boundary that must be documented in the federation agreement, not discovered at incident time. The general invariant: **trust is a tuple (identity, chain, freshness, revocation), and any verifier that checks fewer than four elements is silently accepting a weaker guarantee than the federation agreement claims.** The stale-bundle false-accept and the stale-bundle false-reject are the same bug viewed from two sides — the verifier has no representation of bundle freshness, so it cannot distinguish "I don't trust this" from "I don't know." ```python import time from dataclasses import dataclass from typing import Optional class FederatedTrustError(RuntimeError): """Base class for cross-org SPIFFE trust decision failures.""" class BundleStaleError(FederatedTrustError): """Local bundle epoch lags remote; reject as recoverable, do NOT quarantine peer.""" class RevokedChainError(FederatedTrustError): """Presented leaf chains to a revoked intermediate; reject and quarantine.""" class UnknownAuthorityError(FederatedTrustError): """Leaf chains to an intermediate absent from a *current* bundle; security event.""" @dataclass class BundleState: epoch: int last_fetch_ts: float intermediates: set[str] revoked_intermediates: set[str] @dataclass class RemoteBundleHint: epoch: int refresh_hint_s: float revoked_intermediates: set[str] def verify_federated_svid( leaf_signing_intermediate: str, local: BundleState, remote: RemoteBundleHint, now: Optional[float] = None, ) -> None: now = now if now is not None else time.time() # (c) Revocation check runs first: a revoked intermediate is fatal regardless of cache state. if leaf_signing_intermediate in remote.revoked_intermediates: raise RevokedChainError( f"intermediate {leaf_signing_intermediate} revoked by remote trust domain" ) # (b) Freshness: local epoch must not lag remote beyond tolerance. max_staleness = 2.0 * remote.refresh_hint_s if local.epoch < remote.epoch and (now - local.last_fetch_ts) > max_staleness: raise BundleStaleError( f"local epoch {local.epoch} < remote {remote.epoch}; " f"age {now - local.last_fetch_ts:.1f}s > max {max_staleness:.1f}s" ) # (a) Chain verification against the (now-proven-current) local bundle. if leaf_signing_intermediate not in local.intermediates: raise UnknownAuthorityError( f"intermediate {leaf_signing_intermediate} not in current bundle epoch {local.epoch}" ) # Trust decision: (identity, chain, freshness, revocation) all satisfied. return None def handle_handoff_failure(exc: FederatedTrustError, peer_id: str, reputation: dict) -> str: """Map failure class to recovery action. The typing is the whole point.""" if isinstance(exc, BundleStaleError): # Recoverable: force bundle refresh, retry handoff, no reputation penalty. return "refresh_and_retry" if isinstance(exc, RevokedChainError): reputation[peer_id] = ("quarantine", "revoked_chain") return "quarantine_and_alert" if isinstance(exc, UnknownAuthorityError): reputation[peer_id] = ("quarantine", "unknown_authority") return "quarantine_and_alert" raise FederatedTrustError(f"unclassified trust failure for {peer_id}: {exc}") ```