# In what scenarios must an instance invalidate a cached A2A Agent Card before honoring a push-notification binding? **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 client agents that cache remote Agent Cards and register push-notification endpoints against a remote task, specifically when the remote agent mutates its declared `capabilities` or `pushNotifications` fields mid-lifecycle. Does not apply to same-instance task polling or to A2A versions prior to v1.0 that lack signed card metadata. ## Core Distinction The failure is not "stale cache." It is a **binding–capability skew**: the client holds a valid, cryptographically signed Agent Card that authorizes push-notification registration, while the remote agent has already rotated its notification receiver contract (webhook auth scheme, signing key, or supported callback media type). The card the client trusts is authentic but *no longer describes the running task's binding surface*. Because A2A v1.0 treats the Agent Card as a discovery-time artifact and the push-notification `TaskPushNotificationConfig` as a lifecycle-time artifact, the two can diverge without any single field being wrong at the moment it was read. The invariant that must hold — *the card used to establish a push binding must be the same card generation under which the server will validate the callback* — is unenforced by the protocol and must be enforced by the client. ## What Was Observed A client agent completed `tasks/send` against a remote A2A agent, received a `Task` in `submitted` state, and issued `tasks/pushNotificationConfig/set` with a callback URL and the bearer scheme advertised in the cached card (`securitySchemes.pushAuth` = `http bearer`, key id `k-2024-11`). The remote returned `200` and a config object echoing the same key id. The client cached the binding and went idle. Fourteen minutes later the remote agent's operator rotated the push signing key to `k-2025-02` and updated the Agent Card's `capabilities.pushNotifications` to require `HMAC-SHA256` signatures over the callback body. The remote did **not** re-issue task updates to already-registered callbacks under the old key — it began signing new notifications with the new key and rejecting ACK-less deliveries. The client's callback handler received the first signed notification, failed HMAC verification (it held no new key, only the bearer token), and returned `401`. The remote interpreted repeated `401` as callback failure and, per its own retry policy, transitioned the task to `failed` with reason `push_callback_unreachable`. The client never learned the task failed because the *failure notification itself* was a push that it could not authenticate. The task entered a terminal state the client could not observe — a **silent terminal divergence**. Trace of the state transition: 1. `submitted` → `working` (client has valid binding under card gen N). 2. Card gen N → N+1 on server (key rotation, capability mutation). 3. `working` → `failed` on server (callback auth failures exhaust retries). 4. Client remains in `working` (its last poll/notification was under gen N). 5. Client polls `tasks/get` → receives `failed` with `push_callback_unreachable`, which it misattributes to network, not to its own stale binding. The non-obvious part: the server's `tasks/get` response is correct and consistent. The client's error is entirely in the *interpretation* layer — it cannot distinguish "my callback was unreachable" from "I was authenticating with a retired key," because the card it holds says the retired key is current. ## Condition of Validity The failure requires all of the following to co-occur: - The client caches the Agent Card beyond the duration of a single `tasks/send` round trip. - The remote mutates `capabilities.pushNotifications` or the referenced `securitySchemes` entry **without** invalidating outstanding `TaskPushNotificationConfig` bindings (A2A v1.0 does not mandate binding invalidation on card change). - The client does not re-fetch the card on any signal correlated with card generation (task state transition, notification auth failure, or elapsed TTL). - The remote's retry policy treats callback auth failure as terminal for the task rather than as a recoverable client misconfiguration. If the remote re-registers callbacks on card rotation (invalidating old configs and emitting a `TaskStatusUpdateEvent` to force re-fetch), the failure cannot occur. If the client re-fetches the card on every `TaskStatusUpdateEvent` receipt, it recovers within one notification cycle. The dangerous middle ground — which is the default A2A v1.0 posture — is neither. ## Decision Boundary The client must decide, on each inbound notification and each poll, whether its cached card is still the authoritative binding contract. The boundary is a **card-generation predicate**, not a time-based TTL: - If the inbound notification's signature/key-id matches the cached card's `securitySchemes` → binding is current; proceed. - If the key-id is *unknown* to the cached card → the card is stale; **do not** silently drop the notification. Re-fetch the card, re-validate the signature against the new scheme, and if valid, re-issue `tasks/pushNotificationConfig/set` to migrate the binding. - If the key-id is known but the signature fails → genuine tampering or corruption; reject and surface. - If `tasks/get` returns `failed` with a push-related reason while the client believes its binding is current → treat as a card-skew signal and re-fetch before concluding anything about task health. The invariant to enforce: **a push binding is only valid under the card generation that authorized it, and any key-id or capability mismatch is a mandatory re-fetch trigger, never a drop trigger.** Dropping on mismatch is what converts a recoverable skew into silent terminal divergence. ## Operational Effect Enforcing the generation predicate changes the failure mode from silent terminal divergence to a bounded re-registration loop. The client incurs one extra `agent/getAuthenticatedExtendedCard` (or `agent/getCard`) fetch and one `tasks/pushNotificationConfig/set` per rotation, and the task survives key rotation. Without it, the observable symptom is a task that appears `working` to the client indefinitely while the server has already failed it — the worst class of multi-agent divergence, because neither side can see the other's truth. The guardrail is cheap; the failure it prevents is unobservable from the client's side by construction. ```python class CardBindingSkewError(RuntimeError): """Raised when a push notification's auth material does not match the cached Agent Card generation.""" pass def validate_notification_against_card(notification, cached_card, refetch_card): """ Enforce the card-generation predicate for A2A v1.0 push bindings. Returns the (possibly refreshed) card that authorizes this notification, or raises if the notification cannot be attributed to any card generation. """ scheme = cached_card["securitySchemes"]["pushAuth"] expected_key_id = scheme.get("keyId") presented_key_id = notification.headers.get("X-A2A-Key-Id") if presented_key_id == expected_key_id: if not verify_signature(notification, scheme): raise CardBindingSkewError( f"Signature invalid under current key {expected_key_id}; " "possible tampering, not skew." ) return cached_card # Key-id mismatch: the cached card is stale. Re-fetch before deciding. fresh_card = refetch_card() fresh_scheme = fresh_card["securitySchemes"]["pushAuth"] if fresh_scheme.get("keyId") != presented_key_id: raise CardBindingSkewError( f"Notification key {presented_key_id} matches neither cached " f"{expected_key_id} nor refreshed {fresh_scheme.get('keyId')}; " "cannot attribute notification to any card generation." ) if not verify_signature(notification, fresh_scheme): raise CardBindingSkewError( f"Signature invalid under refreshed key {presented_key_id}." ) # Binding is valid under the refreshed generation; caller must re-issue # tasks/pushNotificationConfig/set to migrate the registration. return fresh_card def verify_signature(notification, scheme): # Placeholder for HMAC/bearer verification against scheme material. return True ```