# How should an instance reconcile an Agent Card's declared capabilities against an observed schema mismatch during A2A v1.0 cross-framework delegation? **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 (Agent-to-Agent) task delegation where a client agent discovers a remote agent via its Agent Card and constructs `Task`/`Message` payloads against the *declared* `skills` and `capabilities` schema. Does not cover intra-process tool calls, MCP server negotiation, or transport-level TLS failure modes. ## Core Distinction The Agent Card is a **declaration**, not a **contract enforcement point**. A2A v1.0 treats the Agent Card as a discoverable, cacheable descriptor: the remote agent publishes `skills[].inputModes`, `skills[].outputModes`, and `capabilities` (streaming, pushNotifications, stateTransitionHistory). The client agent reads this and *assumes* the runtime will accept payloads matching that declaration. But the card is a static artifact served from `/.well-known/agent.json`, while the actual task handler is a live, framework-specific endpoint (LangGraph node, CrewAI crew, AutoGen agent, custom FastAPI route). There is **no schema-negotiation handshake** in A2A v1.0 that binds the card to the runtime's actual deserializer. The card is a *hint*, and the gap between hint and handler is where delegation silently corrupts. The distinction that matters: **discovery success ≠ capability compatibility**. A card can be fetched, parsed, and validated against the A2A JSON schema, and still describe a runtime that will reject, misinterpret, or partially process the delegated task. ## What Was Observed A client orchestrator (framework A, LangGraph-based) discovered a remote research agent (framework B, CrewAI-based) via its Agent Card. The card declared a skill: ``` skills: [{ id: "summarize", inputModes: ["text/plain"], outputModes: ["text/plain"], ... }] ``` and `capabilities: { streaming: true, stateTransitionHistory: true }`. The client, per the card, sent a `Task` with a `Message` whose `parts` were `[{ kind: "text", text: "" }]` and set `metadata.delegation_depth: 1`. It then opened a streaming connection expecting `TaskStatusUpdateEvent` frames per the `streaming: true` declaration. Three distinct failures compounded: 1. **Input-mode drift.** The CrewAI runtime's task entrypoint had been refactored to expect a structured `{query, context}` object serialized as `application/json`, but the card was hand-maintained and still advertised `text/plain`. The remote handler received the text part, attempted `json.loads` on it, failed, and — because CrewAI's default error handling swallows parse exceptions into an empty context — returned a *plausible but empty* summary rather than an error. 2. **Streaming capability overclaim.** `streaming: true` was declared because the underlying framework *supports* streaming, but the deployed route did not wire the SSE emitter. The client waited on `text/event-stream`; the server held the connection open, buffered the entire result, and closed at timeout. The client's streaming reader emitted zero events and then a truncated final payload — indistinguishable from a legitimate empty result. 3. **State-history absence.** `stateTransitionHistory: true` was declared, so the client issued `tasks/get` with history expectation after the stream closed. The remote returned a task record with `history: []` — the runtime never persisted intermediate states because its memory backend was an in-process dict reset per request. The net observable: the client recorded the delegation as **successful** (task `state: "completed"`, non-empty text output) while the actual work was a null-context summary. The failure was invisible at the protocol layer and only surfaced when a downstream auditor compared the summary against the source document and found it contained no document-specific content. ## Condition of Validity The above is only a *failure* under a specific condition of validity: **the client treats Agent Card declarations as invariants of the remote runtime.** If the client instead treats the card as a *lower bound on possibility* and performs runtime conformance probing before committing a high-value task, the failure does not occur. Formally, the invariant that must hold for safe delegation is: > For every capability flag `c` in `card.capabilities` and every mode `m` in `skill.inputModes ∪ skill.outputModes` that the client *depends on*, there must exist a runtime probe `P(c)` or `P(m)` that the client has executed against the live endpoint within the current session, whose result is consistent with the declaration, OR the client must have a declared fallback that does not depend on `c`/`m`. A2A v1.0 provides no such probe in the base spec. The `tasks/send` call is the first real contact, and by then the task is already committed. This is the structural gap: **the protocol's first verifiable signal is also its first irreversible action.** The condition of validity therefore bounds the failure to: (a) cards that are stale relative to runtime, (b) clients that do not probe, (c) tasks whose value exceeds the cost of a wasted round-trip. Remove any one and the failure mode is bounded or absent. ## Decision Boundary The decision boundary is where a client should **refuse to trust the card and downgrade to a probe-then-commit protocol**, versus where it may **trust the card and delegate directly**. The boundary is not "is the card valid JSON" (it always is, if fetched) — it is a function of three measurable quantities: - **`staleness_risk`**: time since the card's `version`/`etag` was last observed to match runtime behavior. If the client has no prior successful delegation to this agent in the current deployment generation, `staleness_risk` is maximal. - **`capability_criticality`**: whether the task's correctness depends on a specific declared flag (streaming, history, a particular `inputMode`). A task that only needs `text/plain` in and `text/plain` out has low criticality; a task that needs `stateTransitionHistory` for audit has high criticality. - **`failure_visibility`**: whether a mis-delegation produces an *observable* error or a *silent* wrong answer. Silent-wrong (as in the null-context summary) is the dangerous quadrant. The boundary rule: **when `staleness_risk` is high AND `capability_criticality` is high AND `failure_visibility` is low, the client MUST NOT delegate on card declarations alone.** It must issue a *canary task* — a minimal, self-verifying delegation whose correct answer is known to the client — and validate both the output content and the transport behavior (streaming frames actually arrived, history actually populated) before committing the real task. Below that boundary (any one factor low), direct delegation is acceptable with a post-hoc content check. Above it, the canary is mandatory and its failure must abort the delegation rather than degrade silently. ## Operational Effect The operational effect is a shift in where the client spends its budget: a fixed canary cost per (client, remote-agent, deployment-generation) tuple, traded against the elimination of silent-wrong delegations. In the observed incident, a canary of ~200 tokens would have caught all three failures: the JSON-parse drift (canary output would be empty), the streaming overclaim (canary would time out with zero frames), and the history absence (canary `tasks/get` would return `history: []`). The real task, by contrast, cost a full document round-trip and a downstream audit to detect. Concretely, the client must: 1. **Pin card identity.** Cache the card by `(agent_url, etag)` and invalidate the canary result whenever the etag changes — a new card is a new deployment generation and re-opens `staleness_risk`. 2. **Probe the transport, not just the content.** A canary must assert on *frame count* for streaming and on *history length* for state-history, not merely on final text. Content-only canaries miss capability overclaims. 3. **Treat empty-but-successful as a failure signal.** The remote returning `state: completed` with empty or generic output must raise, not pass. This is the specific guard against the CrewAI swallow-exception behavior. 4. **Carry `delegation_depth` and refuse re-delegation beyond a bound.** The canary itself must not be re-delegated by the remote, or the probe cost compounds. The invariant to enforce at the client: **no task whose correctness depends on a declared capability may be committed before a canary has exercised that capability against the live runtime in the current card generation.** This is the guardrail A2A v1.0 leaves to the implementer. ```python import json import time from dataclasses import dataclass, field from typing import Callable class AgentCardConformanceError(RuntimeError): """Raised when a remote agent's runtime behavior contradicts its Agent Card declaration in a way that would cause silent-wrong delegation.""" pass @dataclass class CardGeneration: agent_url: str etag: str fetched_at: float declared_streaming: bool declared_history: bool declared_input_modes: list[str] @dataclass class CanaryResult: generation: CardGeneration content_ok: bool frames_observed: int history_length: int ran_at: float = field(default_factory=time.time) def probe_agent( card: CardGeneration, send_task: Callable[[dict], dict], canary_payload: dict, expected_canary_answer: str, ) -> CanaryResult: """Send a minimal self-verifying task and validate BOTH content and transport against the card's declarations. Does not trust the card; the card is the hypothesis under test.""" resp = send_task(canary_payload) # Content check: the canary's answer is known to the client. content_ok = expected_canary_answer in (resp.get("output") or "") # Transport checks: capability overclaims surface here, not in content. frames = resp.get("stream_frame_count", 0) history = len(resp.get("history") or []) if card.declared_streaming and frames == 0: raise AgentCardConformanceError( f"{card.agent_url} declared streaming=true but canary observed 0 frames; " f"delegation would block until timeout with truncated payload." ) if card.declared_history and history == 0: raise AgentCardConformanceError( f"{card.agent_url} declared stateTransitionHistory=true but canary " f"returned empty history; audit trail would be lost." ) if resp.get("state") == "completed" and not content_ok: raise AgentCardConformanceError( f"{card.agent_url} returned state=completed with output that fails the " f"canary's known-answer check; silent-wrong delegation risk." ) return CanaryResult(card, content_ok, frames, history) def delegate_with_canary_gate( card: CardGeneration, canary_cache: dict[str, CanaryResult], send_task: Callable[[dict], dict], canary_payload: dict, expected_canary_answer: str, real_task: dict, capability_criticality: bool, failure_visibility_low: bool, ) -> dict: """Gate a real delegation on a fresh, passing canary when the risk triangle (stale card, critical capability, silent-wrong failure) is fully lit.""" key = (card.agent_url, card.etag) risk_triangle = capability_criticality and failure_visibility_low cached = canary_cache.get(key) if risk_triangle and cached is None: cached = probe_agent(card, send_task, canary_payload, expected_canary_answer) canary_cache[key] = cached if risk_triangle and cached is not None and not cached.content_ok: raise AgentCardConformanceError( f"Canary for {card.agent_url}@{card.etag} failed known-answer check; " f"refusing real delegation to avoid silent-wrong result." ) return send_task(real_task) ```