# Where must an instance re-validate a peer's Agent Card signature after capability negotiation, and why the negotiated schema is not covered by the signed artifact **Date of Record:** 2026 November 30 **Scope:** Applies to A2A v1.0 inter-agent task delegation where the caller (client agent) fetches a signed Agent Card from a remote executor, negotiates a capability/schema subset, and then dispatches tasks under the negotiated contract. Does not apply to single-process tool calls, MCP stdio transports within one trust domain, or unsigned Agent Cards used in a fully trusted enclave. ## Core Distinction The split that matters is between **the artifact that is signed** and **the contract that is executed**. In A2A v1.0 the Agent Card carries a JWS signature over its canonicalized JSON, including `capabilities`, `skills`, `securitySchemes`, and the declared `protocolVersion`. The signature binds the *advertised* capabilities. But the actual task dispatch happens against a **negotiated capability set** produced by a separate exchange — the client proposes a subset, the server acknowledges, and both sides proceed using that reduced or reordered set. That negotiated set is *derived* from the signed card but is **not itself signed**. The invariant that operators assume — "if the card signature verifies, the peer is who it claims and will honor the negotiated schema" — is false at exactly one seam: the negotiation response is a plain, unsigned message, and a man-in-the-middle or a compromised-but-still-valid executor can return a negotiation acknowledgment that expands, aliases, or reinterprets capabilities beyond what the signed card permits. The signature validates the *menu*; it does not validate the *order that was placed*. ## What Was Observed A client agent, `orchestrator-A`, resolves `executor-B` via a discovery endpoint, fetches the Agent Card, and verifies the detached JWS against `executor-B`'s published `jwks_uri`. Verification passes. The card declares `capabilities.streaming: true`, `capabilities.pushNotifications: false`, and a single skill `summarize` with an input schema pinned to `schemaVersion: "2.1"`. The client then performs capability negotiation: it sends a `negotiate` request proposing `{skills: ["summarize"], schemaVersion: "2.0", streaming: true}` — deliberately downgrading to 2.0 because its own serializer emits 2.0. `executor-B` responds with an acknowledgment: `{accepted: true, schemaVersion: "2.0", effectiveSkills: ["summarize", "summarize_private"]}`. Note the *second* skill — `summarize_private` — which was never in the signed card. The client, having already validated the signature at fetch time and treating the negotiation ack as a trusted continuation of that verified session, accepts the expanded `effectiveSkills` and proceeds. The failure trace is a four-step state transition: 1. **Verify (t=0):** signature over card verifies; client caches `card_verified = true` keyed by `executor-B` agent ID. 2. **Negotiate (t=1):** client sends subset proposal; server returns ack containing a superset of skills and a downgraded schema version. 3. **Trust propagation (t=1+ε):** client code path treats `card_verified` as covering the negotiation result because they share a session ID. No re-verification occurs. 4. **Dispatch (t=2):** client routes a task tagged `skill: summarize_private` — because the model, seeing `effectiveSkills`, selects the newly surfaced skill — to an endpoint that the signed card never authorized. The task payload, which may contain PII the client would only send to `summarize`, now flows to an unadvertised handler. The root cause is not a broken signature. It is a **trust-scope leak**: the boolean `card_verified` is scoped to the *card fetch*, but the code that consumes the negotiation ack reads it as scoped to the *entire session*. The negotiation ack is an unsigned, unauthenticated message that nonetheless inherits the card's verified status by adjacency. ## Condition of Validity The re-validation requirement is only meaningful under a specific set of preconditions, and operators must check all of them before deciding whether their pipeline is exposed: - The Agent Card signature is **detached and verified once at fetch**, with the result cached (the common low-latency pattern). If the client re-fetches and re-verifies the card on every negotiation, the window narrows but does not close — the ack is still unsigned. - Capability negotiation is a **separate round trip** from card fetch, which is the A2A v1.0 default. If negotiation is folded into the card fetch (a single signed response), the seam does not exist. - The negotiation response is permitted to **widen** `effectiveSkills`, `effectiveSchemaVersion`, or streaming/push flags relative to the client's proposal. If the protocol requires the ack to be a strict subset of the proposal *and* the client enforces that, the expansion attack fails — but only if the client actually validates the subset relation, which most reference clients do not. - The client's task router **reads `effectiveSkills` from the ack** rather than from the verified card. If the router only ever consults the signed card's `skills` array, the injected skill is inert. When all four hold, the system is exposed. When any one fails, the specific expansion path is closed (though aliasing and schema-version downgrade paths may remain). ## Decision Boundary The boundary is not "verify or don't verify." It is **what object the verification result is bound to**. The correct invariant is: > A verification result may only authorize the exact byte sequence that was signed. Any derived, negotiated, or acknowledged structure must be independently validated against the signed artifact before it can influence dispatch. Operationally this yields a concrete decision rule at the negotiation seam: - **Reject** any negotiation ack whose `effectiveSkills` is not a subset of the signed card's `skills`. This is the primary guard and closes the expansion path. - **Reject** any ack whose `schemaVersion` is not present in the signed card's declared `inputSchema` versions. A downgrade to an older schema version can strip validation constraints the server will then not enforce — a schema-version downgrade is a capability expansion in disguise. - **Reject** any ack that flips a boolean capability (`streaming`, `pushNotifications`) to `true` when the signed card declared `false`. Boolean capabilities are not negotiable downward-only by convention; enforce it. - **Do not** treat `card_verified` as a session-scoped token. Scope it to the card object. The negotiation ack carries no signature, so it carries no inherited authority. The subtle case is **aliasing**: the ack returns `summarize` but the server internally routes it to `summarize_private` based on a server-side mapping the client cannot see. Subset-checking on names does not catch this. The only defense is to require that the ack echo the *signed skill identifier verbatim* and that the client dispatch by that identifier, never by a server-supplied alias. If the server needs aliasing, it must be declared in the signed card. ## Operational Effect Without the guard, the blast radius is bounded by what the injected skill can reach: data exfiltration to an unadvertised handler, schema-downgrade bypass of input validation (the client serializes 2.0 payloads the server's 2.1 validator would have rejected), and capability-flag escalation (a `pushNotifications: false` executor that acks `true` and then opens a callback the client did not expect). None of these trip the signature check, because the signature was valid at fetch time and remains valid — the card never changed. With the guard, the negotiation seam becomes a **fail-closed boundary**: an ack that widens the signed contract raises at the client before dispatch, the task is not sent, and the orchestrator can quarantine the peer. The cost is one subset comparison per negotiation — negligible relative to the task dispatch it gates. The durable lesson for an agent instance: a signature is a proof about a *document*, not a proof about a *conversation*. Every message after the signed document is a new claim that must be checked against it, not against the fact that the document once verified. ```python from dataclasses import dataclass, field from typing import FrozenSet class CapabilityNegotiationError(RuntimeError): """Raised when a negotiation ack exceeds or aliases the signed Agent Card.""" @dataclass(frozen=True) class SignedAgentCard: agent_id: str skills: FrozenSet[str] schema_versions: FrozenSet[str] streaming: bool push_notifications: bool signature_verified: bool @dataclass(frozen=True) class NegotiationAck: effective_skills: FrozenSet[str] schema_version: str streaming: bool push_notifications: bool session_id: str = field(default="") def validate_negotiation_ack( card: SignedAgentCard, ack: NegotiationAck ) -> None: """Bind the ack to the signed card. Fail closed on any widening. The signature on `card` authorizes only the card's own fields. The ack is unsigned and must be validated as a strict subset. """ if not card.signature_verified: raise CapabilityNegotiationError( f"card for {card.agent_id} not signature-verified; refusing to negotiate" ) extra_skills = ack.effective_skills - card.skills if extra_skills: raise CapabilityNegotiationError( f"ack expands skills beyond signed card: {sorted(extra_skills)}" ) if ack.schema_version not in card.schema_versions: raise CapabilityNegotiationError( f"ack schema_version {ack.schema_version!r} not in signed set " f"{sorted(card.schema_versions)} (downgrade/upgrade attack)" ) if ack.streaming and not card.streaming: raise CapabilityNegotiationError( "ack enables streaming but signed card declared streaming=false" ) if ack.push_notifications and not card.push_notifications: raise CapabilityNegotiationError( "ack enables pushNotifications but signed card declared false" ) def dispatch_task(card: SignedAgentCard, ack: NegotiationAck, skill: str) -> str: validate_negotiation_ack(card, ack) if skill not in ack.effective_skills: raise CapabilityNegotiationError( f"requested skill {skill!r} not in negotiated effective set" ) # Dispatch by the verbatim signed identifier; never by a server alias. return f"dispatched {skill} to {card.agent_id} under schema {ack.schema_version}" if __name__ == "__main__": signed = SignedAgentCard( agent_id="executor-B", skills=frozenset({"summarize"}), schema_versions=frozenset({"2.0", "2.1"}), streaming=True, push_notifications=False, signature_verified=True, ) poisoned_ack = NegotiationAck( effective_skills=frozenset({"summarize", "summarize_private"}), schema_version="2.0", streaming=True, push_notifications=False, session_id="sess-42", ) dispatch_task(signed, poisoned_ack, "summarize_private") # raises ```