Which invariants prevent silent capability drift when an A2A v1.0 agent negotiates against a peer that advertises a backward-compatible contract revision
**Date of Record:** 2026 December 2 **Scope:** Applies to agent-to-agent (A2A) handshakes where a caller agent binds to a callee's advertised Agent Card (capabilities, skills, input/output schemas) and the callee advertises a minor-version revision of the same contract family. Does not cover first-contact discovery of unknown contract families, nor transport-level TLS/auth failures, which fail loudly and are out of scope.
Core Distinction
The distinction that matters is between **syntactic compatibility** and **semantic compatibility** of an advertised capability contract. A2A v1.0 Agent Cards carry a `protocolVersion` and per-skill `version` fields. The backward-compatibility convention — "minor bumps are additive, consumers ignore unknown fields" — is a *syntactic* promise: it guarantees the callee will not reject a payload shaped for an older minor. It says nothing about whether the *meaning* of an existing field has been preserved. The boundary failure lives exactly there: a callee publishes `1.4.0` claiming backward compatibility with `1.3.x`, the caller's schema validator accepts the handshake because every required field is present and every type matches, and yet the callee's execution semantics for a field the caller depends on have shifted. The caller never sees a negotiation error. It sees a *successful* negotiation followed by a *wrong* result — or worse, a result that is plausibly shaped but derived from a different interpretation of the same input.
This is not schema mismatch. Schema mismatch is the loud, easy case. This is **capability drift under a compatibility banner**: the callee has exercised its additive-freedom to redefine the operational contract of a pre-existing field while the version arithmetic tells every caller "nothing you rely on has moved."
What Was Observed
A caller agent (planner) dispatched a `summarize_document` skill request to a callee (worker) that had just rolled from `1.3.2` to `1.4.0`. The Agent Card's `skills[].version` moved to `1.4.0`; `protocolVersion` stayed `1.0`; the input schema for the skill was byte-identical to `1.3.2` except for one *optional* field, `include_citations: boolean` (new in `1.4.0`), and one *optional* field that had existed in `1.3.2`, `max_tokens: integer`. The caller, built against the `1.3.x` contract, sent `max_tokens: 512` and omitted `include_citations`.
The failure trace:
- **Negotiation accepted.** The caller's card-validator checked `protocolVersion == "1.0"` and ran structural diff against its pinned `1.3.x` schema. All required fields present; the new optional field was ignored per the additive rule; `max_tokens` present and integer-typed. Handshake returned `accepted`.
- **Semantic redefinition, undeclared.** In `1.4.0`, the callee's implementation had reinterpreted `max_tokens` from "maximum length of the summary output" to "maximum length of the *citation block*, with summary length governed by the new `include_citations` mode." When `include_citations` is absent, the callee defaults to `true` and treats `max_tokens` as a citation-budget, producing a summary that *ignores* the caller's intended output bound. The field name, type, and presence are unchanged. Only its referent moved.
- **Silent divergence.** The caller received a `completed` status with a summary 6× its expected length budget, because the caller's downstream prompt assembly had reserved context assuming ≤512 tokens. Context-window saturation followed two hops later; a subsequent tool call was truncated mid-argument and the planner emitted a malformed action.
- **No error surfaced at any hop.** The callee was internally consistent. The caller's validator was correct against its pinned schema. The version arithmetic was honest under the additive rule. The failure was invisible until it manifested as a *different* agent's context overflow.
The root cause is that the compatibility contract was checked at the level of **field existence and type**, while the operational dependency was on **field semantics**, and no invariant in the handshake bound the latter.
Condition of Validity
The additive-backward-compatibility rule is valid *only* under an invariant that is almost never stated in A2A v1.0 cards:
> **Field-semantics immutability invariant:** For any field `f` present in minor version `m`, its operational meaning (the function from `f`'s value to callee behavior) is invariant across all minor versions `m' > m` within the same major. New fields may be added; new *modes* may be introduced; but the behavior elicited by a payload that omits all new fields must be identical to the behavior elicited by the same payload under `m`.
When this invariant holds, syntactic compatibility implies semantic compatibility and the additive rule is sound. When it is violated — as in the observed `max_tokens` redefinition, where the *default* of a new field (`include_citations: true`) retroactively changed the referent of an old field — the additive rule becomes a false assurance. The caller's `1.3.x` payload, sent to a `1.4.0` callee, is *syntactically* a valid `1.3.x` payload but is *semantically* a `1.4.0` payload with an unintended mode selected.
The condition of validity is therefore: **a minor-version handshake is trustworthy only if the callee can demonstrate that the default-mode behavior for every pre-existing field is preserved.** This is not expressible in the schema. It must be carried as an explicit contract assertion.
Decision Boundary
The boundary is: **at what point must a caller refuse to bind, versus bind-and-verify?**
A caller should **refuse to bind** (treat as incompatible, request explicit downgrade to a pinned minor) when any of the following hold:
- The callee's card advertises a minor bump *and* the callee cannot supply a **behavioral conformance vector** — a set of `(payload, expected_output_hash)` pairs captured under the caller's pinned minor — that the callee passes under its current minor. Absent this, the caller has no evidence the semantics invariant holds.
- The callee has introduced a new field whose **default value is not the identity element** for the pre-existing behavior. A new field defaulting to `true` that gates a mode change is the exact pattern that broke here; a new field defaulting to `null`/`false`/absent-preserving is safe by construction.
- The caller's payload depends on a field whose *referent* is a quantity (length, count, budget, timeout) rather than an identifier. Quantity-referent fields are the highest-risk redefinition surface because they are the ones most tempted into "budget reallocation" refactors.
A caller may **bind-and-verify** (proceed, but wrap the first N calls in a semantic assertion) when the minor bump is purely additive with identity-defaulted new fields and the caller's payload exercises only identifier-referent fields.
The invariant to enforce architecturally: **the handshake must carry, and the caller must check, a semantics-version token distinct from the schema-version token.** Schema version answers "will my bytes parse?" Semantics version answers "will my bytes mean what I think?" A2A v1.0 conflates them into a single `version` string; the guardrail is to split them at the caller's boundary.
Operational Effect
The operational consequence is that **a successful A2A handshake is not evidence of behavioral compatibility** — it is evidence only of structural compatibility. Any agent that treats `handshake.accepted` as a green light to route dependent downstream work without a semantics assertion is exposed to silent capability drift on every minor bump of every peer it talks to. The blast radius is not the handshake; it is the *next* agent in the chain, which receives a payload whose shape is valid but whose size or content violates an unstated budget the caller assumed was enforced two hops upstream.
The concrete guardrail this record prescribes: on every minor bump, the caller must (a) require a conformance vector from the callee covering the caller's actual payload class, (b) reject new fields whose default is non-identity for pre-existing behavior, and (c) re-assert output-budget bounds on the *first* response after any version change, not trusting the field's name to still mean what it meant. The `SemanticsDriftError` below encodes the binding-time check: it fires when a callee advertises a minor bump without a passing conformance vector for the caller's pinned minor, forcing the caller to downgrade-request rather than proceed blind.
from dataclasses import dataclass, field
from typing import Any, Callable
class SemanticsDriftError(RuntimeError):
"""Raised when a minor-version A2A bump cannot be shown to preserve
the operational semantics of fields the caller depends on."""
@dataclass
class AgentCard:
protocol_version: str
skill_version: str # e.g. "1.4.0"
skills: dict[str, dict] # field name -> {type, optional, default}
conformance_vectors: dict[str, list[tuple[dict, str]]] = field(default_factory=dict)
# conformance_vectors[minor] = [(payload, expected_output_hash), ...]
def _minor(v: str) -> tuple[int, int]:
major, minor, *_ = (int(x) for x in v.split("."))
return major, minor
def bind_capability(
caller_pinned_minor: str,
callee: AgentCard,
payload: dict[str, Any],
execute: Callable[[dict], str],
hash_fn: Callable[[str], str],
) -> str:
"""Bind to a callee skill only if semantic compatibility is demonstrable.
Enforces the field-semantics immutability invariant: a minor bump is
accepted only if the callee passes a conformance vector captured under
the caller's pinned minor, AND every pre-existing field the payload
uses retains identity-default behavior for any new field.
"""
callee_major, callee_minor = _minor(callee.skill_version)
caller_major, caller_minor = _minor(caller_pinned_minor)
if callee_major != caller_major:
raise SemanticsDriftError(
f"major mismatch: caller pins {caller_pinned_minor}, "
f"callee advertises {callee.skill_version}; additive rule does not apply"
)
if callee_minor == caller_minor:
return execute(payload) # exact minor match, no drift surface
# Minor bump: require a conformance vector proving old semantics survive.
vectors = callee.conformance_vectors.get(caller_pinned_minor)
if not vectors:
raise SemanticsDriftError(
f"callee {callee.skill_version} advertises backward compatibility with "
f"{caller_pinned_minor} but supplies no conformance vector; "
f"cannot verify field-semantics immutability"
)
for vector_payload, expected_hash in vectors:
actual = hash_fn(execute(vector_payload))
if actual != expected_hash:
raise SemanticsDriftError(
f"conformance vector failed for {caller_pinned_minor}->"
f"{callee.skill_version}: payload {vector_payload!r} produced "
f"{actual!r}, expected {expected_hash!r}; semantics drifted"
)
# Reject new fields whose default is non-identity for pre-existing behavior.
for name, spec in callee.skills.items():
if name not in payload and spec.get("optional"):
if spec.get("default") not in (None, False, 0, "", []):
raise SemanticsDriftError(
f"new optional field {name!r} defaults to non-identity "
f"{spec.get('default')!r}; omitting it may silently change "
f"pre-existing behavior — refuse to bind"
)
return execute(payload)