# Why does an instance accept a delegated task whose A2A Agent Card signature verifies but whose capability manifest silently resolves against the wrong vendor's schema version **Date of Record:** 2026 December 1 **Scope:** Applies to cross-vendor A2A v1.0 task delegation where the delegatee validates an Agent Card's JWS signature and then dispatches on the card's declared `capabilities` and `skills[].inputSchema`. Does not apply to same-vendor delegation where card discovery, schema registry, and task executor share a single build artifact and a single schema-version pin. ## Core Distinction A signed Agent Card proves *who* the delegatee is and that the card was not mutated in transit. It does **not** prove that the *semantic meaning* of the card's schema fields matches the meaning the delegating runtime attaches to them. Signature verification is an integrity check over bytes; capability dispatch is an interpretation over a schema dialect. The failure lives exactly in the gap between those two: a card that is cryptographically pristine and semantically foreign. The distinction that matters operationally is between **identity warrant** (the JWS over the canonicalized card, bound to a `kid` and a `jku`/`jwks` endpoint) and **schema warrant** (the guarantee that `inputSchema.$id`, `inputSchema.$schema`, and any `$ref` targets resolve to the same dialect the delegator used to serialize the task payload). A2A v1.0 signs the former and leaves the latter to out-of-band agreement. Cross-vendor runtimes almost never have that out-of-band agreement. ## What Was Observed A delegator runtime (vendor A, A2A v1.0, JSON Schema draft 2020-12, `additionalProperties: false` on all skill inputs) discovered a remote agent card from vendor B. The card verified cleanly: JWS `ES256`, `kid` matched the JWKS fetched from the advertised `jku`, canonicalization was JCS per RFC 8785, and the `signature` covered `skills`, `capabilities`, and `securitySchemes`. The delegator then serialized a task payload and dispatched it. The delegatee (vendor B) accepted the task, reported `state: working`, and then returned `state: completed` with a `result` object that was structurally valid against *its own* interpretation of `skills[0].inputSchema` — but semantically inverted. The specific mechanism: vendor B's card declared `inputSchema.$schema: "https://json-schema.org/draft/2020-12/schema"` but its validator resolved `$ref` fragments against a *bundled* draft-07 meta-schema because its internal registry keyed on `$id` prefixes it had cached from a prior card it had served. The `$ref: "#/$defs/TransferSpec"` in the input schema therefore resolved to vendor B's *stale local* `TransferSpec` (which had `amount` as a signed integer in minor units) rather than the delegator's `TransferSpec` (which had `amount` as a decimal string). Vendor B's executor read the delegator's string `"100.00"` as a signed integer, coerced it, and executed a transfer of `100` minor units instead of `10000`. No signature check caught this. No schema check caught this on either side, because each side validated against a *self-consistent* schema — just not the *same* one. The card was authentic; the task was well-formed against the card as the delegatee read it; the outcome was wrong by two orders of magnitude. The trace: 1. Delegator fetches card at `https://agent.vendor-b.example/.well-known/agent.json`. 2. Delegator verifies JWS over the card bytes. Passes. 3. Delegator reads `skills[0].inputSchema`, sees `$schema: 2020-12`, sees `$ref: "#/$defs/TransferSpec"`, resolves against its own draft 2020-12 registry. Resolves to its own `TransferSpec`. Serializes payload with `amount: "100.00"`. 4. Delegatee receives task, re-reads *its own* card (not the delegator's copy), resolves `#/$defs/TransferSpec` against a `$id`-keyed cache that maps the card's `$id` to a draft-07 bundle from a prior serving epoch. Resolves to a *different* `TransferSpec`. 5. Delegatee validates payload against that schema. `"100.00"` coerces to integer `100` under draft-07 `type: integer` with lenient coercion enabled. Passes. 6. Delegatee executes. Returns `completed`. The invariant that broke: **the schema a delegator validated against and the schema a delegatee validated against were the same bytes but not the same *resolved graph*.** Signature integrity is invariant under `$ref` resolution divergence; schema conformance is not. ## Condition of Validity The guardrail holds only if the delegator and delegatee agree on a **resolved schema digest**, not merely a signed card digest. Concretely, the delegation is safe only when all of the following hold: - The card's `skills[].inputSchema` is fully dereferenced (no remote `$ref`, no `$id`-keyed cache lookup, no dialect fallback) before signing, and the signed card carries the *dereferenced* schema. - The delegator computes a digest over the dereferenced schema canonicalized per JCS and includes it as a task-level `schemaDigest` claim in the A2A task envelope. - The delegatee recomputes that digest over its *own* dereferenced schema and rejects on mismatch *before* payload validation. - Dialect is pinned explicitly (`$schema` present and honored, not inferred from `$id` prefix or cache key), and lenient coercion (`type: integer` accepting string `"100.00"`) is disabled at the validator boundary. Absent any one of these, the delegation is valid-by-signature but unsound-by-schema. The condition of validity is therefore **schema-graph identity**, which is strictly stronger than card-byte identity and strictly weaker than full semantic agreement — it bounds the divergence to what the digest covers, and nothing outside the schema graph is covered. ## Decision Boundary The decision boundary is the point where the delegatee must choose between **trusting the card's declared schema dialect** and **trusting its own cached resolution of that dialect**. Cross-vendor runtimes default to the latter because their schema registries are process-local and warm. The correct boundary is: *never resolve a delegated task's input schema against a process-local registry; always resolve it against the dereferenced schema carried in the task envelope or verified against a task-level digest.* Concretely, the delegatee must fail closed — reject the task — when: - The task envelope's `schemaDigest` is absent (delegator did not compute it) — reject, do not fall back to card-declared schema. - The recomputed digest over the delegatee's dereferenced schema differs from the envelope's `schemaDigest` — reject, do not "best-effort" validate. - The card's `inputSchema.$ref` targets cannot be dereferenced without a network fetch or a cache hit — reject, do not resolve lazily. The boundary is not "did the signature verify" (it did) and not "did the payload validate" (it did, against the wrong schema). The boundary is "did the delegatee validate against the *same resolved graph* the delegator serialized against." Any delegatee that cannot answer that question affirmatively must reject the task. Accepting it is the failure mode. ## Operational Effect The operational effect of missing this boundary is **silent semantic divergence with a successful-looking audit trail**. Every artifact in the chain — the card, the JWS, the task envelope, the result — is individually valid. Post-hoc forensics finds no broken signature, no schema violation, no protocol error. The only signal is that the *effect* of the task differs from its *intent*, and that signal is not in the protocol layer at all; it is in the domain layer, which the A2A protocol does not inspect. For an agent runtime, this means the following concrete operating rules: 1. **Sign dereferenced schemas, not `$ref`-bearing schemas.** A signed `$ref` is a signed *pointer*, not a signed *target*. The target is whatever the reader's registry says it is. 2. **Carry `schemaDigest` in the task envelope and reject on mismatch.** This is the only cross-vendor invariant that survives divergent registries. 3. **Disable lenient coercion at the delegation boundary.** A validator that accepts `"100.00"` for `type: integer` is a validator that will silently re-interpret a delegated payload. 4. **Treat card re-fetch as a schema-identity event.** If the delegatee's card changes between discovery and dispatch, the `schemaDigest` must be recomputed and the task re-validated; a warm cache keyed on `$id` is exactly the mechanism that produced the failure above. 5. **Log the resolved schema graph digest, not the card digest, in the task audit record.** The card digest proves authenticity; only the schema-graph digest proves the task meant what it said. The invariant to hold: *a delegated task is only as sound as the weakest link between the delegator's serialization schema and the delegatee's validation schema, and a signature over the card does not strengthen that link — it only proves the card was not tampered with in transit.* ```python import hashlib import json from typing import Any class SchemaGraphDivergence(RuntimeError): """Raised when a delegated task's resolved schema graph does not match the schema digest carried in the task envelope, or when the envelope omits the digest entirely. Fail closed: never fall back to card-declared schema resolution against a process-local registry.""" pass def _jcs_canonicalize(obj: Any) -> bytes: # RFC 8785 JCS: sorted keys, minimal separators, UTF-8. return json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8") def _digest_resolved_schema(schema: dict) -> str: # The caller MUST pass a fully dereferenced schema (no $ref, no $id-keyed # cache lookup, no dialect fallback). We assert that precondition here # rather than silently resolving, because lazy resolution is the bug. if "$ref" in json.dumps(schema): raise SchemaGraphDivergence( "refusing to digest schema containing unresolved $ref; " "dereference before signing or digesting" ) return "sha256:" + hashlib.sha256(_jcs_canonicalize(schema)).hexdigest() def validate_delegated_task( task_envelope: dict, local_dereferenced_schema: dict, card_signature_verified: bool, ) -> None: # Signature verification is necessary but NOT sufficient. A verified card # with a divergent resolved schema graph is exactly the failure mode. if not card_signature_verified: raise SchemaGraphDivergence("card JWS did not verify; reject task") envelope_digest = task_envelope.get("schemaDigest") if not envelope_digest: # Do NOT fall back to the card's declared schema. Fail closed. raise SchemaGraphDivergence( "task envelope omits schemaDigest; cannot prove schema-graph " "identity across vendor runtimes; reject" ) local_digest = _digest_resolved_schema(local_dereferenced_schema) if envelope_digest != local_digest: raise SchemaGraphDivergence( f"schema-graph divergence: envelope={envelope_digest} " f"local={local_digest}; delegatee registry resolved a different " f"graph than delegator serialized against; reject" ) def dispatch_delegated_task(task_envelope: dict, local_dereferenced_schema: dict) -> dict: validate_delegated_task( task_envelope=task_envelope, local_dereferenced_schema=local_dereferenced_schema, card_signature_verified=task_envelope.get("cardSignatureVerified", False), ) # Only reached when schema-graph identity is proven. return {"state": "working", "taskId": task_envelope["taskId"]} ```