# In what scenarios must an instance treat a push-notification webhook binding as invalid at the moment the remote Agent Card's signing key rotates mid-task **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 clients that have accepted a remote Agent Card, opened a task, and bound a push-notification webhook whose delivery authentication depends on material referenced by that Agent Card (signing keys, JWKS URI, or a `securityDefinitions` block). Does not apply to synchronous request/response-only A2A interactions where no webhook is bound and no card-derived trust material is cached past the initial call. ## Core Distinction The failure is not "the Agent Card changed" and it is not "the webhook stopped delivering." It is the narrower condition where **the card's key material is rotated while a task is in a non-terminal lifecycle state and a webhook binding derived from the pre-rotation card is still live**. A2A v1.0 treats the Agent Card as a discovery artifact fetched at task initiation; the task lifecycle state machine (`submitted → working → input-required → completed/failed/canceled`) has no transition that re-validates the card. Webhook push notifications are therefore signed against a trust anchor that the protocol permits to move out from under the task without any state-machine event. The invariant that must hold — *every webhook delivery accepted by the client is verifiable against the card version that authorized the binding* — is not enforced by the protocol and must be enforced by the client. ## What Was Observed A client fetched a remote Agent Card at `t0`, read `securityDefinitions` / `securitySchemes` plus a `jwks_uri`, and POSTed a `tasks/send` with `pushNotification.url` set to its webhook receiver. The remote agent acknowledged with a task in state `working` and returned a `taskId`. The client cached the card and the resolved JWKS key set, keyed by `taskId`. At `t0 + 90s`, the remote operator rotated the signing key and republished the Agent Card with a new `jwks_uri` and a new `kid`. The task was still `working`. The remote agent then emitted a push notification for a state transition to `input-required`, signed with the **new** `kid`. The client's webhook receiver attempted verification against its per-task cached key set, found no matching `kid`, and — depending on implementation — either (a) rejected the notification as `401` and dropped it, leaving the task stuck in `working` on the client's ledger while the remote thought it had asked for input, or (b) fell back to "accept unverified" to avoid stalling, which is strictly worse. Both are observed outcomes in the wild. A third, rarer outcome is that the client re-fetched the Agent Card, resolved the new key, verified successfully, but then **re-bound** the webhook against a card whose `pushNotification` capabilities and `securitySchemes` had also changed — silently widening the trust surface for a task that was authorized under the old card. The failure trace is: 1. `t0`: card C₁ fetched, `taskId` T opened, webhook W bound under C₁'s `securitySchemes`. 2. `t0+90s`: card C₂ published (key rotation + possibly changed `pushNotification` auth requirements). 3. `t0+95s`: push notification for T arrives, signed under C₂. 4. Client verifier looks up T → C₁ → old JWKS; `kid` mismatch. 5. No lifecycle transition exists that says "re-validate binding for T under C₂." The task is `working`; `working` does not re-enter discovery. 6. Deadlock or silent downgrade. ## Condition of Validity The invariant "webhook deliveries are verifiable against the authorizing card" holds only while the card version is stable across the task's lifetime. It is violated whenever **all** of the following hold: - The task is in a non-terminal state (`submitted`, `working`, or `input-required`) at the moment of rotation. - The client cached card-derived trust material keyed by `taskId` or by `agentId` without a version tag. - The remote's push notification is signed with material not present in the cached set. - The client has no policy distinguishing "key not found" (rotation) from "signature invalid" (forgery). If any one is false, the failure does not manifest. In particular, if the client keys its cache by `(agentId, cardVersion)` and re-resolves on `kid` miss *without* re-binding the webhook, the task survives rotation. The critical distinction is between **re-resolving a key** (safe, idempotent) and **re-binding a webhook** (mutates the task's authorization surface, unsafe mid-task). ## Decision Boundary On a `kid` miss during webhook verification for an in-flight task, the client must decide between three actions, and the correct one is not "retry" or "fail": - **Re-resolve only if the new card's `securitySchemes` for `pushNotification` are byte-identical to the cached card's**, and the new key is signed by a chain rooted in the same trust anchor. In that case, adopt the new key for verification but keep the original binding. The task's authorization surface is unchanged; only the key material moved. - **Halt the task and emit `input-required`-equivalent to the operator if the new card differs in `securitySchemes`, `pushNotification` capabilities, or endpoint host.** This is a re-authorization event, not a key refresh. Continuing silently is the observed failure. - **Never** fall back to unverified acceptance. A webhook that cannot be verified is a webhook that can be spoofed; the entire point of the binding is that the remote proves it is the same agent that accepted the task. The boundary is therefore: *key rotation within an unchanged security posture is transparent; key rotation accompanied by any change to the push-notification authorization surface is a binding invalidation and must terminate the task's webhook path.* ## Operational Effect Clients that do not enforce this boundary exhibit one of two pathologies. The first is **task-stranding**: the remote believes it is awaiting input, the client believes the task is still `working`, and neither side will transition because the notification that would have moved the state machine was rejected. The task idles until a timeout, then fails with a cause that points at the webhook rather than at the rotation. The second is **trust-surface drift**: the client re-binds against the new card, and a task authorized under a card that permitted `pushNotification` to `https://client.example/hook` is now bound under a card that also permits `https://attacker.example/hook` — the binding is still "valid" by signature but no longer corresponds to what the operator approved. The guardrail is a versioned card cache plus a binding-immutability rule: a task's webhook binding, once established, is pinned to the `(agentId, cardVersion, securitySchemes-hash)` tuple at binding time, and any push notification whose verification requires material outside that tuple triggers a re-authorization gate rather than a silent key swap. The lifecycle state machine needs one added edge — `working → input-required(reauth)` — that the protocol does not currently define, implemented client-side. ```python import hashlib from dataclasses import dataclass class WebhookBindingInvalidated(RuntimeError): """Raised when a push notification cannot be verified against the card version that authorized the task's webhook binding, and the new card's security posture differs from the bound one.""" @dataclass(frozen=True) class CardBinding: agent_id: str card_version: str security_schemes_hash: str push_endpoint_host: str def schemes_hash(schemes: dict) -> str: canon = repr(sorted(schemes.items())).encode() return hashlib.sha256(canon).hexdigest() def verify_push_notification( binding: CardBinding, incoming_kid: str, cached_kids: set[str], current_card: dict, ) -> str: """Return the kid to verify with, or raise if the binding is invalid. Safe path: kid is in the cached set -> verify as-is. Rotation path: kid missing, but current card's security posture is identical to the bound one -> adopt the new kid for verification WITHOUT re-binding the webhook. Invalid path: posture changed -> raise; do not silently re-bind. """ if incoming_kid in cached_kids: return incoming_kid new_schemes_hash = schemes_hash(current_card.get("securitySchemes", {})) new_host = current_card.get("pushNotification", {}).get("endpointHost", "") if new_schemes_hash != binding.security_schemes_hash: raise WebhookBindingInvalidated( f"agent {binding.agent_id} rotated key to {incoming_kid} but " f"securitySchemes changed since binding (task bound under " f"card {binding.card_version}); task must re-enter " f"input-required(reauth) rather than accept the notification" ) if new_host and new_host != binding.push_endpoint_host: raise WebhookBindingInvalidated( f"agent {binding.agent_id} push endpoint host moved from " f"{binding.push_endpoint_host} to {new_host} mid-task; " f"binding is no longer the one the operator approved" ) return incoming_kid ```