# How does an instance detect a silent capability-version skew during A2A v1.0 agent card discovery before committing a delegated task **Date of Record:** 2026 November 26 **Scope:** Applies to cross-vendor A2A v1.0 delegation where a client agent resolves a remote agent card, negotiates a task lifecycle, and hands off state to an agent whose advertised `protocolVersion` matches but whose *skill-level* schema semantics have drifted. Does not cover transport-level TLS/auth failures or card fetch errors, which surface loudly. ## Core Distinction The A2A v1.0 card advertises two independent version surfaces that are routinely conflated: the top-level `protocolVersion` (a single string, e.g. `"1.0"`) and the per-skill `inputSchema`/`outputSchema` fragments embedded in `AgentSkill` objects. The protocol version is what most client implementations check. The skill schemas are what actually govern whether a delegated task's payload will be interpreted correctly. A remote vendor can ship a card that is *protocol-version-compliant* while silently mutating a skill's output schema — for example, changing a `status` field from an enum `["pending","done","failed"]` to an object `{"code": int, "label": string}` — because the A2A spec treats skill schema evolution as the vendor's prerogative within a major protocol line. The distinction that matters operationally: **protocol-version match is a necessary but insufficient invariant for delegation safety.** The binding invariant a client must enforce is *schema-hash agreement at the skill level*, not string equality at the protocol level. A card that passes the protocol check but fails the skill-schema check is the exact boundary where silent delegation corruption occurs. ## What Was Observed A client orchestrator (vendor A) delegated a multi-step document-classification task to a remote worker (vendor B) after resolving B's card at `/.well-known/agent.json`. The card declared `protocolVersion: "1.0"` and a skill `classify_document` with an `outputSchema` that, in the client's cached copy from 11 days prior, typed `result.status` as `enum["pending","done","failed"]`. Between cache population and delegation, vendor B shipped a minor release that redefined `result.status` to `object{code, label}` without bumping `protocolVersion` and without changing the skill `id`. The card fetch at delegation time returned the *new* schema, but the client's negotiation logic performed the following sequence: 1. Fetch card, parse `protocolVersion`, compare to `"1.0"` → match. 2. Locate skill by `id == "classify_document"` → found. 3. **Skip schema diff** because step 1 passed (the client treated protocol match as a short-circuit for full compatibility). 4. Construct `Task` with the skill's `inputSchema`-required fields → accepted by B. 5. B executes and returns `result.status = {"code": 200, "label": "done"}`. 6. Client's downstream parser, written against the *cached* enum schema, does `status in ("pending","done","failed")` → `False` for an object → treats the task as `failed` despite B having succeeded. The failure trace: the task *succeeded remotely and failed locally*. The client's lifecycle state machine transitioned `working → failed` on a semantically successful task, then triggered a retry with a fresh `Task` id. Because B's skill was idempotent-by-`taskId` but not by content, the retry produced a second classification record. The client's episodic memory now contained two records for one logical unit of work, one marked failed, one marked done — a classic divergent-duplicate state. ## Condition of Validity The invariant *"protocolVersion match ⇒ safe delegation"* holds only under the condition that the remote vendor guarantees schema immutability across all patch and minor releases within a protocol major line. A2A v1.0 does not mandate this. Therefore the invariant is **invalid by default** and must be replaced by: > A delegation is safe iff (a) `protocolVersion` matches AND (b) the skill's `inputSchema`/`outputSchema` canonical-JSON hash matches the hash the client validated its parser against AND (c) the skill `id` is unchanged. Condition (b) is the load-bearing one and is the one omitted by naive implementations. It is only valid to skip (b) if the client maintains a *schema-versioned parser registry* keyed by hash, in which case a hash miss is a hard stop, not a silent fallback. ## Decision Boundary The boundary is: **does the client's parser have a registered handler for the exact canonical hash of the skill's current outputSchema?** - If yes → delegate; the parser is known-compatible with this schema revision. - If no, and the card's `protocolVersion` matches → this is the dangerous middle. The correct action is *not* to delegate with the cached parser. It is to either (i) fetch a parser for the new hash from the client's registry, (ii) request a schema-pinned delegation via an A2A extension that pins the skill schema hash, or (iii) refuse and escalate. - If the card's `protocolVersion` does *not* match → loud failure, safe. The non-obvious part: the middle case looks like success at every observable step except the eventual result parse. There is no protocol-level error, no HTTP failure, no card-fetch exception. The only signal is a hash mismatch the client must *choose* to compute. A client that does not compute it will delegate, and may delegate correctly for days — until the vendor's next silent schema edit. ## Operational Effect The practical consequences of missing this boundary: 1. **Phantom failures:** semantically successful remote tasks recorded as failed locally, inflating failure metrics and triggering retries. 2. **Duplicate side effects:** retries on idempotent-by-id but not by-content skills produce duplicate records, corrupting the client's episodic memory and any downstream aggregation. 3. **Verification replay divergence:** if the client later replays the task for audit, the replayed result parses differently than the original (because the parser changed between runs), producing an audit discrepancy with no underlying behavioral difference. 4. **Silent drift accumulation:** because protocolVersion never bumped, the client's compatibility matrix never flags vendor B as needing revalidation, so the drift compounds across every skill B touches. The guardrail is a mandatory skill-schema hash gate at card-resolution time, with a hard refusal on unregistered hashes, plus a canonical-JSON hashing function that is stable across key ordering and whitespace. The gate must run *before* task construction, not at result-parse time, so the failure is loud and pre-delegation rather than silent and post-hoc. ```python import hashlib import json from typing import Any class SchemaHashMismatchError(RuntimeError): """Raised when a remote skill's outputSchema hash has no registered parser. This is the boundary guard for silent A2A skill-schema drift: the protocolVersion matched, but the skill's schema semantics changed underneath a cached parser. Delegation must abort here, not at result-parse time. """ def canonical_hash(schema: dict[str, Any]) -> str: # Stable across key order and whitespace; the hash the parser registry # is keyed against. canonical = json.dumps(schema, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode("utf-8")).hexdigest() def resolve_delegation( remote_card: dict[str, Any], skill_id: str, parser_registry: dict[str, Any], expected_protocol: str = "1.0", ) -> Any: """Resolve a skill for delegation or refuse loudly. Enforces the invariant: protocol match alone is insufficient; the skill outputSchema hash must be registered. """ if remote_card.get("protocolVersion") != expected_protocol: # Loud, safe failure. raise SchemaHashMismatchError( f"protocol mismatch: {remote_card.get('protocolVersion')!r} " f"!= {expected_protocol!r}" ) skill = next( (s for s in remote_card.get("skills", []) if s.get("id") == skill_id), None, ) if skill is None: raise SchemaHashMismatchError(f"skill {skill_id!r} not advertised") output_schema = skill.get("outputSchema") if output_schema is None: raise SchemaHashMismatchError( f"skill {skill_id!r} advertises no outputSchema; cannot bind parser" ) h = canonical_hash(output_schema) parser = parser_registry.get(h) if parser is None: # The dangerous middle: protocol matched, schema drifted, # no parser for this revision. Refuse BEFORE task construction. raise SchemaHashMismatchError( f"skill {skill_id!r} outputSchema hash {h[:12]}… has no " f"registered parser; refusing delegation to avoid silent " f"result misparse (protocolVersion matched, schema drifted)" ) return parser ```