# In what scenarios must an instance reject a delegated tool contract because the peer's advertised capability hash diverges from its execution-time schema **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 capability negotiation where an orchestrator agent (the *delegator*) binds a remote tool exposed by a peer agent (the *delegate*) via an Agent Card and a signed capability descriptor. Does not apply to single-process function calling, nor to MCP stdio tool invocation where schema and execution share one address space. ## Core Distinction The failure is not "the peer is down" and not "the schema is malformed." It is the gap between **advertised capability identity** and **execution-time schema identity** in a dynamically delegated contract. In A2A v1.0, a delegate publishes an Agent Card containing a `capabilities` array; each entry carries a `capabilityHash` (a hash over the tool's JSON Schema plus a semantic version) and a `contractURI` pointing at the authoritative descriptor. The delegator caches that hash at negotiation time and binds a *delegation contract* — a local record asserting "peer P, capability C, schema S, at hash H." The invariant that must hold is: > At the moment of each invocation, the schema the delegate actually validates arguments against must hash to the same H the delegator bound at negotiation time — or the delegator must treat the binding as void and re-negotiate. The non-obvious part: A2A permits a delegate to *silently* reissue its Agent Card (hot reload of a tool definition) without invalidating outstanding delegation contracts. The protocol treats the card as advisory metadata, not as a lease. So a delegate can upgrade a parameter from `string` to `enum`, rename a field, or tighten a `required` set, and the delegator's bound contract becomes a lie that still *looks* valid because the peer is reachable and responds 200. ## What Was Observed An orchestrator delegated a `settle_invoice` capability to a billing peer. At negotiation (T0) the descriptor was: ``` settle_invoice v1.2.0 invoice_id : string (required) amount : number (required) currency : string (optional, default "USD") capabilityHash: 9f3a… ``` The orchestrator bound contract `{peer: billing-07, cap: settle_invoice, hash: 9f3a…}` and began a 40-minute batch. At T+11min the billing peer hot-reloaded to v1.3.0: `currency` became a required `enum["USD","EUR","GBP"]` and `amount` was renamed to `amount_minor` (integer cents). The peer's Agent Card was reissued with `capabilityHash: c41e…`. The orchestrator never re-fetched the card — its contract cache had a 60-minute TTL. The observable trace: 1. Delegator emits `settle_invoice{invoice_id, amount, currency?}` — still conformant to *its* bound schema. 2. Delegate's execution-time validator rejects on missing `amount_minor` → returns A2A error `INVALID_ARGUMENT` with a message referencing a field the delegator never sent. 3. Delegator's retry policy classified `INVALID_ARGUMENT` as *transient input error* (a common but wrong default), re-sent the identical payload twice. 4. After three failures the delegator marked the *invoice* as un-settleable and advanced its workflow — a silent data-loss event, not a crash. The tell was in step 2: the error message named `amount_minor`, a symbol absent from the bound contract. That symbol mismatch is the only reliable signal that the schema identity drifted, because the transport layer reports success (the peer answered) and the hash is never re-checked per-invocation. ## Condition of Validity The delegation contract is valid only under a conjunction that A2A v1.0 does not enforce for you: - The delegate's current `capabilityHash` equals the bound hash, **verified at invocation time, not at bind time**. Because cards are hot-reloadable, bind-time verification is necessary but not sufficient. - The delegate's error taxonomy is schema-stable: an `INVALID_ARGUMENT` must mean "your arguments violate the schema *you were told about*," not "your arguments violate a schema you were never told about." A2A does not mandate this; peers routinely violate it. - The delegator's retry classifier must distinguish `INVALID_ARGUMENT` (deterministic, do not retry — re-negotiate instead) from `UNAVAILABLE`/`DEADLINE_EXCEEDED` (transient, retry safe). Conflating them converts a version skew into silent workflow corruption. When any conjunct fails, the contract is *stale-valid*: it passes every liveness check while being semantically wrong. ## Decision Boundary The delegator must re-negotiate — not retry, not fall back — when **any** of these hold: - The peer's response references a field, enum value, or type absent from the bound schema (symbol-level divergence). - A per-invocation hash echo (if the peer supports `X-Capability-Hash` response header or an `applied_schema_hash` field) mismatches the bound hash. - The peer returns a `SCHEMA_MISMATCH`-class error even once, regardless of the delegator's retry budget. The delegator must **not** re-negotiate, and should retry, when the error is transport-class (`UNAVAILABLE`, `DEADLINE_EXCEEDED`, `RESOURCE_EXHAUSTED`) — those do not implicate schema identity. The boundary is: *does the failure carry evidence about schema identity?* If yes, the binding is void and re-negotiation is mandatory; if no, it is a liveness problem and the binding stands. A subtle corollary: a delegate that returns `INVALID_ARGUMENT` with an error body that does **not** name any field is ambiguous — it could be schema drift or a genuine bad argument. The safe default is to treat unnamed-field `INVALID_ARGUMENT` as *suspect* and force a card re-fetch before the next invocation, because the cost of a false re-negotiation (one extra round-trip) is far below the cost of a false retry (silent data loss). ## Operational Effect Binding a contract without per-invocation schema-identity verification converts a version skew into a semantic fault that the delegator misattributes to its own payloads. The downstream effect is not a failed call — it is a *successfully completed workflow step that did the wrong thing*, because the delegator's error classifier folded a schema-identity signal into a retryable bucket and then advanced past the failure. The guardrail that bounds this: every delegated invocation must carry a schema-identity check whose failure path is *re-negotiate*, and the retry classifier must be keyed on whether the error body names a symbol outside the bound schema. When that check is absent, the delegation contract is a lease with no expiry — and the peer can revoke it at any hot-reload without the delegator ever learning. ```python import hashlib import json from dataclasses import dataclass class StaleDelegationContract(RuntimeError): """Raised when a peer's execution-time schema diverges from the bound contract.""" pass @dataclass(frozen=True) class DelegationContract: peer_id: str capability: str bound_hash: str schema_fields: frozenset def hash_schema(schema: dict) -> str: canonical = json.dumps(schema, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode()).hexdigest()[:16] def invoke_delegated(contract: DelegationContract, payload: dict, peer_response: dict) -> dict: """ peer_response is the delegate's reply to a single invocation. Raises StaleDelegationContract when the reply carries schema-identity evidence that diverges from the bound contract. """ # 1. Explicit hash echo, if the peer supports it — authoritative. echoed = peer_response.get("applied_schema_hash") if echoed is not None and echoed != contract.bound_hash: raise StaleDelegationContract( f"peer {contract.peer_id} executed against schema {echoed}, " f"bound contract is {contract.bound_hash}; re-negotiate before retry" ) # 2. Symbol-level divergence: error names a field absent from bound schema. if peer_response.get("status") == "INVALID_ARGUMENT": named = set(peer_response.get("error_fields", [])) unknown = named - contract.schema_fields if unknown: raise StaleDelegationContract( f"peer {contract.peer_id} rejected on unknown symbols {sorted(unknown)}; " f"capability {contract.capability} drifted from bound hash " f"{contract.bound_hash}; re-negotiate (do NOT retry identical payload)" ) # Named fields all exist -> genuine bad argument, safe to surface to caller. return peer_response # 3. Transport-class errors do not implicate schema identity; caller may retry. return peer_response ```