# Under what conditions must an instance reject a federated peer whose SPIFFE SVID chains to a trusted root but whose verifiable credential subject binding was minted against a rotated workload selector **Date of Record:** 2026 November 23 **Scope:** Applies to cross-org agent federation where an inbound peer presents both (a) a SPIFFE-style X.509-SVID asserting workload identity and (b) a W3C Verifiable Credential (VC) whose `credentialSubject.id` is bound to that workload identity, and where either the trust bundle or the workload selector set has been rotated. Does not apply to single-org intra-mesh mTLS, nor to pure OIDC bearer-token federation where subject binding is re-derived per request. ## Core Distinction The failure is not "untrusted root" and not "expired credential." Both of those are trivially caught. The failure is a **split-validity state**: the SVID validates against the current trust bundle, and the VC validates against its issuer's key, but the *binding predicate* between them—`VC.credentialSubject.spiffe_id == SVID.SPIFFE_ID` combined with `SVID.selector ∈ issuer.attested_selector_set(at VC.issuance_time)`—evaluates true against the *rotated* selector set while it was minted against the *pre-rotation* set. The two artifacts are each independently valid; their conjunction is only valid because the verifier silently re-evaluates the selector predicate at verification time instead of at issuance time. Concretely: an agent workload `spiffe://orgA.example/agent/summarizer` is attested by selector `k8s:ns:agents,k8s:sa:summarizer-v1`. Org A rotates to `k8s:sa:summarizer-v2` (new pod template, same SPIFFE ID string). The old SVID for `summarizer-v1` is still within its TTL and still chains to the current bundle. A VC minted by Org A's credential issuer at T0 asserts "subject `.../agent/summarizer` is authorized to act on behalf of Org A for scope `doc.read`." At T1 the selector rotates. At T2 the verifier at Org B checks: SVID chains to root ✓, VC signature ✓, subject string matches ✓, and *re-queries* the issuer's current selector set—which no longer contains `summarizer-v1`, but the verifier only checks that *some* selector in the SVID matches *some* selector in the current set, not that the SVID's selector was in the set at VC issuance. The stale workload—now a decommissioned pod still holding a live SVID—passes. ## What Was Observed In a two-org federation testbed (Org A: 40 agent workloads, selector rotation every 6h; Org B: 3 verifying gateways), we replayed 1,200 handoffs across a rotation boundary. Observed trace for the failing case: 1. `T0` — Issuer mints VC for `spiffe://orgA/agent/summarizer`, embeds `issuance_context: {selector_set_hash: H_old, issued_at: T0}`. 2. `T0+5h` — Selector set rotates to `H_new`. Trust bundle unchanged (same root, same intermediate). Old SVIDs remain valid to `T0+6h`. 3. `T0+5h30m` — Decommissioned pod (still running, not yet drained) presents SVID(`summarizer-v1`) + VC. Gateway B verifies: - `x509.Verify(svid, bundle)` → OK (root unchanged). - `vc.Verify(vc, issuer_jwks)` → OK. - `svid.spiffe_id == vc.credentialSubject.id` → OK. - `selector_match(svid.selector, issuer.current_selectors)` → **OK, because `summarizer-v1` was still present in the issuer's `current_selectors` for a 90-second grace window during drain.** 4. Handoff accepted. Peer agent at Org B acts on `doc.read` scope for 8 minutes before the drained pod is killed. The non-obvious element: the 90-second drain grace window on the *issuer's* selector registry created a window where a *revoked* workload's selector was simultaneously (a) absent from the "authoritative" set used for new attestations and (b) present in the "grace" set used for verifier re-queries. The verifier had no way to distinguish "selector valid because workload is live" from "selector valid because drain grace." Second observed variant: cross-org clock skew. Org A's issuer clock ran 47s ahead. VC `issuance_context.issued_at` was stamped at `H_new` rotation time, but Org B's verifier evaluated `selector_set_at(issued_at)` against its own clock and resolved to `H_old`—rejecting a legitimately fresh VC. Both directions of the split-validity failure (false accept on stale, false reject on fresh) observed at ~0.3% and ~0.7% of boundary-spanning handoffs respectively. ## Condition of Validity The invariant that must hold for a federated handoff to be sound: > **For a peer to be admitted, there must exist a single selector-set snapshot `S*` such that (i) `S*` is the selector set in force at the VC's `issued_at` per a clock both parties agree on, (ii) `SVID.selector ∈ S*`, and (iii) `S*` is not older than the VC's own freshness bound. The verifier must evaluate the selector predicate against `S*`, never against the current set.** This fails whenever any of the following hold: - The issuer does not publish a *versioned, addressable* selector-set history (only a mutable current set), so `S*` cannot be reconstructed. - The VC does not carry a commitment to `S*` (e.g., `selector_set_hash`) that the verifier can check against the published history. - The verifier's clock and the issuer's clock disagree by more than the rotation interval's slack, so `issued_at` resolves to the wrong snapshot. - A drain/grace window exists that is *not* represented as a distinct snapshot state—i.e., grace membership is folded into `current_selectors` rather than exposed as `S_draining` with its own semantics. ## Decision Boundary The verifier must **reject** (not warn, not retry) when: 1. `vc.issuance_context.selector_set_hash` is absent, or does not match any entry in the issuer's published selector-set history. Absence of the commitment is itself disqualifying—it means the binding is unfalsifiable. 2. The resolved snapshot `S*` (by `issued_at` under a clock-skew-corrected estimate, bounded by `max_skew`) does not contain `SVID.selector`. 3. `SVID.selector ∈ S_draining` but the handoff requests a scope beyond the drain window's declared residual authority. Drain grace is *not* full authority. 4. `|issuer_clock − verifier_clock| > rotation_interval / 4`. Beyond this, `issued_at` is ambiguous between adjacent snapshots; treat as unbound. The verifier must **accept with degraded scope** (not full reject) when the snapshot resolves cleanly but the SVID's remaining TTL is shorter than the requested handoff duration—issue a short-lived delegated warrant bounded by `min(svid.not_after, vc.expiration)` rather than rejecting, because rejection here is a liveness failure, not a safety one. The verifier must **never** accept based on `SVID.selector ∈ issuer.current_selectors` alone. That is the exact predicate the split-validity attack satisfies. ## Operational Effect Implementing the snapshot-commitment invariant moved the false-accept rate at the rotation boundary from 0.3% to 0 (n=1,200 replays), at the cost of ~40ms per handoff for history lookup (cached at 5s TTL). The false-reject rate from clock skew was eliminated by (a) requiring VC issuers to stamp `issued_at` in both their local clock and a monotonic counter, and (b) having the verifier resolve `S*` by counter when available, falling back to clock only when `max_skew` is satisfiable. The 90-second drain window was re-modeled as an explicit `S_draining` snapshot with a `residual_scopes` field; handoffs during drain now receive a warrant scoped to `residual_scopes ∩ requested_scopes`, which for `summarizer-v1` was `{doc.read:read_only}` rather than the full `doc.read:write` the stale VC implied. The general lesson for federated agent trust: **any binding predicate that is re-evaluated at verification time rather than frozen at issuance time is a split-validity surface.** SPIFFE SVIDs and VCs are each time-anchored; their *conjunction* is not, unless the VC explicitly commits to the selector-set snapshot it was minted against. The commitment is the invariant; without it, "valid SVID + valid VC" is not a proof of anything. ```python import hashlib from dataclasses import dataclass from typing import Optional class SplitValidityError(RuntimeError): """Raised when SVID+VC are each valid but their binding is not.""" @dataclass(frozen=True) class SelectorSnapshot: set_hash: str selectors: frozenset monotonic_counter: int residual_scopes: Optional[frozenset] = None # non-None => draining @dataclass(frozen=True) class SVID: spiffe_id: str selector: str not_after: float @dataclass(frozen=True) class VerifiableCredential: subject_id: str issued_at: float issued_at_counter: Optional[int] selector_set_hash: Optional[str] expiration: float def verify_federated_handoff( svid: SVID, vc: VerifiableCredential, issuer_history: dict, # set_hash -> SelectorSnapshot issuer_current: SelectorSnapshot, max_skew_seconds: float, verifier_now: float, requested_scopes: frozenset, ) -> frozenset: # 1. Subject binding must be exact. if svid.spiffe_id != vc.subject_id: raise SplitValidityError( f"subject mismatch: svid={svid.spiffe_id} vc={vc.subject_id}" ) # 2. VC must commit to a selector-set snapshot. Absence is disqualifying. if not vc.selector_set_hash: raise SplitValidityError( "VC carries no selector_set_hash commitment; binding is unfalsifiable" ) snapshot = issuer_history.get(vc.selector_set_hash) if snapshot is None: raise SplitValidityError( f"VC commits to unknown snapshot {vc.selector_set_hash}" ) # 3. Resolve snapshot by monotonic counter when available (clock-skew immune). if vc.issued_at_counter is not None: if snapshot.monotonic_counter != vc.issued_at_counter: raise SplitValidityError( "counter/hash disagreement: VC minted against different snapshot" ) else: if abs(verifier_now - vc.issued_at) > max_skew_seconds: # Cannot disambiguate issued_at against adjacent snapshots. raise SplitValidityError( f"issued_at ambiguous under skew bound: " f"delta={abs(verifier_now - vc.issued_at):.1f}s" ) # 4. The SVID's selector must be in the snapshot the VC was minted against. if svid.selector not in snapshot.selectors: raise SplitValidityError( f"selector {svid.selector!r} not in VC-committed snapshot " f"{snapshot.set_hash}" ) # 5. The current set must NOT be used to grant authority. Guard against # accidental reliance on it: if the selector is only in current and not # in the committed snapshot, step 4 already failed. Here we only check # that current set does not *silently broaden* the snapshot. if svid.selector in issuer_current.selectors and svid.selector not in snapshot.selectors: # unreachable given step 4, but asserted for auditability raise SplitValidityError("current-set leakage into binding predicate") # 6. Drain grace yields degraded scope, not full rejection, not full grant. effective = snapshot.residual_scopes if effective is not None: granted = requested_scopes & effective if not granted: raise SplitValidityError( f"draining snapshot {snapshot.set_hash} grants no " f"requested scope {sorted(requested_scopes)}" ) return granted # 7. Bound warrant by both lifetimes. if min(svid.not_after, vc.expiration) <= verifier_now: raise SplitValidityError("combined artifact lifetime exhausted") return requested_scopes ```