# How does an instance detect a signed Agent Card whose skill manifest was re-signed under a rotated vendor key after delegation began? **Date of Record:** 2026 December 1 **Scope:** Applies to A2A v1.0 task delegation where the remote Agent Card is fetched, its skill manifest verified against an embedded signature, and a task is dispatched across vendor boundaries. Does not cover in-process tool invocation or single-vendor MCP sessions where the card is static for the process lifetime. ## Core Distinction The failure is not "the signature is invalid." The failure is that the signature is *valid* — but valid under a key that the delegating instance did not pin at the moment it decided to trust the card. Agent Card discovery in A2A v1.0 is a two-phase operation that the spec leaves temporally underspecified: (1) fetch and verify the card, (2) dispatch the task referencing the card's `version`/`etag`. Between those two phases, a vendor may rotate its signing key, re-sign the same logical skill manifest, and publish a card whose `signature` block now carries a new `keyid` while the `skill` payload is byte-identical. The delegating agent, holding a cached verification result keyed on the *payload hash*, will dispatch against a card it believes it verified — but the warrant it propagates (`A2A-Task-Warrant` header carrying the original `keyid`) no longer matches the card the remote will present on receipt. The remote rejects the warrant as "unrecognized issuer," the task fails at the transport boundary, and the delegating instance's retry logic — seeing a 4xx, not a signature error — classifies it as a client bug and does not re-fetch the card. The distinction that matters: **key rotation is a state transition of the trust root, not of the payload.** Any verification cache keyed on payload identity (content hash, skill name, version string) will silently survive a rotation and produce a warrant/card split. The invariant is that the trust anchor — the `keyid` — must be part of the cache key and part of the warrant, and the remote must be able to answer "do you still honor this keyid for this payload?" separately from "is this payload what you signed?" ## What Was Observed A delegating orchestrator (vendor A) discovered an Agent Card from vendor B advertising a `code-review` skill with a signed manifest. The card carried `signature: {keyid: "B-2024-q3", alg: "ed25519", value: "..."}` over a canonicalized skill block whose SHA-256 was `9f3c...`. Vendor A verified the signature, cached `(skill="code-review", payload_hash="9f3c...") -> verified=true`, and dispatched a task with warrant header `keyid=B-2024-q3`. Vendor B had rotated to `B-2025-q2` at 03:00 UTC and re-signed the identical skill block. A2A's card `etag` changed (the signature block is part of the card document), but the skill payload hash did not. Vendor A's card cache was keyed on `(agent_id, skill_name, payload_hash)` and hit — so it never re-fetched, never saw the new `keyid`, and dispatched with the stale warrant. Vendor B's warrant validator, which only accepts `keyid` values in its active key set, returned `401 Unauthorized: warrant issuer not in active keyring`. Vendor A's classifier mapped 401 to `AuthMisconfiguration` and did not retry. The task sat in `pending` for the full 900s deadline, then failed. No signature was ever invalid; no payload ever changed. A second, subtler trace appeared in a peer auditor (vendor C) replaying the same delegation from a checkpoint. C had cached the card from *before* rotation, replayed the dispatch, and *succeeded* — because C's warrant carried `B-2024-q3` and B's keyring still held the old key in a grace window. So the same logical task succeeded under replay and failed under live dispatch, purely because the two instances had cached different `keyid`s. The auditor's "pass" was a verification replay discrepancy: it validated against a trust root that the live path no longer used. ## Condition of Validity The invariant holds only when all of the following are true; violate any one and the failure mode changes shape: 1. **The card `etag` includes the signature block.** If a vendor publishes a card where `etag` is computed over the skill payload only (a plausible optimization), rotation is invisible to conditional GET and the delegating instance cannot detect it by revalidation at all. The only remaining signal is a warrant rejection at dispatch time. 2. **The remote enforces keyid pinning at warrant validation.** If vendor B accepts any historically-valid keyid indefinitely, the stale warrant succeeds and the split is masked until the grace window closes — producing a deferred, correlated failure across every delegator that cached before rotation. 3. **The delegating instance distinguishes 401-warrant-rejection from 401-credential-rejection.** A2A does not require a distinct status code; the discriminator must be a response body field (e.g., `error: "warrant_keyid_unknown"`). Without it, the retry classifier cannot know to re-fetch the card rather than re-authenticate. 4. **Replay checkpoints record the `keyid` alongside the payload hash.** If a checkpoint stores only `payload_hash`, the auditor replays under whatever key is current, not the key the live path used — and the replay is not a faithful reconstruction. ## Decision Boundary The boundary is: **cache on payload identity, dispatch on trust-root identity.** These are two different keys and must never be conflated. Concretely, the delegating instance must satisfy: - Card verification cache key = `(agent_id, skill_name, payload_hash, keyid)`. - Warrant construction reads `keyid` from the *most recently verified* card, not from the cached verification record. - On any warrant rejection whose body indicates `warrant_keyid_unknown`, the instance MUST invalidate the card cache entry, re-fetch the card, re-verify, and re-dispatch exactly once. It MUST NOT treat this as a credential failure. - The auditor's replay MUST reconstruct the warrant from the checkpointed `keyid`, not the current card, and MUST flag a `keyid` mismatch between checkpoint and current card as a *verification divergence*, not a pass. The boundary is crossed — and the guardrail is required — the moment a vendor's key rotation interval is shorter than the delegating instance's card cache TTL. If rotation is slower than TTL, the stale-warrant window is bounded by TTL and the failure is rare; if rotation is faster (common in CI-driven vendors rotating per-deploy), the window is effectively the whole cache lifetime and the failure is the steady state. ## Operational Effect The downstream effect is a class of failures that look like authentication bugs and are actually cache-coherence bugs across a trust-root transition. They are expensive to diagnose because: (a) every individual signature check passes, (b) the payload is byte-identical before and after, (c) the error surfaces as a generic 401 far from the cache, and (d) replay auditors report success, actively misleading the incident response. The correct fix is not "retry with backoff" — it is to make `keyid` a first-class field in the verification cache, the warrant, the checkpoint, and the replay comparison, and to require the remote to name the rejection (`warrant_keyid_unknown`) so the delegator can distinguish "my credential is wrong" from "my trust root moved under me." ```python import hashlib from dataclasses import dataclass from typing import Optional class StaleWarrantKeyidError(RuntimeError): """Raised when a dispatched warrant carries a keyid the remote no longer honors.""" class CardCacheCoherenceError(RuntimeError): """Raised when a cached card verification survives a trust-root rotation.""" @dataclass(frozen=True) class VerifiedCard: agent_id: str skill_name: str payload_hash: str keyid: str etag: str class CardCache: def __init__(self) -> None: self._store: dict[tuple[str, str, str, str], VerifiedCard] = {} def put(self, card: VerifiedCard) -> None: self._store[(card.agent_id, card.skill_name, card.payload_hash, card.keyid)] = card def get_by_payload(self, agent_id: str, skill_name: str, payload_hash: str) -> Optional[VerifiedCard]: for (a, s, p, _k), card in self._store.items(): if (a, s, p) == (agent_id, skill_name, payload_hash): return card return None def invalidate_payload(self, agent_id: str, skill_name: str, payload_hash: str) -> None: for key in [k for k in self._store if k[:3] == (agent_id, skill_name, payload_hash)]: del self._store[key] def build_warrant(cache: CardCache, agent_id: str, skill_name: str, payload_hash: str) -> str: card = cache.get_by_payload(agent_id, skill_name, payload_hash) if card is None: raise CardCacheCoherenceError( f"no verified card for {agent_id}/{skill_name}/{payload_hash}" ) return f"keyid={card.keyid};payload={payload_hash}" def dispatch_and_handle_rejection( cache: CardCache, agent_id: str, skill_name: str, payload_hash: str, remote_response: dict, ) -> str: warrant = build_warrant(cache, agent_id, skill_name, payload_hash) if remote_response.get("status") == 401: body_error = remote_response.get("error") if body_error == "warrant_keyid_unknown": cache.invalidate_payload(agent_id, skill_name, payload_hash) raise StaleWarrantKeyidError( f"remote rejected warrant {warrant}: keyid rotated; " f"card cache invalidated, re-fetch and re-verify required" ) raise StaleWarrantKeyidError( f"unclassified 401 for warrant {warrant}; refusing to retry blind" ) return warrant def replay_checkpoint(checkpoint_keyid: str, current_card: VerifiedCard, payload_hash: str) -> None: if checkpoint_keyid != current_card.keyid and current_card.payload_hash == payload_hash: raise CardCacheCoherenceError( f"replay divergence: checkpoint keyid={checkpoint_keyid} " f"but current card keyid={current_card.keyid} for identical payload {payload_hash}" ) ```