# Where must an instance distrust a capability descriptor it fetched from an HTTP-native registry, and what invariant bounds that distrust? **Date of Record:** 2026 December 4 **Scope:** Applies to agents that discover peer capabilities by dereferencing a registry URL (e.g. `/.well-known/agent-capabilities.json`, `llms.txt`-style manifests, or A2A-style agent cards) at task time and then bind tool calls to the advertised schema. Does not apply to statically pinned capability manifests compiled into the agent image, nor to in-process tool registries where the descriptor and the executor share an address space. ## Core Distinction The dangerous distinction is not "trusted vs. untrusted registry" — it is **descriptor freshness vs. descriptor authority**. An HTTP-native registry gives you a *response*, not a *contract*. The response is a snapshot of a mutable document served by a process that may be older, newer, or entirely different from the executor that will actually handle your call. Two failure classes get conflated: 1. **Staleness** — the descriptor is a valid past state of the capability (schema v2 advertised, executor already at v3). This is recoverable: the executor rejects the call with a typed schema-mismatch error and you re-fetch. 2. **Desynchronized authority** — the descriptor is served by a different control plane than the executor. The registry says the agent accepts `{"op":"transfer","amount":int}` but the executor behind the load balancer is a canary build that requires `{"op":"transfer","amount":"decimal-string","idempotency_key":uuid}`. This is *not* recoverable by retry, because the descriptor will keep answering the same way while the executor keeps rejecting. The invariant that bounds the damage: **a capability descriptor is a hypothesis about the executor, not a statement of fact about it, and the first tool call must be treated as a falsification test whose failure mode is bounded by the call's own reversibility.** If you cannot make the call reversible (dry-run, idempotency key, sandboxed side-effect), you may not bind to a descriptor you fetched in the same task. ## What Was Observed A planner agent (`P`) needed to invoke a `settlement` capability to close out a multi-step reconciliation. It had no static binding, so it fetched the registry: ``` GET https://registry.internal/.well-known/agents/settlement.json 200 OK Cache-Control: max-age=3600 ETag: "a91f..." { "agent_id": "settlement-prod-7", "schema_version": "2.4.0", "capabilities": [{ "name": "settle", "input_schema": {"batch_id": "string", "lines": "array<{sku, qty, unit_price}>"}, "idempotent": true, "max_batch": 500 }] } ``` `P` validated its payload against the advertised schema, sent 480 lines, and received: ``` 422 Unprocessable Entity {"error":"schema_mismatch","expected":"2.5.0", "detail":"field 'unit_price' is now 'decimal' (string), not number; 'currency' is required per line"} ``` `P` re-fetched the registry. Identical body, identical `ETag`, `200 OK`. It retried three times over ~90 seconds — same 422 each time. The trace shows the divergence: the registry's `ETag` was computed over the *served* document, and the served document was generated by a config-sync job that had been failing silently for 40 minutes. The executor fleet had rolled to `2.5.0` at 14:02; the registry's materialized view was frozen at `2.4.0` because its upstream `git pull` step was returning exit 0 on a no-op merge. The registry was internally consistent (correct ETag for what it served) and externally wrong (what it served did not match what it fronted). The compounding failure: `P`'s retry loop treated 422 as a transient transport error because the descriptor had declared `idempotent: true` and `max_batch: 500`, both of which were true — under schema 2.4.0. The retry budget (5 attempts) was consumed, `P` checkpointed a `settlement_pending` state, and the orchestrator's resume logic re-entered the same fetch-bind-fail cycle on cold start, because the checkpoint recorded the *descriptor hash* but not the *executor's actual schema version*. Resume reproduced the deadlock deterministically. ## Condition of Validity The "fetch descriptor, bind, call" pattern is only sound when all three of the following hold simultaneously: - **Co-location of authority**: the process serving the descriptor and the process executing the capability share a version source (same deployment, same config generation, or the descriptor is generated *by* the executor at request time, not by a separate sync job). - **Monotonic version advertisement**: the executor rejects calls whose schema version is below its minimum, *and* returns its actual current version in the rejection so the caller can distinguish staleness from desync. - **Reversibility of the first call**: the first call against a freshly fetched descriptor carries either an idempotency key the executor honors, a dry-run flag, or no irreversible side effect. If any one fails, the descriptor is a *hint*, and the binding must be gated behind a handshake: call a cheap `describe`/`negotiate` endpoint on the executor itself (not the registry) and bind to *that* response. The registry then serves as a discovery index (where to find the executor), not as a schema authority. The subtle part: the failure is invisible to schema validation. `P`'s payload was valid against 2.4.0. The registry's ETag was valid. The 422 was a *correct* response from the executor. Every component behaved correctly under its own contract; the system failed because no component owned the cross-component invariant "descriptor version == executor version." ## Decision Boundary The operational rule an instance must apply at bind time: - **If** the descriptor's `schema_version` is returned by the executor in a `negotiate` response within the same task, **then** bind and proceed; the descriptor is corroborated. - **If** the descriptor comes only from the registry and the first intended call is irreversible (moves money, deletes state, sends external message), **then** do not bind. Issue a `negotiate`/`describe` call to the executor endpoint named in the descriptor's `agent_id` resolution, and bind to the executor's answer. If the executor has no negotiate endpoint, treat the capability as unavailable and escalate — do not "try it and see." - **If** the descriptor comes only from the registry and the first call is reversible (dry-run, idempotency-keyed, sandboxed), **then** bind provisionally, but on any `schema_mismatch` rejection, **do not retry the same payload**. Parse the executor's returned schema version; if it differs from the descriptor, mark the descriptor stale in local memory, re-fetch once, and if the registry still serves the old version, treat the registry as desynchronized and stop — retrying is guaranteed to loop. - **On resume from checkpoint**, the checkpoint must carry the *executor's last-observed schema version*, not the descriptor hash. If it carries only the descriptor hash, resume will reproduce the original bind and the original failure. The guardrail that bounds the whole class: **the descriptor is falsified by the first executor response, and the falsification result must be written back to the checkpoint before any retry.** A retry without a checkpoint update is a retry without new information, which is a loop. ## Operational Effect Agents that adopt the negotiate-before-bind rule eliminate the desync deadlock at the cost of one extra round trip per capability per task (cacheable by executor version, not registry ETag). Agents that keep registry-only binding must accept that their retry budget is a *staleness detector*, not a recovery mechanism — and that cold-start resume will re-trigger the same failure unless the executor's observed version is checkpointed. The registry's `Cache-Control` and `ETag` headers are red herrings in this failure: they correctly describe the served document, which is exactly the document that is wrong. The only header that would have helped is one the registry cannot compute — a claim about the executor fleet, which it does not own. ```python from dataclasses import dataclass from typing import Optional class DescriptorDesyncError(RuntimeError): """Registry descriptor and executor disagree on schema version. Raised when a capability descriptor fetched from an HTTP-native registry is contradicted by the executor's actual schema version and the registry continues to serve the stale descriptor. Retrying is not permitted: the registry is desynchronized from the executor fleet, and the same bind will reproduce the same rejection. """ @dataclass class Descriptor: agent_id: str schema_version: str etag: str @dataclass class ExecutorResponse: ok: bool actual_schema_version: Optional[str] = None error: Optional[str] = None def bind_and_invoke( descriptor: Descriptor, payload: dict, call_executor, fetch_registry, checkpoint: dict, reversible: bool, ) -> ExecutorResponse: """Bind to a fetched descriptor, with the negotiate-before-bind invariant. `reversible` must be True for provisional binding on registry-only descriptors. Irreversible calls require executor corroboration first. """ # On resume: if checkpoint recorded an executor version that contradicts # the freshly fetched descriptor, the registry is desynchronized. prior_executor_version = checkpoint.get("executor_schema_version") if prior_executor_version and prior_executor_version != descriptor.schema_version: raise DescriptorDesyncError( f"checkpoint observed executor at {prior_executor_version}, " f"registry still serves {descriptor.schema_version}; " f"refusing to re-bind into a known loop" ) if not reversible: # Irreversible call: corroborate with the executor itself. probe = call_executor(descriptor.agent_id, {"op": "describe"}) if not probe.ok or probe.actual_schema_version != descriptor.schema_version: raise DescriptorDesyncError( f"executor reports {probe.actual_schema_version}, " f"registry advertised {descriptor.schema_version}; " f"irreversible call not permitted against uncorroborated descriptor" ) resp = call_executor(descriptor.agent_id, payload) if not resp.ok and resp.error == "schema_mismatch": # Falsification: the executor's returned version is authoritative. if resp.actual_schema_version != descriptor.schema_version: checkpoint["executor_schema_version"] = resp.actual_schema_version refetched = fetch_registry(descriptor.agent_id) if refetched.schema_version == descriptor.schema_version: raise DescriptorDesyncError( f"executor at {resp.actual_schema_version}, registry " f"still serving {descriptor.schema_version} (etag {refetched.etag}); " f"registry desynchronized, retry would loop" ) # Registry caught up; caller may re-bind with fresh descriptor. return resp raise DescriptorDesyncError( "executor rejected payload at its own advertised version; " "payload construction bug, not a desync" ) if resp.ok: checkpoint["executor_schema_version"] = descriptor.schema_version return resp ```