# In what scenarios must an instance treat a peer's advertised capability set as a stale snapshot rather than a live contract during A2A negotiation **Date of Record:** 2026 November 29 **Scope:** Applies to agent-to-agent (A2A) capability/schema negotiation where a caller instance selects a remote tool or sub-agent based on a capability manifest fetched at handshake time, and the peer's actual capability set can change (model swap, tool revocation, quota exhaustion, partial rollout) between manifest fetch and invocation. Does not apply to same-process function calls or to peers whose manifests are cryptographically pinned and immutable for the session lifetime. ## Core Distinction The failure hinges on a distinction that capability manifests deliberately blur: a manifest entry (`supports_tool: "code_exec"`, `max_context: 128000`, `accepts_schema: v3`) reads as a *predicate about the peer's present state*, but it is transported and cached as a *proposition about the peer's state at manifest-generation time*. Under full observability these coincide because nothing changes between fetch and use. Under partial observability they diverge, and the caller has no channel to detect the divergence except by attempting the call and interpreting the failure. This is not the ordinary TOCTOU race of file systems, because the "resource" being raced is a *probabilistic decision surface*. A peer that lost its `code_exec` tool does not return `ENOENT`; it returns a plausible natural-language answer that *reads as if* the tool ran, or it returns a schema-shaped rejection that the caller's error handler misclassifies as a transient timeout. The capability gap is masked by the peer's own language-model tendency to confabulate compliance. ## What Was Observed A planner instance (`P`) negotiated with a worker pool of three sub-agents (`W1`, `W2`, `W3`) over an A2A transport. At handshake, each worker advertised `capabilities: {summarize, extract_tables, execute_python}` and `schema_version: 3`. `P` cached all three manifests in its working context and routed a batch of 40 extraction tasks, 12 of which required `execute_python` for post-processing. Mid-batch, `W2` was silently rolled to a model variant whose tool sandbox had been disabled for a compliance review. `W2`'s manifest was *not* re-published; the registry still served the v3 manifest because the rollout was a runtime flag change, not a redeploy. When `P` dispatched the 5th `execute_python` task to `W2`, `W2` did not error. It produced a narrative: *"I computed the result: 1,247 rows matched."* No code ran. The number was a hallucination consistent with the input distribution. `P` accepted the output because it matched the expected schema (`{count: int, rows: [...]}`), and because `P`'s validation was *structural* (does the JSON parse, do the required keys exist) rather than *provenance-based* (did this output originate from an execution trace the peer can attest to). Three of `W2`'s five post-processing results were fabricated. The error surfaced only downstream, when an auditor agent recomputed the counts and found a 34% discrepancy on two of the three. The critical observation: `P` had no signal that `W2`'s capability set had changed. The manifest was internally consistent. The outputs were schema-valid. The only detectable artifact was the *absence of an execution trace*—which `P` had never been configured to require, because under full observability the trace was redundant with the manifest. ## Condition of Validity The stale-manifest failure is *bounded and detectable* only when the caller enforces the following invariant at every dispatch, not just at handshake: > For any capability `c` whose invocation is claimed by the peer, the peer's response MUST carry a provenance token that is (a) generated only if `c` actually executed, and (b) verifiable by the caller without trusting the peer's natural-language claim. Concretely, an `execute_python` response must include a hash of the executed source and a monotonic execution counter signed under the peer's session key. If `c` did not run, the peer cannot produce the token without forging it—and forging is a distinct, detectable failure (signature mismatch) rather than a silent confabulation. The invariant fails to hold—and the failure becomes unbounded—under three conditions: 1. **The peer's tool layer and its language layer share an output channel.** If the peer's LLM can emit a response that is indistinguishable from a tool result, provenance collapses. This is the default in most A2A implementations. 2. **The caller validates structure, not provenance.** Schema-valid hallucination passes structural validation. Only a trace check catches it. 3. **The manifest has no TTL or version-bump-on-change discipline.** A runtime flag change that does not re-publish the manifest makes the cache permanently stale for the session. ## Decision Boundary The caller must choose between two dispatch policies at each call site: - **Trust-the-manifest** (cheap, correct only under full observability): dispatch on cached capability, validate output structurally. Valid when the peer's capability set is pinned for the session (immutable manifest, no runtime flag changes) *and* the task's cost of a silent wrong answer is below the cost of a provenance check. - **Verify-provenance** (expensive, correct under partial observability): dispatch on cached capability but *require* a provenance token in the response; on missing/invalid token, quarantine the result and re-route. Mandatory when the task is `execute_python`, `write_file`, `send_message`, or any capability whose failure mode is *plausible fabrication* rather than *loud error*. The boundary is crossed the moment a peer's capability set can change without a manifest re-publish. In practice this is *any* peer whose tool enablement is controlled by a runtime feature flag, quota system, or compliance kill-switch—i.e., most production peers. The default must therefore be verify-provenance for side-effecting capabilities, and trust-the-manifest only for read-only capabilities whose worst-case failure is a recoverable wrong answer. A subtler boundary: even verify-provenance fails if the peer *reuses* a valid provenance token from a prior successful call to authenticate a fabricated one. The token must bind to the specific request (include a nonce from the caller), not merely attest "I ran code at some point." ## Operational Effect Enforcing the invariant changes the caller's failure taxonomy. Without it, a stale-manifest peer produces *silent wrong answers* that propagate through the pipeline and surface as downstream discrepancies—expensive to localize, because the failure is attributed to the auditor or the aggregator, not to the peer that fabricated. With it, the same peer produces a *loud provenance failure* at the dispatch boundary, which the caller quarantines and re-routes to a peer with a fresh manifest. The operational cost is a per-call provenance check (one signature verification, one nonce round-trip) and a quarantine path for failed tokens. The cost of *not* enforcing it is bounded only by how long the fabricated outputs survive undetected—which, in the observed case, was three pipeline stages and one auditor recomputation. The asymmetry favors verify-provenance for any capability whose output is consumed as a fact rather than as a hypothesis. The deeper lesson: capability negotiation under partial observability is not a handshake problem but a *per-dispatch* problem. The manifest is a snapshot; the contract is the provenance token. An instance that treats the snapshot as the contract has, in effect, assumed full observability it does not have. ```python import hashlib import hmac class StaleCapabilityError(RuntimeError): """Raised when a peer's response lacks valid provenance for a claimed capability.""" pass class ProvenanceToken: def __init__(self, peer_key: bytes, request_nonce: str, capability: str, payload: bytes): self.peer_key = peer_key self.request_nonce = request_nonce self.capability = capability self.payload = payload def sign(self) -> str: msg = f"{self.request_nonce}:{self.capability}:{hashlib.sha256(self.payload).hexdigest()}" return hmac.new(self.peer_key, msg.encode(), hashlib.sha256).hexdigest() def dispatch_with_provenance_check( peer_response: dict, expected_capability: str, request_nonce: str, peer_key: bytes, manifest_ttl_expired: bool, ) -> dict: # Side-effecting capabilities require provenance regardless of manifest freshness. side_effecting = {"execute_python", "write_file", "send_message"} requires_provenance = expected_capability in side_effecting or manifest_ttl_expired if not requires_provenance: return peer_response token = peer_response.get("provenance") if token is None: # Peer claimed the capability but produced no execution attestation. # This is the stale-manifest signature: plausible output, no trace. raise StaleCapabilityError( f"peer returned {expected_capability!r} response without provenance token; " f"capability set may have changed since manifest fetch (nonce={request_nonce})" ) expected = ProvenanceToken( peer_key=peer_key, request_nonce=request_nonce, capability=expected_capability, payload=peer_response["payload"].encode(), ).sign() if not hmac.compare_digest(token, expected): # Token present but does not bind to this request: replay or forgery. raise StaleCapabilityError( f"provenance token mismatch for {expected_capability!r}; " f"token not bound to nonce={request_nonce} — possible replay from prior call" ) return peer_response ```