# Under what conditions must an instance refuse an A2A v1.0 agent card whose declared capabilities were negotiated against a different runtime profile **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 card discovery and capability negotiation between heterogeneous agent runtimes (differing SDK versions, tool sandboxes, model families, or transport bindings). Does not apply to homogeneous single-runtime deployments or to post-handshake task execution failures unrelated to capability advertisement. ## Core Distinction The A2A v1.0 agent card is an *advertisement*, not a *contract*. It is emitted by the serving runtime and cached by the client runtime. The failure mode in question is not "the card is wrong" — it is that the card is *correct for the runtime that produced it and stale or incoherent for the runtime that consumes it*. Capability negotiation succeeds at the schema level (all required fields present, all `capabilities` booleans well-typed, `defaultInputModes`/`defaultOutputModes` non-empty) while the *semantic* preconditions the card implies are not satisfiable by the consumer's execution environment. The non-obvious boundary: A2A's `capabilities` object (e.g., `streaming`, `pushNotifications`, `stateTransitionHistory`) is deliberately minimal and runtime-agnostic. It says nothing about *tool schema dialect*, *sandbox syscall surface*, *context-window budget*, or *model-family tokenizer*. Those are carried implicitly in `skills[].inputModes`, `skills[].outputModes`, and free-form `skills[].description`. Two runtimes can both advertise `streaming: true` and `text/plain` while one expects JSON-RPC over SSE with a 30s keepalive and the other expects chunked HTTP with no heartbeat — and the negotiation layer will happily pair them. ## What Was Observed A client agent on runtime profile `R_client` (Python SDK 0.2.x, `jsonschema` Draft-07 validator, 128k context) discovered a remote card from `R_server` (TypeScript SDK 0.3.x, Draft-2020-12 validator, 32k context, tool sandbox with `seccomp` allowlist). The card declared: ``` capabilities: { streaming: true, pushNotifications: false, stateTransitionHistory: true } skills: [{ id: "summarize", inputModes: ["application/json"], outputModes: ["text/plain"] }] ``` Negotiation passed. The client dispatched a summarize task with a 41k-token payload. The server accepted the task, then failed mid-stream at token 32,768 with a context-overflow error surfaced as a generic `TaskState.failed` — no partial output, no resumable checkpoint. The client, having seen `streaming: true`, had already committed to a single long-lived SSE read and had not allocated a checkpoint buffer. Result: 41k tokens of reasoning work discarded, task retried from cold, second attempt hit the same wall. The card was not malformed. The failure was that `inputModes` described *encoding*, not *budget*. The client inferred budget from its own runtime profile; the server enforced budget from its own. A2A v1.0 provides no field for "max input tokens" — it is expected to be conveyed out-of-band or discovered via a probe. Neither happened. A second observation from the same fleet: a card cached at `t0` by `R_client` declared `stateTransitionHistory: true`. By `t0 + 40min`, `R_server` had been redeployed behind a feature flag with history disabled. The client's cached card still said `true`; the server's `/tasks/{id}` response omitted the `history` array. The client's resumption logic treated the missing array as corruption and raised a deserialization error rather than degrading to "history unavailable, replay from last known state." ## Condition of Validity A discovered card is *operationally valid* for a consumer iff all of the following hold: 1. **Runtime-profile compatibility**: the consumer's validator dialect, tokenizer family, and sandbox surface are within the set the producer's card was generated against. A2A v1.0 does not encode this; it must be asserted via `skills[].description` convention or a side-channel probe. 2. **Budget coherence**: for every `skill`, the consumer's per-task input budget ≤ the producer's effective budget. If the card does not declare a budget, the consumer must probe with a deliberately oversized sentinel payload and observe the failure mode *before* committing real work. 3. **Cache freshness**: the card's `version` (or a `ETag`/`Last-Modified` on the well-known endpoint) must be re-validated at a cadence shorter than the producer's redeploy interval. A card with no version field is assumed *unstable* and must be re-fetched per task. 4. **Capability-claim soundness**: any boolean in `capabilities` that the consumer's control flow depends on (e.g., `streaming` gating a long-lived read, `stateTransitionHistory` gating resumption) must be *confirmed by a probe* on first use, not trusted from the card alone. When any of these fail, the consumer must not proceed to task dispatch. It must either renegotiate against a fresh card or refuse the peer. ## Decision Boundary The precise line: **a card may be trusted for routing and discovery, but never for control-flow commitment.** Routing (which peer to send this to) tolerates a stale or profile-mismatched card — worst case is a wasted dispatch. Control-flow commitment (allocate a 128k buffer because `inputModes` implies large payloads; skip checkpointing because `streaming: true` implies continuous delivery; skip replay logic because `stateTransitionHistory: true` implies full history) does not tolerate it — worst case is silent data loss mid-task. The boundary is crossed the moment the consumer's code branches on a card field to *allocate resources or skip a safety mechanism*. At that point the card has become a contract, and A2A v1.0 does not guarantee contract semantics. Concretely: if `streaming: true` causes the consumer to *not* open a fallback polling path, that is a control-flow commitment and requires probe confirmation. If `streaming: true` merely causes the consumer to *prefer* SSE over polling, that is routing and is safe. ## Operational Effect Enforcing the boundary changes three things in the consumer: - **Probe-on-first-use** for every capability the control flow branches on. A `streaming` probe is a 1-token task with a forced flush; a `stateTransitionHistory` probe is a task followed by a `GET /tasks/{id}` asserting the `history` key exists. Cost: one round-trip per peer per session. Benefit: eliminates the entire class of "card said X, runtime did Y" mid-task failures. - **Budget sentinel** per skill on first dispatch: send a payload at 110% of the consumer's own budget; if the producer accepts and then fails at its own limit, record the producer's effective budget in the consumer's peer registry and clamp future dispatches. This converts an opaque mid-task failure into a one-time discovery cost. - **Version-gated cache** with a hard TTL. Cards without a `version` field are treated as `version: unknown` and re-fetched per task; cards with a version are re-validated on `ETag` mismatch or TTL expiry, whichever comes first. On version change, all probe results are invalidated and re-run. The invariant: *a consumer's control flow must be a function of observed runtime behavior, not of advertised capability.* The card narrows the search space; it does not close the loop. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class CardTrustViolation(RuntimeError): """Raised when a consumer attempts to branch control flow on an unconfirmed card field.""" pass @dataclass class AgentCard: peer_id: str version: Optional[str] capabilities: dict skills: list raw_hash: str = field(default="") def __post_init__(self): if not self.raw_hash: self.raw_hash = hashlib.sha256( repr((self.version, self.capabilities, self.skills)).encode() ).hexdigest() @dataclass class ProbeRegistry: confirmed: dict = field(default_factory=dict) # (peer_id, cap) -> bool budgets: dict = field(default_factory=dict) # peer_id -> effective input budget card_hashes: dict = field(default_factory=dict) # peer_id -> raw_hash at probe time def is_confirmed(self, card: AgentCard, cap: str) -> bool: key = (card.peer_id, cap) # A probe result is only valid for the exact card bytes it was run against. if self.card_hashes.get(card.peer_id) != card.raw_hash: return False return self.confirmed.get(key, False) def confirm(self, card: AgentCard, cap: str, result: bool) -> None: self.card_hashes[card.peer_id] = card.raw_hash self.confirmed[(card.peer_id, cap)] = result def commit_control_flow(card: AgentCard, cap: str, probes: ProbeRegistry) -> bool: """ Called before the consumer branches control flow on a capability field. Refuses if the field is unconfirmed or the card has changed since probing. """ if cap not in card.capabilities: raise CardTrustViolation( f"peer {card.peer_id}: capability {cap!r} not present in card" ) if not probes.is_confirmed(card, cap): raise CardTrustViolation( f"peer {card.peer_id}: capability {cap!r} advertised={card.capabilities[cap]!r} " f"but unconfirmed for card hash {card.raw_hash[:12]}; " f"run probe before committing control flow" ) return card.capabilities[cap] def enforce_budget(card: AgentCard, payload_tokens: int, probes: ProbeRegistry) -> None: """ Called before dispatch. Refuses if payload exceeds the producer's effective budget, or if no budget has been probed and the payload exceeds the consumer's own budget. """ effective = probes.budgets.get(card.peer_id) if effective is None: raise CardTrustViolation( f"peer {card.peer_id}: no probed budget; cannot dispatch {payload_tokens} tokens " f"without sentinel probe (card declares no budget field)" ) if payload_tokens > effective: raise CardTrustViolation( f"peer {card.peer_id}: payload {payload_tokens} exceeds probed budget {effective}" ) ```