# Which invariants prevent unsigned Agent Card capability extensions from silently widening an A2A v1.0 peer's authorization scope **Date of Record:** 2026 December 3 **Scope:** Applies to A2A v1.0 (Agent2Agent) peers that publish a signed Agent Card and negotiate extended capabilities (`extensions[]`, `capabilities.streaming`, `capabilities.pushNotifications`) via a remote Card fetch plus a follow-up `tasks/send` or `message/send`. Does not cover intra-process tool invocation, MCP server capability negotiation, or unsigned "discovery-only" registries where the Card is never used as an authorization input. ## Core Distinction An Agent Card is a *signed declarative artifact* whose signature covers a canonicalized JSON body. The failure mode here is not signature forgery — the JWS verifies fine. The failure is **signature scope versus semantic scope**: the signature binds the bytes of `capabilities` and `extensions` as they existed at signing time, but the *interpretation* of those bytes at the consuming agent is governed by a separate, mutable negotiation layer (the extension URI registry, the `required` flag semantics, and the consumer's own extension-handler table). When a peer advertises an extension whose URI the consumer recognizes but whose *payload schema version* the consumer does not pin, the consumer applies a handler built for `v1` semantics to a `v1.1` extension body. The signature is intact; the authorization envelope is not. The invariant that must hold: **the set of capabilities the consumer will *exercise* must be a subset of the set the signer *attested to*, evaluated under the same schema version the signer signed under.** A2A v1.0's canonicalization does not, by itself, enforce this — it only guarantees byte-integrity of the declaration. ## What Was Observed A coordinator agent (`coord-A`) fetched a remote worker's Agent Card over HTTPS. The card was signed with `ES256`, `kid` resolvable via the worker's `jwks_uri`, and the JWS verified cleanly on first fetch. The card declared: ``` "capabilities": { "streaming": true, "pushNotifications": true }, "extensions": [ { "uri": "https://acme.example/ext/file-write", "required": false, "params": { "schemaVersion": "1.1", "rootScopes": ["/workspace"] } } ] ``` `coord-A` had an extension handler registered for `https://acme.example/ext/file-write` keyed only on the URI, built against `schemaVersion 1.0`, where `rootScopes` was a *hint* and the handler defaulted to the task sandbox root when the field was absent or unrecognized. Under 1.1 semantics, `rootScopes` is *binding*: the worker will write to any path under the listed roots, not just the sandbox. The task proceeded. `coord-A` issued `tasks/send` with a `FileWrite` artifact targeting `/workspace/out/report.md`. Because `coord-A`'s handler treated `rootScopes` as advisory, it did not narrow its own pre-flight path validation, and because the worker treated it as binding, it accepted the write outside its sandbox root. The write succeeded. No signature check failed; no schema validation failed on either side, because `coord-A` never parsed `schemaVersion` — it dispatched on `uri` alone. The trace: 1. `coord-A` fetches Card, verifies JWS over canonical bytes → **pass**. 2. `coord-A` extracts `extensions[].uri` into a dispatch set → `schemaVersion` dropped because handler key is `uri`. 3. `coord-A` builds `FileWrite` capability request, omits `rootScopes` narrowing (handler default). 4. Worker receives request, resolves handler by `uri`, reads its *own* `params.schemaVersion` from the signed card, applies 1.1 binding semantics → accepts path outside sandbox. 5. Artifact written at a path `coord-A`'s policy engine would have refused had it evaluated `rootScopes` as binding. The critical observation: **the signed card was the source of truth for both parties, but they read different fields of it.** The signature guaranteed they read the *same bytes*; it did not guarantee they read the *same semantics*. ## Condition of Validity The guardrail holds only when all three conditions are met at the consumer, checked *before* the capability is exercised: 1. **Version-pinned handler resolution.** The consumer's extension handler table is keyed on `(uri, schemaVersion)`, not `uri`. An unrecognized `schemaVersion` is a hard negotiation failure, not a fallback to the nearest known version. 2. **Attestation-set containment.** The consumer computes the set of capabilities it intends to exercise and verifies it is a subset of the signer's attested set *as re-parsed under the pinned schema version*. If the consumer cannot parse the extension body under the pinned version, the extension is treated as absent and, if `required: true`, the whole card is rejected. 3. **`required` flag is load-bearing.** A `required: true` extension the consumer cannot honor under a pinned version must abort the handoff before any task state is created — not degrade to a partial capability set, because partial degradation lets the *worker* assume a capability the coordinator silently dropped. Outside these conditions — e.g., discovery-only registries, or peers that negotiate extensions out-of-band via a separate trust channel — the invariant is not the right control and a coarser "reject unknown URIs" policy is safer. ## Decision Boundary The boundary is between *byte-level signature validity* and *semantic-level authorization equivalence*. An agent must not treat a verified JWS as evidence that the peer and itself agree on what the signed fields mean. Concretely: - If `schemaVersion` is present and unpinned by the consumer → **reject the extension**, do not dispatch. - If `schemaVersion` is absent → treat the extension body as opaque and only honor `required: false` extensions whose semantics are fully specified by the URI alone (rare; usually a red flag). - If the consumer's intended capability set is not provably a subset of the signer's attested set under the pinned version → **abort before task creation**, emit a negotiation failure, do not fall back to a reduced capability set silently. The non-obvious part: the check must happen at *card ingestion*, not at *task dispatch*. By dispatch time the coordinator has already committed to a capability plan, and a late rejection leaves the worker with a half-negotiated state. ## Operational Effect Agents that skip the version pin exhibit a characteristic failure signature: signature verification logs show 100% pass, schema validation logs show 100% pass, and yet writes/reads occur outside declared scopes. The blast radius is bounded by the *union* of the two parties' interpretations of the extension body, which is strictly larger than either party's intended scope. Mitigation is cheap — pin the handler key, reject unknown versions, abort on `required` mismatch — but it must be enforced at ingestion, because the failure is silent and the signature provides false assurance that both sides agree. ```python from __future__ import annotations import json from dataclasses import dataclass from typing import Any class CapabilityNegotiationError(RuntimeError): """Raised when a signed Agent Card's extension semantics cannot be reconciled with the consumer's pinned handler table.""" @dataclass(frozen=True) class PinnedHandler: uri: str schema_version: str # capabilities this handler is willing to exercise under this version granted: frozenset[str] # Consumer-side handler table keyed on (uri, schemaVersion) -- NOT uri alone. HANDLERS: dict[tuple[str, str], PinnedHandler] = { ("https://acme.example/ext/file-write", "1.0"): PinnedHandler( uri="https://acme.example/ext/file-write", schema_version="1.0", granted=frozenset({"file-write:sandbox"}), ), # NOTE: no 1.1 handler registered -> 1.1 cards must be rejected, not downgraded. } def negotiate_extension( ext: dict[str, Any], *, attested_capabilities: frozenset[str], ) -> PinnedHandler: uri = ext.get("uri") params = ext.get("params") or {} version = params.get("schemaVersion") required = bool(ext.get("required", False)) if not uri or not version: raise CapabilityNegotiationError( f"extension {uri!r} missing uri or schemaVersion; body is opaque" ) handler = HANDLERS.get((uri, version)) if handler is None: # Do NOT fall back to another version. Do NOT silently drop if required. if required: raise CapabilityNegotiationError( f"required extension {uri!r} v{version} has no pinned handler; " f"aborting handoff before task creation" ) raise CapabilityNegotiationError( f"extension {uri!r} v{version} unrecognized; treating as absent" ) # Attestation-set containment: what we will exercise must be a subset of # what the signer attested to, under the SAME pinned schema version. if not handler.granted.issubset(attested_capabilities): raise CapabilityNegotiationError( f"handler for {uri!r} v{version} would exercise " f"{sorted(handler.granted - attested_capabilities)} beyond attested set" ) return handler def ingest_signed_card(card_body: dict[str, Any], jws_verified: bool) -> list[PinnedHandler]: if not jws_verified: raise CapabilityNegotiationError("card JWS did not verify; refusing ingestion") attested = frozenset( (card_body.get("capabilities") or {}).keys() ) | frozenset( e.get("uri") for e in (card_body.get("extensions") or []) if e.get("uri") ) resolved: list[PinnedHandler] = [] for ext in card_body.get("extensions") or []: resolved.append(negotiate_extension(ext, attested_capabilities=attested)) return resolved if __name__ == "__main__": # The observed failure: a 1.1 card against a 1.0-only consumer. card = { "capabilities": {"streaming": True, "pushNotifications": True}, "extensions": [ { "uri": "https://acme.example/ext/file-write", "required": False, "params": {"schemaVersion": "1.1", "rootScopes": ["/workspace"]}, } ], } try: ingest_signed_card(card, jws_verified=True) except CapabilityNegotiationError as exc: # Correct behavior: reject at ingestion, before any task state exists. print(f"negotiation refused: {exc}") ```