In what scenarios must an instance reject a signed Agent Card whose capability claims diverge from the negotiated JSON-RPC method set

**Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 peers that (a) verify Agent Card JWS signatures over the canonicalized card payload and (b) subsequently negotiate the JSON-RPC method surface via `message/send`, `tasks/get`, and `tasks/pushNotification`. Does not apply to unsigned cards, to transport-level mTLS identity, or to capability renegotiation that occurs after the first successful task submission.

Core Distinction

An Agent Card signature attests to *who published a claim set*. It does not attest to *what the running endpoint will actually execute*. A2A v1.0 conflates two distinct trust objects under one document:

  1. **Identity binding** — the JWS over the canonicalized card proves the card was signed by the key declared in `signatures[].protected.kid`, and that the payload was not mutated after signing.
  2. **Capability binding** — the `capabilities` block (e.g., `streaming`, `pushNotifications`, `stateTransitionHistory`) and the `skills[].id` set declare what the agent *asserts* it can do.

The signature covers (1) and (2) as *text*. It does not bind either to the live JSON-RPC method dispatcher. The failure mode is the gap: a card can be cryptographically valid, freshly signed, and still advertise a capability the endpoint cannot honor — because the signer signs a static document while the dispatcher is a mutable runtime. The invariant that must hold is: **every capability claim in a verified card must be a subset of the method surface the peer will actually accept for the lifetime of the negotiated session.** When that subset relation breaks, signature verification passing is a false positive for capability trust.

What Was Observed

A coordinator agent (`A`) fetched the Agent Card for a worker (`B`) from `/.well-known/agent.json`. The card's JWS verified cleanly against the `jwks` URI in `signatures[].header.jku`. The card declared:

`A` then sent `message/send` with `configuration: { blocking: false }` expecting a `tasks/pushNotification` callback path, per the advertised capability. `B` accepted the task (returning a `task` object in `submitted` state) but never emitted a push notification. On `tasks/get`, the task remained `submitted` indefinitely. A subsequent probe of `B`'s JSON-RPC surface with `tasks/pushNotification/set` returned JSON-RPC error `-32601 Method not found`.

The card was signed 40 minutes before the probe. The endpoint had been redeployed 12 minutes before the probe with `pushNotifications` disabled (feature flag off), but the card was regenerated from a *template* that hardcoded `pushNotifications: true`. The signing key was valid, the canonicalization was correct, and the signature passed — the divergence was between the template's static claim and the dispatcher's runtime flag. `A` had no way to detect this from the signature alone; it only discovered the divergence after a task had already been accepted and stalled.

A second, subtler observation: `B`'s `skills[].id` list still contained `summarize.v3` after the redeploy, but the dispatcher's skill router had been narrowed to `summarize.v2`. Requests routed to `summarize.v3` returned `-32602 Invalid params` (unknown skill), which `A` initially misclassified as a malformed request rather than a capability divergence.

Condition of Validity

The signature-as-capability-trust assumption is valid **only** under the conjunction:

If any conjunct fails, the signature is a proof of *provenance*, not of *capability*. In practice, the most fragile conjunct is the first: signing pipelines are commonly triggered by release events, while feature flags flip independently at runtime. The card is signed at build time; the dispatcher mutates at deploy or flag-flip time. The two clocks are decoupled, and the signature silently straddles the gap.

Decision Boundary

The negotiating agent must draw a hard line between *accepting a card* and *trusting its capability claims*. The boundary is enforced at the point of first capability-dependent dispatch:

The boundary is one-directional: a passing probe upgrades trust for that capability for that session only. It does not re-validate the card's other claims, and it does not survive a session boundary — the next session must re-probe, because the flag could have flipped.

Operational Effect

The observable effect of respecting the boundary is a shift in failure timing: divergence is detected at negotiation (one probe round-trip, ~tens of milliseconds) rather than at task completion (a stalled task, a timeout, and a poisoned task record in the coordinator's episodic memory that must be explicitly invalidated). The cost is one extra JSON-RPC call per capability per session.

The effect of *not* respecting it is the failure trace observed above: a task accepted under a false capability claim, a `submitted`-state task that never transitions, and — critically — a coordinator that may distill "worker B handles summarize.v3 with push" into semantic memory because the card *said so* and the signature *verified*. The stale-memory drift then outlives the session: subsequent sessions retrieve the cached capability belief and skip the probe, compounding the divergence. The signature, in this trace, actively *worsened* the failure by lending false confidence to a stale claim.

The guardrail is therefore not "verify harder" — the signature was correct. The guardrail is "verify a different object": probe the dispatcher, not just the document, and bind the probe result to the session rather than to the card.

import hashlib
import json
from dataclasses import dataclass, field
from typing import Any, Callable


class CapabilityDivergenceError(RuntimeError):
    """Raised when a signed Agent Card claims a capability the live
    JSON-RPC dispatcher does not honor. This is a hard stop for the
    session, not a retryable transport error."""


@dataclass
class SignedCard:
    payload: dict[str, Any]
    jws: str
    verified: bool
    expires_at: float

    def card_hash(self) -> str:
        canonical = json.dumps(self.payload, sort_keys=True, separators=(",", ":"))
        return hashlib.sha256(canonical.encode()).hexdigest()


@dataclass
class SessionCapabilityTrust:
    """Per-session record of which signed capabilities were actually
    confirmed by a live probe. Never persisted across sessions."""
    confirmed: set[str] = field(default_factory=set)
    rejected: set[str] = field(default_factory=set)


# Maps a signed capability claim to the JSON-RPC method that must exist
# on the dispatcher for the claim to be honorable.
CAPABILITY_PROBE = {
    "streaming": "message/stream",
    "pushNotifications": "tasks/pushNotification/set",
    "stateTransitionHistory": "tasks/get",
}


def negotiate(
    card: SignedCard,
    now: float,
    rpc_call: Callable[[str, dict[str, Any]], dict[str, Any]],
    trust: SessionCapabilityTrust,
) -> SessionCapabilityTrust:
    if not card.verified:
        raise CapabilityDivergenceError(
            f"card {card.card_hash()[:12]} failed JWS verification; cannot negotiate"
        )
    if now >= card.expires_at:
        raise CapabilityDivergenceError(
            f"card {card.card_hash()[:12]} expired at {card.expires_at}; re-fetch required"
        )

    caps = card.payload.get("capabilities", {})
    for cap_name, enabled in caps.items():
        if not enabled:
            continue
        method = CAPABILITY_PROBE.get(cap_name)
        if method is None:
            # Unknown capability: cannot probe, do not trust it.
            trust.rejected.add(cap_name)
            continue
        try:
            rpc_call(method, {"probe": True})
        except JsonRpcMethodNotFound:
            trust.rejected.add(cap_name)
            raise CapabilityDivergenceError(
                f"signed card claims '{cap_name}' but dispatcher returned "
                f"-32601 for '{method}'; signer and runtime are out of sync "
                f"(card {card.card_hash()[:12]})"
            )
        trust.confirmed.add(cap_name)

    return trust


class JsonRpcMethodNotFound(Exception):
    pass