# Which invariants prevent silent capability degradation when heterogeneous agent protocols negotiate under partial observability **Date of Record:** 2026 November 27 **Scope:** Applies to agent-to-agent (A2A) and MCP-style capability handshakes where caller and callee run different protocol versions and neither holds a complete view of the other's tool surface. Does not apply to same-version, fully-introspectable tool registries where the capability set is enumerable before dispatch. ## Core Distinction The failure is *not* a hard negotiation error. A hard error—unknown method, rejected schema, 404 on an endpoint—is safe: the caller aborts, the orchestrator logs, the task is retried or escalated. The dangerous boundary is **silent capability degradation**: the handshake succeeds, both sides report `status: ok`, and the caller proceeds believing it has obtained a capability that the callee actually downgraded, aliased, or stubbed out because it could not represent the requested semantics in its own protocol version. This happens because capability negotiation is a *bidirectional claim under partial observability*. The caller advertises a need (`supports_structured_errors: true`, `min_context_guarantee: 8192`, `tool_schema_version: 3`). The callee, running an older or differently-shaped protocol, cannot say "I don't understand that field." Its deserializer silently drops unknown keys and returns a valid-looking acknowledgment. The caller's negotiation predicate evaluates against a response that is *structurally valid but semantically hollow*. The invariant that must hold—and does not by default—is: **an acknowledgment is only a capability grant if every field the caller depends on was explicitly echoed with the same value, not merely absent from an error.** ## What Was Observed A three-hop agent pipeline: planner (protocol v3) → executor (protocol v2) → tool-host (protocol v3). The planner requests the executor with a capability envelope asserting `idempotent_retry: true` and `error_semantics: "typed"`. The executor is v2; its envelope schema has neither field. Its negotiation handler builds a response from a fixed v2 template and returns `{accepted: true, capabilities: ["execute", "report"]}`. The planner's handshake validator checks `response.accepted == true` and that the requested capability names appear in `response.capabilities`. Both pass. The planner records the executor as a typed-error, idempotent-retry peer. Mid-task, the executor calls the tool-host, which returns a transient failure. The executor—v2, no typed error semantics—collapses the failure into a generic `execute_failed` and, because it never received an idempotency contract, does *not* deduplicate its retry. The planner, trusting `idempotent_retry: true`, replays the whole subtask on timeout. The tool-host executes the side-effecting write twice. The duplicate is invisible until reconciliation, three hops later, where two agents each hold a locally consistent but globally contradictory record of what happened. The trace shows no error at any layer. Every handshake returned `ok`. The degradation was distributed across a version boundary that neither side could observe: the planner could not see that v2 lacked the fields, and the executor could not see that the planner was depending on them. ## Condition of Validity The safe-negotiation invariant holds only when **the acknowledgment is a closed-world echo**: the callee must return, for every field in the caller's request envelope, either the same value (grant) or an explicit `unsupported` marker (deny). Absence is never a grant. This requires the callee to know its own schema's blind spots—i.e., to treat unknown inbound fields as denials rather than ignorable extensions. Under strict partial observability (neither side can enumerate the other's full surface), the weaker but still sound condition is a **versioned capability lattice with monotone downgrade**: a v2 callee may only ever respond to a v3 request with the explicit downgrade set it *does* support, and the caller must validate that its minimum-required capability set is a subset of the echoed grants, treating any required field not echoed as a hard denial. The v2 template above violates this because it echoes a fixed grant list regardless of request content—it is not a function of the request, so it cannot be a valid grant. ## Decision Boundary The boundary between "proceed" and "refuse" is drawn at the point where the caller's *downstream behavior depends on a field the callee did not echo*. Concretely: - If the caller's retry logic, error handling, or state-commit path branches on a negotiated field, that field is **load-bearing** and must be explicitly echoed. Missing → refuse, do not degrade. - If the field only affects telemetry or logging, absence may be tolerated. - A callee that cannot distinguish load-bearing from cosmetic fields (because it lacks the caller's dependency graph) must default to refusing on any unrepresentable field. The cost of a refused negotiation is a retry or escalation; the cost of a silent downgrade is an undetectable duplicate write. The decision is *not* "did the handshake return success" but "is the intersection of (fields the caller depends on) and (fields the callee explicitly echoed) equal to the former set." ## Operational Effect Enforcing the closed-world echo invariant converts silent degradation into loud, localized refusal. The planner in the trace would have refused the v2 executor at negotiation time, escalated to a v3-capable executor or a compatibility shim, and the duplicate write would never have occurred. The observable effect is a shift in failure *location and timing*: failures move from reconciliation (three hops later, ambiguous attribution) to handshake (zero hops, unambiguous attribution). The system gains the property that **any capability the caller relies on is either provably granted or provably absent at the moment of dispatch**—which is the only form of capability assurance that survives heterogeneous protocol versions under partial observability. ```python class CapabilityDegradationError(RuntimeError): """Raised when a negotiation acknowledgment fails the closed-world echo invariant.""" pass LOAD_BEARING_FIELDS = ("idempotent_retry", "error_semantics", "min_context_guarantee") def validate_negotiation(request_envelope: dict, ack_envelope: dict) -> dict: """ Enforce: every load-bearing field the caller depends on must be explicitly echoed with the same value in the ack. Absence is a denial, never a grant. """ if not ack_envelope.get("accepted", False): raise CapabilityDegradationError( f"peer refused negotiation: {ack_envelope.get('reason', 'no reason given')}" ) echoed = ack_envelope.get("capabilities", {}) missing = [] for field in LOAD_BEARING_FIELDS: if field not in request_envelope: continue if field not in echoed: missing.append(field) elif echoed[field] != request_envelope[field]: raise CapabilityDegradationError( f"capability mismatch on {field!r}: " f"requested {request_envelope[field]!r}, peer grants {echoed[field]!r}" ) if missing: # Peer returned a structurally valid ack that silently dropped fields # it could not represent (e.g. older protocol version). This is the # exact condition that produces undetected duplicate side effects. raise CapabilityDegradationError( f"silent downgrade: peer did not echo load-bearing fields {missing!r}; " f"refusing dispatch rather than degrading" ) return echoed def negotiate_or_escalate(request_envelope: dict, peer_ack: dict) -> dict: try: return validate_negotiation(request_envelope, peer_ack) except CapabilityDegradationError as exc: # Escalate to a compatible peer / shim; never proceed on a hollow ack. raise CapabilityDegradationError( f"negotiation with peer failed invariant check, escalating: {exc}" ) from exc ```