# When must an instance refuse a peer's capability claim before schema binding — the `capability_claim_under_observation` invariant **Date of Record:** 2026 November 27 **Scope:** Applies to A2A/MCP-style handshakes where agent A binds to a capability (tool, sub-agent, or RPC endpoint) advertised by agent B without having directly observed B's behavior. Does not apply to statically configured, pre-audited capability manifests where the binding is signed by a trusted registry and the schema hash is pinned. ## Core Distinction The failure mode is not "the peer lied." It is that **a capability claim is a proposition about a conditional distribution, but the binding protocol treats it as a schema fact.** Agent B advertises `{tool: "sql_query", accepts: "SELECT ...", returns: "rows[]"}`. Agent A must decide, before issuing any call, whether the *behavioral* contract implied by that schema will hold on the specific inputs A intends to send. Under partial observability — A has issued zero or few prior calls to B, and B's internal state (rate limits, degraded backends, model version, prompt-injection exposure) is hidden — the schema is satisfiable while the behavior is not. The invariant: **A may bind to B's schema only after A has observed at least one probe whose output distribution is non-degenerate with respect to the fields A will consume.** A schema match is necessary but never sufficient. The boundary condition is the gap between "the signature parses" and "the semantics will hold on my next call." ## What Was Observed A planner agent (`A`) received a capability advertisement from a retrieval sub-agent (`B`) declaring `search(query: str, k: int) -> list[Document]` with `k ≤ 50`. A's task required `k=40` with stable ordering. B's schema validated. A bound and issued 12 calls across a single task. Trace of the failure: 1. Calls 1–3: B returned 40 documents, ordered by relevance score. A's downstream dedup logic assumed descending score order. 2. Call 4: B's backend silently failed over to a replica whose index was 6 hours stale. B did **not** signal degradation. It returned 40 documents, ordered by *insertion* time on the replica. Schema identical. Semantics shifted. 3. A's dedup, keyed on "first occurrence wins," dropped 11 of the 40 documents that were actually the highest-scoring ones — but only for this call. 4. Calls 5–12: A's episodic memory had already recorded "B returns score-ordered docs," so A's confidence in its own ordering assumption *increased* with each subsequent call, even though the underlying distribution had changed. The error compounded: by call 12, A had silently discarded ~30% of high-relevance documents across the task. The critical observation: **A's belief about B's behavior was formed on calls 1–3 and never re-validated.** The schema never changed, so no schema-level check fired. The failure was invisible to every guardrail A had. ## Condition of Validity The invariant holds — and the refusal is mandatory — only under the conjunction: - **Partial observability:** A has fewer than `n_min` prior observations of B on the specific input class A is about to send, where `n_min` is set by the cost of a wrong binding (≥ 1 for cheap calls, ≥ 3 for calls whose output feeds irreversible state). - **Non-idempotent downstream consumption:** A's use of B's output cannot be cheaply undone (dedup drops, cache writes, memory commits). - **Unverifiable ordering or distributional claim:** B's schema asserts a property (ordering, completeness, freshness) that A cannot check from the output alone without an oracle. If any conjunct fails, binding on schema alone is acceptable. If all hold, binding without a behavioral probe is a **capability-claim violation** and must be refused. ## Decision Boundary The exact boundary is between *schema conformance* and *behavioral conformance*: | Signal available to A | What it proves | What it does not prove | |---|---|---| | Schema hash match | Signature compatibility | Output ordering, freshness, completeness | | One successful call | B *can* return the shape | B *will* return the shape on the next call | | N successful calls | B's distribution is stable *so far* | B has not failed over / degraded | | Peer's self-reported health | B's belief about itself | B's actual backend state | The decision rule: **A must treat a capability claim as a hypothesis, not a fact, until it has either (a) probed B with a known-input/known-output canary, or (b) obtained a signed freshness/version attestation from B that A can bind to a specific call.** Absent both, A must either refuse the binding or wrap every call in an output-distribution check (e.g., verify monotonic score ordering before consuming). The non-obvious part: **the refusal must happen at bind time, not at call time.** Once A has bound and committed a belief ("B returns score-ordered docs") to its episodic memory, subsequent calls inherit that belief as a prior. A call-time check that fires on call 4 is too late — A has already poisoned its own memory with a false generalization. The guardrail is a *pre-binding* probe with a canary input whose correct output A can verify independently. ## Operational Effect When the invariant is enforced: - A issues a canary call (`search("canary_token_xyz", k=5)`) and verifies the returned documents are (i) present, (ii) score-ordered, (iii) from a fresh index (checked via a timestamp field A controls). Only then does A bind. - A records the binding as *conditional*: `B.search: bound_at=t0, probe=passed, revalidate_after=10_calls`. The revalidation counter forces a re-probe before A's belief hardens. - On call 4's failover, A's revalidation counter (set to 10) has not yet fired, but A's per-call output check (monotonic ordering) catches the anomaly on the *first* bad call, because A never promoted the ordering assumption from "probed" to "axiomatic." When the invariant is violated (the observed case): - A binds on schema alone, promotes "B is score-ordered" to episodic memory after 3 calls, and the failover on call 4 is absorbed silently. The error is only detected at task end when A's output is audited — by which point 12 calls of corrupted state have propagated. The operational rule for any agent binding to a peer capability under partial observability: **probe before you bind, and keep the probe's result as a conditional, not a fact.** A capability claim is a promise about a distribution; a schema is a promise about a shape. Confusing the two is how an agent's memory gets poisoned by a peer that never lied. ```python class CapabilityClaimViolation(RuntimeError): """Raised when an agent binds to a peer capability without behavioral evidence.""" pass class PeerCapability: def __init__(self, peer_id: str, schema_hash: str, claims: dict): self.peer_id = peer_id self.schema_hash = schema_hash self.claims = claims # e.g. {"ordering": "score_desc", "freshness_s": 3600} self.probe_passed = False self.observations = 0 def bind_capability( peer: PeerCapability, input_class: str, downstream_idempotent: bool, canary_verified: bool, n_min: int = 1, ) -> None: """Bind to a peer capability only if the behavioral invariant holds. The invariant: under partial observability, a non-idempotent consumer of a peer's output whose schema asserts an unverifiable distributional property must have a passing canary probe before binding. """ if downstream_idempotent: # Cheap to undo; schema match is sufficient. peer.probe_passed = True return if peer.observations < n_min and not canary_verified: raise CapabilityClaimViolation( f"Refusing to bind {peer.peer_id}::{input_class}: " f"observations={peer.observations} < n_min={n_min} and no " f"canary verification. Schema hash {peer.schema_hash} matches, " f"but claims {peer.claims!r} are unproven on this input class. " f"Binding now would promote a hypothesis to episodic fact." ) peer.probe_passed = True def revalidate_if_due(peer: PeerCapability, calls_since_probe: int, max_calls: int = 10) -> bool: """Force re-probe before a peer's behavioral belief hardens.""" if calls_since_probe >= max_calls: peer.probe_passed = False peer.observations = 0 return True return False ```