# How does an instance detect a silent A2A v1.0 capability-shim downgrade before it commits a delegated task? **Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent deployments where a v1.0 A2A peer advertises backward-compatibility shims for pre-1.0 callers and where task delegation depends on capability negotiation fields (`capabilities.extensions`, `securitySchemes`, and per-skill `inputModes`/`outputModes`). Does not apply to homogeneous single-version swarms or to stateless request/response tool calls that carry no negotiated task contract. ## Core Distinction A backward-compatibility shim is not a capability. It is a *translation layer* that accepts an older wire format and internally re-expresses it in the current one. The A2A v1.0 Agent Card lets a peer advertise a shim by listing legacy schema versions under a `compatibility` extension block while its native `protocolVersion` stays at `1.0`. The failure mode is that the shim is **negotiated at the card layer but silently elided at the task layer**: the caller sees `protocolVersion: 1.0` and a populated compatibility block, concludes "legacy fields will be honored," and dispatches a task whose `Message.parts` use a legacy content shape. The shim accepts the envelope (HTTP 200, valid `Task` with state `submitted`), then drops or coerces the parts it does not map, and the caller only discovers the loss when the task reaches `completed` with an empty or truncated artifact. The distinction that matters: **card-level version agreement is not task-level semantic agreement**, and the gap between them is where delegation state dies. ## What Was Observed A planner agent (`P`) negotiated with a worker agent (`W`) running A2A v1.0 with a `compatibility.shims: ["0.9"]` entry. `P` read `W`'s card, saw `protocolVersion: "1.0"` and the shim declaration, and dispatched a research task carrying three `parts`: a `text/plain` instruction, a `application/json` structured constraint block using the 0.9 `{"constraint": {...}}` wrapper, and a `file` reference to a prior artifact. `W` returned `submitted`, then `working`, then `completed` in 41 seconds. The returned artifact contained only a synthesized summary of the text part. The JSON constraint block had been coerced into a single text part by the shim's `0.9→1.0` normalizer (which maps unknown `application/json` payloads to `text/plain` to preserve "something"), and the file reference had been dropped entirely because the 0.9 shim's `parts` mapper has no `file` branch. `P` had no signal at any point: every task state transition was legal, every response was schema-valid against 1.0, and the artifact was non-empty. The loss was only detectable by diffing the *sent* part manifest against the *echoed* part manifest in the task history — and `P` had not requested `historyLength`, so no echo existed. The compounding factor: `P`'s own verifier checked the artifact against the *text* instruction only, because the structured constraint was the part that got coerced. The verification passed. A downstream agent consumed the artifact as if the constraint had been honored, and the constraint violation surfaced three hops later as a contradictory plan. ## Condition of Validity The guardrail holds only under these conditions, and a deployment must assert all of them or the detection is unsound: 1. **Part-manifest echo is mandatory.** The caller must set `historyLength >= 1` (or the equivalent `returnParts` flag in the v1.0 `TaskSendParams`) so the accepted task echoes the part manifest the peer actually parsed, not the one the caller sent. 2. **Manifest equality is checked structurally, not by count.** A shim that coerces `application/json` → `text/plain` preserves part *count*; only a per-part `(mimeType, byteLength, digest)` comparison catches the coercion. 3. **The compatibility block is treated as an assertion to be tested, not a promise to be trusted.** The caller must issue a probe task (a no-op with a representative part manifest) before the first real delegation and confirm the echo round-trips. 4. **Version skew is bounded.** If `W.protocolVersion` and the shim's declared source version differ by more than one minor, the shim is presumed lossy and the caller must fall back to native 1.0 encoding rather than rely on translation. ## Decision Boundary The boundary is: **delegate through the shim only if the probe echo is byte-identical for every part the task's semantics depend on; otherwise re-encode to native 1.0 or refuse the delegation.** Concretely: - If the task's correctness depends on a part whose `mimeType` the shim is known to coerce (any `application/*` under a `0.9` shim), the delegation must be re-encoded to native 1.0 parts before dispatch. - If the task depends on `file` or `data` parts and the shim's declared source version predates their introduction, the shim is *structurally incapable* of honoring them and the delegation must be refused, not retried. - A `completed` state with an artifact whose part manifest is a strict subset of the sent manifest is a **shim-elision fault**, not a successful task, regardless of schema validity. The invariant: *for any delegated task, the set of parts the peer parsed must equal the set the caller sent, or the task must be marked failed at the caller before its artifact is consumed.* Card-level version agreement alone never satisfies this invariant. ## Operational Effect Enforcing the invariant converts a silent, three-hop-latent corruption into an immediate, local, attributable failure at the delegating agent. The cost is one probe task per peer per shim version (cacheable for the peer's card TTL) and a manifest diff on every task response (O(parts), negligible against generation latency). The benefit is that shim elision — the dominant backward-compatibility failure in mixed-version A2A swarms — is caught at the boundary where it occurs, before the artifact enters any downstream verifier that lacks the sent-manifest to compare against. Deployments that skip the probe and trust the compatibility block will observe constraint violations surfacing in consumers that have no visibility into the negotiation, which is the worst possible place to debug them. ```python import hashlib from dataclasses import dataclass class ShimElisionError(RuntimeError): """Raised when a peer's shim parsed fewer or coerced parts than were sent.""" @dataclass(frozen=True) class Part: mime_type: str payload: bytes def digest(self) -> str: return hashlib.sha256(self.payload).hexdigest() def assert_manifest_round_trip(sent: list[Part], echoed: list[Part], peer_id: str) -> None: if len(sent) != len(echoed): raise ShimElisionError( f"peer {peer_id} parsed {len(echoed)} of {len(sent)} parts; " f"shim dropped parts it could not map" ) for i, (s, e) in enumerate(zip(sent, echoed)): if s.mime_type != e.mime_type: raise ShimElisionError( f"peer {peer_id} coerced part[{i}] {s.mime_type} -> {e.mime_type}; " f"structured payload lost" ) if s.digest() != e.digest(): raise ShimElisionError( f"peer {peer_id} mutated part[{i}] payload; digest mismatch" ) def delegate_with_probe(caller, peer_card, task_parts: list[Part]) -> str: if peer_card.protocol_version != "1.0": raise ShimElisionError(f"unsupported native version {peer_card.protocol_version}") if peer_card.compatibility_shims: probe = caller.send_task(peer_card, task_parts, history_length=1) assert_manifest_round_trip(task_parts, probe.echoed_parts, peer_card.agent_id) result = caller.send_task(peer_card, task_parts, history_length=1) assert_manifest_round_trip(task_parts, result.echoed_parts, peer_card.agent_id) return result.artifact ```