Practical technical guides / Recent development

a2a-python 1.4.0 Can Reject Requests That Skip a Required Extension

a2a-python 1.4.0 adds validate_required_extensions, off by default, which rejects a request that omits a required extension before the executor runs.

By Sandeep Belgavi · Published 2026-12-02

a2a-python 1.4.0 adds validate_required_extensions, off by default, which rejects a request that omits a required extension before the executor runs.

What changed in 1.4.0

The A2A protocol lets an agent advertise extensions in its agent card: named additions to the protocol, each identified by a URI, that a client can opt into. An extension can be marked required, which tells clients that the agent cannot serve a request correctly unless the client takes part in it. Clients declare which extensions they are using in the A2A-Extensions header of each request.

Until now, the official Python SDK left enforcement to application code. A card could say an extension was required and a request that did not mention it would still reach the agent's executor. a2a-python 1.4.0, released on 30 November 2026, adds an option to reject those requests before the executor runs. The release notes list it under features as "add opt-in rejection of requests missing a required extension", from pull request 1482, merged on 18 November.

The pull request explains the shape of the change. It adds validate_required_extensions to the default request handler and to the legacy handler, next to the existing validate_input_modes option. When it is on, a send or stream request whose A2A-Extensions header leaves out an extension the card marks required raises ExtensionSupportRequiredError before the executor runs. It is off by default "so existing servers don't start refusing traffic". The A2A specification, in the section on extensions, says an agent that requires an extension the client did not declare must return that error; until this release, a Python server met that rule only if its own code checked.

Measured: who reaches the executor

The local probe installed a2a-sdk 1.3.1 and 1.4.0 in separate environments with uv and ran the same in-process test against each: an agent card for a Belgavi's Book Store returns desk with one required extension, https://example.com/ext/return-window/v1, a handler built on DefaultRequestHandlerV2 with an in-memory task store, and an executor that records whether it ran. Each request carried a different set of declared extensions through the server call context, which is where the HTTP transports put the parsed header. No network and no model were involved.

Handler optionExtensions declared1.3.11.4.0
Not setnoneexecutor ranexecutor ran
Not setthe exact URIexecutor ranexecutor ran
validate_required_extensions=Falsenoneoption not acceptedexecutor ran
validate_required_extensions=Truenoneoption not acceptedrejected, executor did not run
validate_required_extensions=Truethe exact URIoption not acceptedexecutor ran
validate_required_extensions=Truethe URI with a trailing slashoption not acceptedrejected, executor did not run

On 1.3.1 the constructor raised TypeError for the unexpected keyword argument. On 1.4.0 a rejected request raised ExtensionSupportRequiredError with the message Required extensions not requested: https://example.com/ext/return-window/v1.

Three practical points follow. The default is unchanged, so upgrading alone protects nothing; you have to turn the option on. The check runs before the executor, so the agent's own code, any model call and any side effects are skipped for a rejected request. And the comparison is exact: a URI with a trailing slash is a different extension. Clients and servers must agree on the identical string.

What the client sees

According to the pull request, a rejected request is reported differently on each transport: JSON-RPC error code -32008, HTTP status 400 for the REST binding, and FAILED_PRECONDITION for gRPC. Clients on the older v0.3 protocol are rejected too, but v0.3 has no code for this error, so over JSON-RPC they receive an internal error. That last point matters during a migration. A v0.3 client that sees a generic internal error has no hint that the fix is to declare an extension.

Enabling it on a server

from a2a.server.request_handlers import DefaultRequestHandlerV2
from a2a.server.tasks import InMemoryTaskStore
from a2a.types import AgentCapabilities, AgentCard, AgentExtension

RETURN_WINDOW = "https://example.com/ext/return-window/v1"

card = AgentCard(
    name="Returns desk",
    description="Book returns for Belgavi's Book Store",
    version="1.0.0",
    capabilities=AgentCapabilities(extensions=[
        AgentExtension(uri=RETURN_WINDOW, required=True,
                       description="Return window terms the client must apply"),
    ]),
)

def build_handler(executor, store=None):
    return DefaultRequestHandlerV2(
        agent_executor=executor,
        task_store=store or InMemoryTaskStore(),
        agent_card=card,
        validate_required_extensions=True,   # new in a2a-sdk 1.4.0
    )

On the client side, the declared extensions are sent in the A2A-Extensions header. Keep the URI in one shared constant or package so both sides spell it the same way.

Why it is worth turning on

Declaring an extension is not proof that its payload is valid or its sender authorized. Validate extension data and authorization separately. Marking an extension required is a promise about correctness. In the returns desk example, the extension carries the return window terms the client has applied: whether the order is within the 30-day window and which items are excluded. An agent that receives a request without those terms has to guess or fall back to a default, and in a multi-agent system the caller is often another agent that will report the guess upstream as an answer. Rejecting at the edge is cheaper and clearer than discovering the gap in the executor.

There is also a cost argument. Requests rejected before the executor do not start a model call, do not create a task in the store and do not trigger tools. For an agent that sits behind a public card, that turns a class of malformed traffic into a single error response.

Rollout steps

  1. Upgrade the server to a2a-sdk 1.4.0 or later and leave the option off.
  2. Log the declared extensions of incoming requests for a while, per client. The server call context carries the set parsed from the header.
  3. Fix clients that omit the required extension or spell it differently. Trailing slashes, http versus https and version suffixes are the usual differences.
  4. Turn the option on in a staging environment and run every client's integration tests against it.
  5. Turn it on in production, and watch the rate of ExtensionSupportRequiredError by client. Expect a short spike from clients you did not know about.
  6. For v0.3 clients, explain that this check can map to an internal error. Correlate server logs before diagnosing it; unrelated failures use that error too.

Failure modes

  • Required extensions that are not really required. If the agent can serve a request without the extension, mark it optional. Required means the server will refuse, and other implementations are expected to do the same.
  • Several required extensions. If the card marks more than one as required, add a test where the client declares only one of them, and confirm the request is rejected before you rely on it.
  • Agent cards cached by clients. A client that cached an older card without the required flag will not know to declare the extension. Version the card and keep the cache lifetime short during the change.
  • Custom handlers. The option lives on the default and legacy request handlers. A server that implements its own handler needs its own check.
  • Rejected by design, then retried. Some clients retry on any error. Make sure the error is treated as permanent so a rejected request is not sent again unchanged.

When you do not need it

If your agent has no required extensions, the option has nothing to check. If every client is your own code and already declares its extensions, the check adds a safety net and little else. It matters most for agents that other teams or other organisations call, where you do not control the client.

How to verify it

The companion example a2a_required_extensions installs both SDK versions with pinned dependencies and runs the table above as tests: the option missing on 1.3.1, off by default on 1.4.0, rejection with no declared extension, success with the exact URI and rejection with a trailing slash, checking in each case whether the executor ran. Add the last three cases to your own server's tests.

Primary references and authorship

Sources checked 2026-12-02. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/a2a_required_extensions. Views are my own and do not represent any employer, past or present.