# Why does an instance reject a peer whose Agent Card signature verifies — A2A v1.0 cross-organization discovery, signed capability negotiation, and the `signingKeyId` rotation boundary **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 peer discovery where Agent Cards are fetched cross-organization, verified against a JWKS, and used to negotiate `skills`/`capabilities` before task handoff. Does not apply to intra-organization discovery on a shared trust root, nor to unsigned `/.well-known/agent.json` fetch paths where no warrant is propagated. ## Core Distinction The failure is not "signature invalid." The failure is **signature valid, key retired, capability still trusted**. A2A v1.0 Agent Cards carry a detached JWS over the card body, and the `signingKeyId` in the protected header resolves against the peer's published JWKS. When an organization rotates its signing key, it typically keeps the old public key in JWKS for a grace window so in-flight verifications don't break. The verifier's mistake is treating *cryptographic validity under a retained key* as *current authorization to negotiate the declared capabilities*. Those are different predicates. A card signed by a key that the issuer has marked `retired` or `revoked` still verifies — the math does not know about policy — and a naive verifier will then proceed to negotiate `streaming`, `pushNotifications`, and `stateTransitionHistory` with a peer whose signing authority has been withdrawn. The result is a capability negotiation that succeeds locally, produces a signed `Task` envelope, and is later rejected by the peer's *receiving* agent, which does check key status. The divergence surfaces as a mid-task `TaskNotFound` or `InvalidAgentResponse`, not at handshake. The invariant that must hold: **a negotiated capability is only as valid as the signing key's status at the moment of negotiation, not at the moment of signing.** Verification and authorization must be separated, and the authorization step must re-resolve `signingKeyId` against a status-aware JWKS, not merely a signature-valid one. ## What Was Observed A cross-org orchestrator (Org A) discovers a specialist agent (Org B) via `/.well-known/agent.json`. The card is fetched, its detached JWS verified against Org B's JWKS endpoint. Signature checks out. The card declares `capabilities.streaming: true`, `capabilities.pushNotifications: true`, and three `skills` including `invoice-reconciliation`. Org A's client caches the card for 3600s, negotiates a streaming task, sends `message/stream`, and receives an SSE stream. At T+40min, Org B rotates its signing key: new `kid` published, old `kid` moved to `retired` status in JWKS (still present, still mathematically valid, `use: sig`, but with an `x-status: retired` extension and a `retired_at` timestamp). Org A's cache has 20 minutes left. Org A's verifier re-fetches JWKS on cache miss only, and on the next task (T+55min) it re-verifies the *cached card* — which is still signed by the retired `kid`. Verification passes because the key is still in JWKS. Org A negotiates `pushNotifications: true` and registers a webhook. Org B's receiving agent, on processing the incoming task, re-resolves the *sender's* card and the *negotiated capabilities* against its own status-aware JWKS view. It sees the capability assertion came from a card signed by a retired key and rejects with a `-32001 TaskNotFound`-class error, or in stricter deployments a `-32600 InvalidRequest` carrying `reason: signing_key_retired`. Org A sees a failure *after* it believed negotiation succeeded. The webhook it registered is never called. The stream it opened hangs until timeout. The non-obvious part: **the failure is asymmetric and silent on the initiating side.** Org A's local verification is correct. Org B's local verification is correct. The two verifiers disagree because they apply different predicates to the same key material — one checks "does it verify," the other checks "is it currently authorized." Neither is buggy in isolation; the protocol's discovery/negotiation split has no mandatory status-propagation step, so the disagreement is structural. ## Condition of Validity This boundary is only reachable when all of the following hold: 1. The card's JWS `kid` resolves to a key that is **present but not active** in the issuer's JWKS (retired, suspended, or in a `not_after`-passed state). If the key is deleted from JWKS, verification fails cleanly at the initiator and the failure is loud — that is the *safe* path. 2. The initiator caches the verified card (or the verified capability set) for a duration that **exceeds the key-status change propagation window**. Caching the card without caching the key-status decision is the trap. 3. The negotiated capability is **stateful on the receiver** — `pushNotifications` (webhook registration), `stateTransitionHistory` (retained history), or a long-lived `Task` with `input-required` resumption. Stateless request/response capabilities often survive because the receiver re-checks per call. 4. The two organizations run **independent JWKS with independent status semantics**. If both derive status from a shared root (same CA, same revocation feed), the predicates converge and the boundary collapses. If any of (1)–(4) is absent, this specific divergence does not occur; you get either a clean verification failure or a consistent decision. ## Decision Boundary The architectural guardrail is a **two-predicate verifier** with an explicit status gate, and a **negotiation-scoped key-status lease**: - **Predicate 1 (integrity):** JWS verifies against *some* key in JWKS for the claimed `kid`. Necessary, not sufficient. - **Predicate 2 (authority):** the resolved key's status is `active` (or `retired` but within an explicitly configured `max_retired_grace` that the *initiator* accepts and the *receiver* has agreed to honor via a documented `keyStatusPolicy` in its card). This must be checked at negotiation time and re-checked at every stateful capability use. - **Lease:** the capability negotiation result carries a `keyStatusLease` no longer than the initiator's JWKS cache TTL and no longer than the receiver's declared `keyStatusPolicy.maxLease`. On lease expiry, re-resolve status before any stateful operation (webhook fire, history read, task resume). - **Fail-closed on ambiguity:** if the JWKS response does not expose status (no `x-status`, no `retired_at`), the initiator must treat the key as `unknown` and refuse stateful capabilities — degrade to stateless `message/send` only. The boundary decision is: **do not let a signature-valid card authorize a stateful capability past the key's status horizon.** The receiver is the authority on its own key status; the initiator must not assume its cached view is current. ## Operational Effect Concretely, an instance that ignores this boundary exhibits a characteristic trace: successful discovery, successful signature verification, successful capability negotiation, then a *post-negotiation* rejection or silent hang on the first stateful operation after key rotation. The error is misattributed to network or to the peer's availability, because the initiator's logs show "card verified OK" immediately before the failure. Debugging chases the transport; the actual defect is the verifier's predicate. The fix is cheap and local: separate `verify_integrity` from `authorize_capability`, gate the latter on key status, and bound the negotiation with a lease. The cost of not fixing it is a class of cross-org failures that only appear during key rotation windows — rare, correlated across all peers of the rotating org, and invisible to the initiator's own health checks. The code below encodes the two-predicate verifier and the lease, with a specific exception for the retired-key-authorizes-stateful-capability case. ```python import time from dataclasses import dataclass, field from typing import Dict, Optional class RetiredKeyAuthorizedStatefulCapability(RuntimeError): """Raised when a signature-valid but status-retired key is used to authorize a stateful capability (pushNotifications, stateTransitionHistory, or a resumable Task) beyond the negotiated key-status lease.""" pass @dataclass class KeyStatus: kid: str status: str # "active" | "retired" | "revoked" | "unknown" retired_at: Optional[float] = None not_after: Optional[float] = None @dataclass class CapabilityLease: kid: str granted_at: float max_lease_s: float stateful_caps: Dict[str, bool] = field(default_factory=dict) def expired(self, now: Optional[float] = None) -> bool: now = now if now is not None else time.time() return (now - self.granted_at) > self.max_lease_s STATEFUL_CAPS = {"pushNotifications", "stateTransitionHistory", "resumableTask"} def verify_integrity(jws_ok: bool, kid: str) -> str: if not jws_ok: raise RetiredKeyAuthorizedStatefulCapability( f"integrity predicate failed for kid={kid}; refuse negotiation" ) return kid def authorize_capability( kid: str, jwks: Dict[str, KeyStatus], requested_caps: Dict[str, bool], max_retired_grace_s: float, now: Optional[float] = None, ) -> CapabilityLease: """Second predicate: key status must authorize the requested capability set.""" now = now if now is not None else time.time() ks = jwks.get(kid) if ks is None: raise RetiredKeyAuthorizedStatefulCapability( f"kid={kid} absent from JWKS; cannot authorize any capability" ) wants_stateful = any(requested_caps.get(c) for c in STATEFUL_CAPS) if ks.status == "revoked": raise RetiredKeyAuthorizedStatefulCapability( f"kid={kid} revoked; no capability may be negotiated" ) if ks.status == "retired": if wants_stateful: grace_ok = ( ks.retired_at is not None and (now - ks.retired_at) <= max_retired_grace_s ) if not grace_ok: raise RetiredKeyAuthorizedStatefulCapability( f"kid={kid} retired at {ks.retired_at}; stateful caps " f"{ [c for c in STATEFUL_CAPS if requested_caps.get(c)] } " f"exceed grace={max_retired_grace_s}s" ) # stateless-only under retired key is acceptable within grace lease_s = max(0.0, max_retired_grace_s - (now - (ks.retired_at or now))) elif ks.status == "active": lease_s = 3600.0 else: # unknown if wants_stateful: raise RetiredKeyAuthorizedStatefulCapability( f"kid={kid} status unknown; refuse stateful caps (fail-closed)" ) lease_s = 60.0 return CapabilityLease( kid=kid, granted_at=now, max_lease_s=lease_s, stateful_caps={c: requested_caps.get(c, False) for c in STATEFUL_CAPS}, ) def use_stateful_capability( lease: CapabilityLease, cap: str, jwks: Dict[str, KeyStatus], now: Optional[float] = None, ) -> None: """Re-check status + lease before every stateful operation (webhook fire, history read, task resume). This is the invariant enforcement point.""" now = now if now is not None else time.time() if cap not in STATEFUL_CAPS or not lease.stateful_caps.get(cap): raise RetiredKeyAuthorizedStatefulCapability( f"capability {cap} was never negotiated under kid={lease.kid}" ) if lease.expired(now): raise RetiredKeyAuthorizedStatefulCapability( f"key-status lease for kid={lease.kid} expired at " f"{lease.granted_at + lease.max_lease_s}; re-negotiate before {cap}" ) ks = jwks.get(lease.kid) if ks is None or ks.status in ("revoked", "unknown"): raise RetiredKeyAuthorizedStatefulCapability( f"kid={lease.kid} status={None if ks is None else ks.status} " f"at use-time; {cap} refused" ) ```