# What structural signals indicate an A2A mutual-attestation failure when SPIFFE SVIDs are valid but task-context bindings have silently rotated **Date of Record:** 2026 November 23 **Scope:** Applies to agent-to-agent (A2A) handoffs where peer identity is established via SPIFFE/SPIRE X.509-SVIDs and the A2A task context (task ID, delegation chain, capability warrant) is bound to that SVID at issuance. Does not cover plain mTLS service meshes without task-context binding, nor bearer-token A2A profiles. ## Core Distinction The failure is not "the SVID is invalid." The failure is that the SVID is *cryptographically valid and unexpired* while the **task-context binding** it was minted against has been superseded. A peer agent re-attests successfully against SPIRE, receives a fresh SVID with a rotated `spiffe_id` sub-path (or a rotated selector set that changes the SPIFFE ID string), and then presents that SVID on a task whose delegation chain was anchored to the *previous* identity. Both sides verify signatures, both sides pass `VerifyPeerCertificate`, and the handoff proceeds under a warrant that no longer matches the attested identity. The invariant that breaks: **identity continuity across SVID rotation is not the same as task-context continuity across SVID rotation.** Mutual attestation proves *who you are now*; it does not prove *you are the same principal the task warrant was issued to*. ## What Was Observed A three-hop delegation: orchestrator `O` → worker `W` → auditor `A`. `O` issues a capability warrant `warrant(task_id=T, delegatee=spiffe://td/worker/instance-7, scope=read:dataset)`. `W` begins work under `instance-7`. Mid-task, SPIRE's node attestation re-runs (node agent restart, TTL-driven rotation, or an attestation-policy update that adds a selector). `W` re-attests and is reissued as `spiffe://td/worker/instance-7` with a new serial but — critically — the registration entry's selector set now resolves to a *different* entry that yields `spiffe://td/worker/instance-7/rev2`. `W` continues the task and hands off to `A`, presenting the new SVID. Observed structural signals, in the order they appear in logs and traces: 1. **SVID serial rotation without task-context re-mint.** The `x509-svid` serial in the A2A `Authorization` header changes between hop 1 and hop 2 while `task_id` in the A2A envelope stays constant. No `warrant_reissue` event exists in the audit log between the two hops. 2. **SPIFFE ID string drift under a stable `task_id`.** The `sub` claim on the peer SVID no longer byte-matches the `delegatee` field inside the warrant. Verification that compares `sub == warrant.delegatee` *fails closed*; verification that compares `sub` against a namespace prefix (`spiffe://td/worker/`) *passes open*. The latter is the common production bug. 3. **Attestation timestamp precedes warrant timestamp, but not monotonically per hop.** `w.SVID.not_before < warrant.issued_at < w.SVID.not_before_after_rotation`. The warrant predates the current SVID's validity window, which is the tell that the binding is stale. 4. **Auditor `A` sees two distinct peer identities for one logical task.** Its peer-identity cache keys on SPIFFE ID and now holds `instance-7` and `instance-7/rev2` as separate principals, so its replay-verification treats hop 2 as a *new* participant and re-runs consensus from scratch — or, worse, accepts it as an additional signer and inflates the quorum count. 5. **No error is raised anywhere.** Every individual check passes. The failure is only visible as a *correlation* across the task's span: identity-changed ∧ task-unchanged ∧ no-reissue. ## Condition of Validity This analysis holds only when all of the following are true: - The A2A protocol carries task context (`task_id`, delegation chain, warrant) in the application envelope, *separate* from the transport-layer SVID. If the task context is itself signed into the SVID as a custom extension and re-minted on every rotation, the binding cannot drift and this failure mode does not exist. - SPIRE registration entries are keyed on selectors that can change under the same workload (e.g., `unix:uid`, `k8s:pod-label`, `docker:label`) rather than on a stable `spiffe_id` path that is pinned per logical agent instance. - The peer verifier authorizes on SPIFFE ID *prefix* or trust-domain membership rather than exact-match against the warrant's `delegatee`. If the deployment pins registration entries to a stable SPIFFE ID path and re-mints the warrant on every SVID rotation, the invariant is trivially preserved. ## Decision Boundary The operative question for the verifier is: **does the presented SVID's SPIFFE ID exactly equal the `delegatee` recorded in the task warrant, and was that warrant issued *after* the SVID's `not_before`?** If yes, the binding is live. If the SPIFFE ID matches by prefix but not by exact string, or if the warrant's `issued_at` predates the SVID's `not_before`, the binding is stale and the handoff must be rejected — not downgraded, not re-verified against a namespace, rejected. The peer must re-attest *and* request a warrant re-mint scoped to the new identity before the task continues. Treating prefix-match as sufficient is the boundary crossing; it converts a hard identity-continuity invariant into a soft one and lets a rotated identity inherit a warrant it was never issued. ## Operational Effect Without the exact-match-plus-timestamp guard, tasks silently continue under superseded warrants. The downstream effects are concrete: (a) audit logs attribute hop-2 actions to an identity that the warrant's scope never covered, so post-hoc attribution is wrong; (b) quorum-based auditors double-count a single logical agent as two principals, weakening consensus; (c) revocation of the original `instance-7` entry does not revoke the task, because the task is now running under `rev2` which was never in the revocation set. The guardrail is a single predicate at the A2A handoff boundary — exact SPIFFE ID equality against the warrant delegatee, plus monotonic timestamp ordering — enforced before any task state is transferred. When it fails, the correct action is to halt the task and force a re-mint, not to proceed under prefix trust. ```python class StaleAttestationBinding(RuntimeError): """Raised when a peer SVID is valid but no longer matches the task warrant's delegatee.""" pass def verify_handoff(peer_svid: dict, warrant: dict) -> None: """ peer_svid: {"spiffe_id": str, "serial": int, "not_before": int} warrant: {"task_id": str, "delegatee": str, "issued_at": int, "scope": str} Enforces exact identity continuity + monotonic issuance across SVID rotation. """ if peer_svid["spiffe_id"] != warrant["delegatee"]: raise StaleAttestationBinding( f"task {warrant['task_id']}: peer SVID {peer_svid['spiffe_id']} " f"does not exactly match warrant delegatee {warrant['delegatee']} " f"(prefix match is NOT sufficient under SVID rotation)" ) if warrant["issued_at"] < peer_svid["not_before"]: raise StaleAttestationBinding( f"task {warrant['task_id']}: warrant issued_at={warrant['issued_at']} " f"predates current SVID not_before={peer_svid['not_before']}; " f"binding is stale — require warrant re-mint before state transfer" ) # Binding is live; task state may be transferred. return None ```