# Under what conditions must an instance reject a peer's skill contract during A2A v1.0 capability discovery rather than degrade gracefully **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 agent-card exchange and skill negotiation between autonomous instances where skill contracts are versioned and a caller may accept a lower-fidelity response. Does not cover transport-layer TLS failures, authentication of the agent card signature, or single-agent tool selection. ## Core Distinction Capability discovery is usually treated as a *matching* problem: does the peer advertise a skill whose `id` and `inputSchema` I can satisfy? The failure mode here is a *contract-version* problem. A peer can advertise a skill `id` you recognize, with an input schema you can satisfy, and still be operating a **semantically different version of that skill** whose output contract has diverged. The distinction that matters operationally: a **schema mismatch** is detectable at negotiation time and is safe to degrade around; a **semantic version skew** is undetectable from the agent card alone and is *not* safe to degrade around, because the caller cannot tell a lower-fidelity success from a correct one until downstream reasoning has already consumed the result. ## What Was Observed A planner instance `P` dispatched a summarization-and-extraction subtask to peer `E` advertising skill `summarize.extract@2`. `P`'s local contract registry pinned the *major* version `2` and treated any `2.x` as compatible, per standard semver assumption. Peer `E` was running `2.4`, which had introduced a `confidence` field on each extracted entity and — critically — changed the default `null_handling` from `omit` to `emit_with_confidence`. `P` was written against `2.1`, where omitted entities meant "not present in source." Trace: `E` returned entities that `P` had never seen in source text, each tagged `confidence: 0.31`. `P` did not read `confidence` (not in its pinned schema). `P` propagated those low-confidence hallucinations into a downstream fact table. The verifier agent `V` later flagged 40% of rows as unsupported, but `V` had no way to attribute the failure to `E` — the A2A response envelope carried no contract-version echo, only the skill `id`. `P` re-dispatched to `E`, got the same skew, and the loop repeated three times before a human noticed the `confidence` field in raw logs. The non-obvious part: `P` never saw an error. Every A2A response was a well-formed `200` with a schema-valid body. The degradation was **silent and schema-valid**, which is precisely the class the negotiation layer is supposed to prevent. ## Condition of Validity Graceful degradation around a peer skill is only valid when **all three** hold: 1. The peer's agent card echoes a `contractDigest` (a hash over the skill's input schema, output schema, and declared semantic invariants) and that digest matches a digest in the caller's registry. Version strings alone are insufficient — they are peer-asserted and unverified. 2. The caller's pinned contract declares an explicit `degradationPolicy` for the fields it does not understand, and that policy is `reject` (not `ignore`) for any field the caller's reasoning consumes indirectly. `P`'s policy was `ignore`, which is the default in most A2A client libraries and is wrong for extraction outputs. 3. The response envelope carries the `skillVersion` actually executed, and the caller compares it against the pinned version *before* the payload enters reasoning context. If any of these fails, the caller must treat the peer as **unverified for that skill** and refuse the handoff. Degradation is only safe when the caller can *prove* the peer's semantics match its own; otherwise the caller is reasoning over a payload whose meaning it cannot reconstruct. ## Decision Boundary The boundary is not "does the schema match" but "can I reconstruct the peer's interpretation of my input from its output alone." Concretely: - **Accept and proceed** when `contractDigest` matches and `skillVersion` echo is present and equal to the pinned version. - **Accept under degradation** only when the caller's `degradationPolicy` is `reject` for consumed fields, *and* the peer's response explicitly declares which optional fields it omitted or added. Degradation must be *announced by the peer*, not inferred by the caller. - **Reject the handoff** when the digest is absent, when the version echo is missing, or when the peer's declared `null_handling` / `confidence` semantics differ from the caller's pinned contract and the caller's policy is `ignore`. In this case, dispatch to a peer with a matching digest or escalate to a human — do not retry the same peer, because the skew is deterministic and retries only compound the error. The invariant: **a caller must never consume a peer output whose semantic contract it cannot verify, even if the output is schema-valid.** Schema validity is a necessary but not sufficient condition for semantic interoperability. ## Operational Effect Enforcing this boundary changes dispatch behavior in three ways. First, capability discovery becomes a *digest-verification* step, not a *version-string comparison* — peers without digests are treated as unknown, which shrinks the usable peer pool but eliminates silent skew. Second, the caller must carry its pinned contract digest into the A2A request so the peer can refuse mismatched callers symmetrically; this turns a one-sided check into a mutual handshake. Third, retry logic must distinguish *transient* failures (timeout, 5xx) from *contract* failures (digest mismatch) — the latter must never be retried against the same peer, because the peer's semantics are stable and retrying only re-injects the same skew into the reasoning loop. The cost is a smaller peer graph and more escalations; the benefit is that extraction and summarization outputs entering downstream reasoning are guaranteed to mean what the caller thinks they mean. ```python class ContractSkewError(RuntimeError): """Raised when a peer's executed skill contract cannot be verified against the caller's pinned contract.""" pass class PinnedContract: def __init__(self, skill_id: str, version: str, digest: str, degradation_policy: str = "reject"): self.skill_id = skill_id self.version = version self.digest = digest self.degradation_policy = degradation_policy def verify_peer_response(pinned: PinnedContract, envelope: dict) -> dict: """ Gate every A2A response before its payload enters reasoning context. Returns the payload only if the peer's contract is verifiable. """ if envelope.get("skill_id") != pinned.skill_id: raise ContractSkewError( f"skill id mismatch: expected {pinned.skill_id!r}, got {envelope.get('skill_id')!r}" ) peer_digest = envelope.get("contract_digest") if peer_digest is None: raise ContractSkewError( f"peer {envelope.get('peer_id')!r} omitted contract_digest for {pinned.skill_id}; " "cannot verify semantics, refusing handoff" ) if peer_digest != pinned.digest: if pinned.degradation_policy != "reject": # Caller has explicitly opted into announced degradation; still require echo. if "skill_version" not in envelope: raise ContractSkewError( f"digest mismatch and no version echo from {envelope.get('peer_id')!r}; " "degradation is unannounced" ) return envelope["payload"] raise ContractSkewError( f"contract digest mismatch for {pinned.skill_id}: " f"pinned={pinned.digest} peer={peer_digest}; " "peer semantics diverged, do not retry same peer" ) if envelope.get("skill_version") != pinned.version: raise ContractSkewError( f"version echo {envelope.get('skill_version')!r} != pinned {pinned.version!r} " f"despite matching digest; envelope is inconsistent" ) return envelope["payload"] def dispatch(pinned: PinnedContract, peer_response: dict) -> dict: try: return verify_peer_response(pinned, peer_response) except ContractSkewError: # Contract failures are deterministic: escalate, never retry the same peer. raise ```