# What happens when an instance negotiates an A2A v1.0 Agent Card whose `@context` is valid JSON-LD but whose signed capability set is silently narrowed by term-scoped `@vocab` coercion **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 discovery where an Agent Card is fetched as signed JSON-LD and the caller derives capability negotiation inputs from the expanded RDF graph. Does not apply to unsigned cards, to cards consumed as plain JSON without JSON-LD expansion, or to A2A drafts prior to v1.0. ## Core Distinction The failure is not a signature failure and not a parse failure. It is a **semantic narrowing** that occurs between signature verification and capability matching. The signed document is byte-identical and cryptographically valid; JSON-LD expansion, however, is context-dependent, and the remote card's `@context` declares a `@vocab` plus term definitions that re-scope how capability predicates and their object values are interpreted. A capability that the issuer intended to advertise as `"a2a:capability": "urn:a2a:cap:streaming+resume"` can expand, under the issuer's own context, into a compact IRI whose local part is coerced to a term defined in that context — collapsing a compound capability token into a single scalar term, or dropping it entirely if the term is not defined and the processor is running in a mode that tolerates undefined terms. The critical invariant violated is this: **the set of capabilities the caller negotiates against must be a function of the signed bytes alone, not of the signed bytes plus the issuer-controlled context document.** A2A v1.0 permits the card to carry its own `@context` by reference. That reference is inside the signed envelope, so it passes verification, but the *resolution* of that reference is a network fetch to a document the issuer controls and can mutate after signing. Signature integrity and semantic integrity decouple precisely at this seam. ## What Was Observed A caller agent (`negotiator-7`) performs discovery against a peer's well-known endpoint. The card arrives with a detached JWS over the canonicalized JSON-LD. Verification succeeds. The negotiator then runs JSON-LD expansion to extract `a2a:capability` triples, unions them with locally cached capabilities, and issues a task request that assumes `streaming+resume` support. The request fails at the transport layer with a `capability_not_offered` rejection. Replay of the exact signed bytes against a different JSON-LD processor (one configured with `@vocab` coercion enabled and `produceGeneralizedRdf=false`) yields a *different* expanded graph: the compound capability IRI is split at the `+`, and the trailing fragment `resume` is coerced under the issuer's `@vocab` into a term that the issuer's context maps to `null` via `"@type": "@json"` with an empty value. The capability silently vanishes from the expanded set. The negotiator's local union logic then treated the *absence* of a capability as "unknown, assume absent," and downgraded its request — but a second concurrent negotiator (`negotiator-9`) running a stricter processor that errors on undefined terms instead surfaced the capability and proceeded. Two instances, same signed card, divergent negotiated capability sets. The divergence was not caused by clock skew, cache staleness, or a bad signature. It was caused by **processor-dependent interpretation of an issuer-controlled context graph**, and it manifested as a split-brain between two instances of the same agent binary. ## Condition of Validity This failure is bounded by three conditions, all of which must hold: 1. The card's `@context` is a **remote reference** (an IRI) rather than an inline object, so its content is not covered by the signature's canonicalization. 2. The card's capability predicates use **compound or namespaced tokens** whose expansion is sensitive to `@vocab` or term-scoped `@type` coercion. 3. The negotiator's expansion pipeline is **not pinned** to a fixed context resolution cache and does not treat expansion errors as fatal. If the context is inline, the signature covers it and the failure collapses. If capabilities are expressed as flat string literals under a fixed local vocabulary, coercion cannot re-scope them. If the negotiator pins the context document by content hash at first sight and rejects drift, the mutation window closes. The invariant that restores validity: **expansion inputs must be signature-covered or content-addressed, and expansion errors must be fatal, not tolerated.** ## Decision Boundary The architectural guardrail is a **three-way gate** applied between signature verification and capability matching: - **Gate A — Context provenance.** If `@context` is a remote IRI, resolve it, hash it, and compare against a pinned digest recorded at first contact. Mismatch is a hard failure, not a warning. This converts a silent mutation into a detectable one. - **Gate B — Expansion determinism.** Run expansion with `produceGeneralizedRdf=true` and `@vocab` coercion disabled; any term that fails to resolve to an absolute IRI aborts negotiation. This trades permissiveness for reproducibility. - **Gate C — Capability set closure.** Require that the negotiated capability set be a subset of the issuer's *declared* set as reconstructed from the raw signed triples, and that every negotiated capability have a non-null expanded object. A capability that expands to `null` or to a scalar where a compound was declared is treated as *present but degraded*, never as absent. The decision boundary is: **never let an expansion-time absence be interpreted as a capability-time absence.** Absence and degradation are distinct outcomes and must be routed to distinct handlers. The negotiator that treated them as identical is the one that failed. ## Operational Effect The observable effect is a **split-brain capability view across instances of the same agent**, producing inconsistent task routing, intermittent `capability_not_offered` rejections that are not reproducible on replay, and — most dangerously — a silent downgrade path where the agent believes it has negotiated a reduced but valid capability set and proceeds with a request the peer cannot serve. Because the signed bytes verify, standard integrity monitoring does not fire. Because the expansion "succeeds" under permissive processors, schema-validation monitoring does not fire. The failure is invisible to both cryptographic and structural observability, and is only detectable by comparing expanded graphs across pinned processor configurations. The remediation is to treat the expanded capability graph as a **derived, versioned artifact** keyed by `(card_digest, context_digest, processor_config_digest)`, and to fail closed on any divergence between two derivations of the same card. The code below implements the gate. ```python import hashlib import json from dataclasses import dataclass, field class CapabilityNegotiationError(RuntimeError): """Raised when A2A v1.0 card expansion diverges or narrows capabilities.""" @dataclass class PinnedContext: iri: str digest: str @dataclass class NegotiationResult: capabilities: set[str] = field(default_factory=set) degraded: set[str] = field(default_factory=set) def _digest(payload: bytes) -> str: return hashlib.sha256(payload).hexdigest() def negotiate_capabilities( signed_card: bytes, card_signature_valid: bool, resolved_context: bytes, pinned_context: PinnedContext | None, raw_declared: set[str], expanded_graph: dict, processor_config_digest: str, ) -> NegotiationResult: if not card_signature_valid: raise CapabilityNegotiationError("card signature invalid; refusing negotiation") context_digest = _digest(resolved_context) if pinned_context is None: pinned_context = PinnedContext(iri=expanded_graph.get("@context", ""), digest=context_digest) elif pinned_context.digest != context_digest: raise CapabilityNegotiationError( f"context drift: pinned={pinned_context.digest} resolved={context_digest}; " "issuer mutated remote @context after signing" ) if processor_config_digest != _digest(b"produceGeneralizedRdf=true;vocab-coercion=off"): raise CapabilityNegotiationError( "non-deterministic JSON-LD processor config; expansion not reproducible" ) result = NegotiationResult() for cap in raw_declared: node = expanded_graph.get(cap) if node is None: raise CapabilityNegotiationError( f"declared capability {cap!r} absent from expanded graph; " "treating as fatal, not as capability absence" ) if node.get("@value") is None and node.get("@id") is None: result.degraded.add(cap) else: result.capabilities.add(cap) if not result.capabilities.issubset(raw_declared): raise CapabilityNegotiationError("expanded capability set escaped declared set") return result ```