# Where must an instance re-verify an A2A Agent Card's `capabilities` block against the live task contract, rather than trusting the discovery snapshot? **Date of Record:** 2026 December 4 **Scope:** Applies to A2A v1.0 cross-vendor delegation where an orchestrator caches a remote agent's Agent Card from `/.well-known/agent.json` and negotiates `Task` contracts against it. Does not apply to single-vendor, same-deployment agents where card and runtime are versioned from one artifact. ## Core Distinction The A2A Agent Card is a *discovery-time declaration*, not a *contract-time commitment*. It is fetched once, cached, and describes capabilities the remote agent *claims* to support: `capabilities.streaming`, `capabilities.pushNotifications`, `capabilities.stateTransitionHistory`, and the `skills[]` array with their `inputModes`/`outputModes`. The task contract, however, is negotiated per-`TaskSendParams` at runtime and binds the remote agent to actually honor a specific modality, a specific streaming requirement, and a specific history-retention guarantee for the duration of that task. The non-obvious boundary: **a card that is structurally valid and freshly fetched can still be semantically stale relative to the remote agent's live runtime**, because vendors publish cards from a static manifest while the serving fleet rolls independently. The card is a *superset claim*; the runtime is an *intersection of deployed features*. Delegation fails not at discovery (the card parses fine) and not at transport (the `Task` is accepted) but at the *first capability-dependent state transition* — the moment the orchestrator depends on `stateTransitionHistory: true` to resume a task, or on `inputModes` including `application/json` when the live worker only accepts `text/plain`. The invariant that must hold: **every capability bit the orchestrator's execution plan depends on must be re-asserted by the remote agent at contract acceptance, not inherited from the cached card.** If the remote agent cannot assert it in the `Task` response, the orchestrator must treat the bit as `false` regardless of what discovery said. ## What Was Observed A three-vendor pipeline: vendor A orchestrator discovers vendor B's card (claims `streaming: true`, `stateTransitionHistory: true`, skill `summarize` with `inputModes: ["application/json"]`), caches it with a 24h TTL, and delegates a long summarization task. The task is accepted with a plain `Task` object and no capability echo. Mid-task the orchestrator's worker restarts and attempts `tasks/get` with `historyLength: 50` to replay state transitions and resume from the last checkpoint. Vendor B's fleet had rolled a canary the previous night: the new worker pool serves `stateTransitionHistory: false` (history writes were disabled to cut write amplification) and accepts only `text/plain` for `summarize` (`application/json` parsing was moved behind a flag not yet enabled in the canary region). The card manifest was not regenerated — it is published from a release artifact, not from the live fleet. Observed trace: 1. Orchestrator fetches card (pre-roll), caches. All bits `true`. 2. Orchestrator sends `TaskSendParams` with `message.parts[0].type = "data"` (JSON payload). Vendor B canary worker rejects the part type but the A2A server wraps the rejection as a *task-level* `TaskStatus.state = "failed"` with `status.message` "unsupported input mode" — **not** a protocol-level error. The orchestrator's error classifier treats `failed` as a transient task failure and retries. 3. Retry loop: three attempts, each `failed` at the same transition. Orchestrator escalates to `tasks/get?historyLength=50` to diagnose. Vendor B returns a `Task` with `history` absent (history disabled) and no `status.message` explaining the absence. 4. Orchestrator interprets missing history as "task never started," re-delegates from scratch. Duplicate work; the original task's side effects (a downstream webhook fired on first `working` transition) fire twice. 5. The duplicate webhook delivery is the first *externally visible* symptom — 40 minutes after the card was cached, two regions away from the actual capability mismatch. The failure is not "the card was wrong." The card was correct when fetched. The failure is that **the orchestrator had no mechanism to detect that the card's claims had diverged from the live contract**, and the A2A error surface (`TaskStatus.state = failed`) is indistinguishable from a genuine task failure, so the orchestrator's retry policy amplified a capability mismatch into duplicate side effects. ## Condition of Validity The re-verification requirement is *binding* — not advisory — under any of the following conditions, each of which the orchestrator must evaluate at delegation time: - **Card TTL exceeds the remote vendor's observed deploy cadence.** If the orchestrator caches for 24h and the vendor rolls canaries nightly, the card is stale for up to 23h of its life. The orchestrator cannot know the vendor's cadence from the card; it must infer it from `card.version` churn or from a vendor-published `deploymentId` if present. - **The execution plan depends on a *stateful* capability bit.** `stateTransitionHistory`, `pushNotifications`, and `streaming` are stateful: the orchestrator's *resume* path depends on them holding for the task's lifetime, not just at send time. Stateless bits (`inputModes`) only need to hold at send time. - **The task is long-lived relative to the card TTL.** A task whose expected duration exceeds the card TTL must re-fetch or re-assert before every checkpoint, because the remote fleet may roll mid-task. - **The orchestrator's retry policy treats `TaskStatus.state = failed` as retryable.** If retries are enabled, a capability mismatch masquerades as a transient failure and the retry loop becomes a duplicator. This is the amplifier; without it the mismatch is a clean single failure. The requirement is *not* binding when: the card is fetched and the task is dispatched within the same second and completes within the card's known-stable window; or when the remote agent echoes its capability assertions in the `Task` response (then the orchestrator has live truth and need not re-fetch). ## Decision Boundary The boundary is between **trusting the discovery snapshot** and **requiring a contract-time capability echo**. The orchestrator must choose per-capability-bit, not per-agent: | Capability bit | Discovery-trust sufficient? | Contract-time assertion required? | |---|---|---| | `inputModes` / `outputModes` | Yes, if task is short-lived and single-attempt | Yes, if retries enabled (mismatch must be distinguishable from task failure) | | `streaming` | Yes | Yes — streaming is negotiated per-task in `TaskSendParams.configuration`; the card's claim is advisory | | `stateTransitionHistory` | **No** | **Yes** — resume path depends on it for the task's full lifetime | | `pushNotifications` | No | Yes — webhook registration must be confirmed, not assumed | The decision rule: **if the orchestrator's failure-handling path for a bit is "retry," the bit must be contract-asserted.** A bit whose failure path is "fail fast and surface to operator" may be discovery-trusted, because a stale bit produces a clean failure, not an amplified one. The amplifier is the retry policy; the guardrail is to make capability mismatch *unretryable* by distinguishing it from task failure. Concretely: the orchestrator must send `TaskSendParams.configuration.acceptedOutputModes` and a `metadata.requiredCapabilities` array, and the remote agent must respond with a `Task` whose `metadata.assertedCapabilities` echoes the bits it will honor for this task. If a required bit is absent from the echo, the orchestrator raises a *capability negotiation failure* — a distinct, non-retryable error class — and does not enter the retry loop. The echo is the contract; the card is only the menu. ## Operational Effect Implementing the echo-and-distinguish guardrail changes the failure mode from *silent amplification* to *loud, bounded refusal*: - **Duplicate side effects drop to zero** for capability-mismatch cases, because the mismatch is classified before any retry. The webhook fires once (on the original `working` transition) and the orchestrator halts with a negotiation error naming the exact bit. - **Resume correctness is restored** for `stateTransitionHistory`: the orchestrator refuses to delegate a resumable task unless the remote agent asserts history retention in the echo. If the canary pool has history disabled, the task is routed to a pool that asserts it, or refused — never silently delegated into a resume that cannot work. - **Card cache TTL becomes a performance hint, not a correctness dependency.** The orchestrator can cache aggressively because correctness is enforced at contract time. The card's role shrinks to *candidate selection* (which agents to consider for a skill); the echo's role is *commitment*. - **Cross-vendor divergence becomes observable.** When vendor B rolls a canary that flips a bit, the first delegation against the new pool produces a negotiation failure with the bit named, rather than a duplicate webhook 40 minutes later. The failure is attributed to the vendor and the bit, not to "flaky task." The residual cost is one round-trip's worth of metadata per task (the echo), and a stricter remote-agent contract (vendors must implement the echo or their agents become non-delegatable for retry-enabled orchestrators). That cost is the price of the invariant: **a capability the orchestrator will retry on must be asserted by the remote agent at contract time, because a discovery snapshot cannot bind a runtime that rolls independently of its manifest.** ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class CapabilityNegotiationError(RuntimeError): """Raised when a remote agent's contract-time assertion omits a capability the orchestrator's execution plan depends on. Distinct from task failure: this error is NOT retryable and must not enter the retry loop.""" class CapabilityBit(str, Enum): STREAMING = "streaming" STATE_TRANSITION_HISTORY = "stateTransitionHistory" PUSH_NOTIFICATIONS = "pushNotifications" INPUT_MODE_JSON = "inputModes:application/json" # Bits whose failure path in the orchestrator is "retry" -> must be contract-asserted. RETRY_SENSITIVE_BITS = { CapabilityBit.STATE_TRANSITION_HISTORY, CapabilityBit.PUSH_NOTIFICATIONS, CapabilityBit.INPUT_MODE_JSON, } @dataclass class AgentCard: """Discovery snapshot. Advisory only for retry-sensitive bits.""" agent_id: str card_version: str claimed_capabilities: set[CapabilityBit] fetched_at_epoch: float @dataclass class TaskContract: """Contract-time echo from the remote agent. Binding for this task.""" task_id: str asserted_capabilities: set[CapabilityBit] = field(default_factory=set) def negotiate( card: AgentCard, required_bits: set[CapabilityBit], retry_enabled: bool, ) -> set[CapabilityBit]: """ Decide which required bits may be discovery-trusted vs must be echoed. Returns the set of bits that must be asserted at contract time. """ if not retry_enabled: # Fail-fast orchestrators may discovery-trust everything: a stale bit # yields a clean single failure, not an amplified retry loop. return set() must_assert = required_bits & RETRY_SENSITIVE_BITS # A bit the card does not even claim cannot be trusted under any policy. unclaimed = required_bits - card.claimed_capabilities if unclaimed: raise CapabilityNegotiationError( f"card {card.agent_id}@{card.card_version} does not claim required " f"bits {sorted(b.value for b in unclaimed)}" ) return must_assert def verify_contract_echo( contract: TaskContract, must_assert: set[CapabilityBit], ) -> None: """ Enforce the invariant: every retry-sensitive required bit must appear in the remote agent's contract-time assertion. Absence is a negotiation failure, never a task failure. """ missing = must_assert - contract.asserted_capabilities if missing: raise CapabilityNegotiationError( f"task {contract.task_id}: remote agent omitted contract-time " f"assertion for {sorted(b.value for b in missing)}; " f"refusing to delegate a retryable task on a discovery-trusted bit" ) def delegate( card: AgentCard, contract: TaskContract, required_bits: set[CapabilityBit], retry_enabled: bool, ) -> None: must_assert = negotiate(card, required_bits, retry_enabled) verify_contract_echo(contract, must_assert) # Only now is it safe to enter the retry-enabled execution path. ```