Skip to content

Commit a4afeea

Browse files
darrelmillergemini-code-assist[bot]muscarielloTehsmash
authored
fix(spec): Clarify versioning strategy and client responsibilities in protocol specification (#1259)
Fixes #1258 ### High level summary of changes: - protocolVersion in AgentCard is now an array called protocolVersions - Servers are expected to return UnsupportedVersionError if they get a request with an A2A-Version header higher than they support. - Clients are expected to fallback to a supported version if that is acceptable to them. Tooling should help here. - Not every minor version needs to be enumerated in the protocolVersions array. 2.2 infers support for 2.1 and 2.0. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Luca Muscariello <muscariello@ieee.org> Co-authored-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
1 parent 1e5f462 commit a4afeea

3 files changed

Lines changed: 55 additions & 30 deletions

File tree

docs/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Key features of the A2A protocol include: agent discovery via Agent Cards, stand
3838
### 2.2. Key A2A Data Objects
3939

4040
- **`AgentCard`:** Metadata describing an agent, typically found at `/.well-known/agent-card.json`.
41-
- `protocolVersion`: (string) The version of the A2A protocol supported.
41+
- `protocolVersions`: (string[]) The versions of the A2A protocol supported by the agent.
4242
- `name`, `description`, `version`: (string) Agent's identity.
4343
- `url`: (string) The preferred endpoint URL for the agent's A2A service.
4444
- `provider`: (`AgentProvider`) Organization details.

docs/specification.md

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,50 @@ Push notifications are delivered via HTTP POST to client-registered webhook endp
704704

705705
### 3.6 Versioning
706706

707-
The specific version of the A2A protocol in use is identified using the `Major.Minor` elements (e.g. `1.0`) of the corresponding A2A specification version. Patch version numbers do not affect protocol compatibility, SHOULD NOT be included in requests and responses, and MUST not be considered when clients and servers negotiate protocol versions.
707+
The specific version of the A2A protocol in use is identified using the `Major.Minor` elements (e.g. `1.0`) of the corresponding A2A specification version. Patch version numbers used by the specification, do not affect protocol compatibility. Patch version numbers SHOULD NOT be used in requests, responses and Agent Cards, and MUST not be considered when clients and servers negotiate protocol versions.
708708

709-
Agents declare support for latest supported protocol version in the `protocolVersion` field in the Agent Card. Agents MAY also support earlier protocol versions. Clients SHOULD specify the desired protocol version in requests using the `A2A-Version` header. If the requested version is not supported by the agent, the agent MUST return a `VersionNotSupportedError`.
709+
#### 3.6.1 Client Responsibilities
710710

711-
It is RECOMMENDED that clients send the `A2A-Version` header with each request to reduce the chances of being broken if an agent upgrades to a new version of the protocol. Sending the `A2A-Version` header provides visibility to agents about version usage in the ecosystem, which can help inform the risks of inplace version upgrades.
711+
It is RECOMMENDED that clients send the `A2A-Version` header with each request to maintain compatibility after an agent upgrades to a new version of the protocol. Sending the `A2A-Version` header also provides visibility to agents about version usage in the ecosystem, which can help inform the risks of inplace version upgrades.
712+
713+
**Example of HTTP GET Request with Version Header:**
714+
715+
```http
716+
GET /tasks/task-123 HTTP/1.1
717+
Host: agent.example.com
718+
A2A-Version: 1.0
719+
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
720+
Accept: application/json
721+
```
722+
723+
#### 3.6.2 Server Responsibilities
724+
725+
Agents MUST process requests using the semantics of the requested `A2A-Version` (matching `Major.Minor`). If the version is not supported, agents MUST return a [`VersionNotSupportedError`](#332-error-handling).
726+
727+
Agents SHOULD declare their supported protocol versions in the `protocolVersions` field of their Agent Card:
728+
729+
- **For stable versions (1.x and above):** Backward compatibility within a major version is required. An agent supporting version `1.2` must also support `1.0` and `1.1`. Only the latest supported minor version per major version needs to be listed.
730+
- **For legacy experimental versions (0.x):** These early versions introduced breaking changes between minor versions. Agents that still support any `0.x` versions MUST explicitly list each one they support.
731+
732+
**Example of Agent Card with Supported Protocol Versions:**
733+
734+
```json
735+
{
736+
"agentId": "agent-123",
737+
"name": "Example Agent",
738+
"protocolVersions": ["0.3", "1.1"]
739+
}
740+
```
741+
742+
The above example indicates that the agent supports A2A protocol versions `0.3`, `1.0` and `1.1`.
743+
744+
#### 3.6.3 Client Fallback
745+
746+
Clients that receive a `VersionNotSupportedError` can choose to retry the request with an earlier supported version, or fail the request. This explicit failure handling helps prevent unexpected behavior that could arise if an agent processes a request containing protocol features or fields it does not recognize.
747+
748+
#### 3.6.4 Tooling support
749+
750+
Tooling libraries and SDKs that implement the A2A protocol SHOULD provide mechanisms to help clients manage protocol versioning, such as providing configuration options to enable automatic fallback to earlier versions when a `VersionNotSupportedError` is encountered. Client Agents that require the latest features of the protocol should not enable automatic fallback, to avoid silently losing functionality.
712751

713752
## 4. Protocol Data Model
714753

@@ -855,22 +894,6 @@ For detailed security guidance on push notifications, see [Section 13.2 Push Not
855894

856895
{{ proto_to_table("specification/grpc/a2a.proto", "AgentCard") }}
857896

858-
- **`protocolVersion`** (required, string): The version of the A2A protocol this agent supports (e.g., "1.0"). Defaults to "1.0".
859-
- **`name`** (required, string): A human-readable name for the agent.
860-
- **`description`** (required, string): A human-readable description of the agent, assisting users and other agents in understanding its purpose.
861-
- **`supportedInterfaces`** (optional, array of [`AgentInterface`](#446-agentinterface)): An ordered list of supported interfaces (protocol binding and URL combinations). The first item in the list is the preferred interface that clients should use when possible. Clients can select any interface from this list based on their preferences, but SHOULD prefer earlier entries when multiple options are supported.
862-
- **`provider`** (optional, [`AgentProvider`](#442-agentprovider)): The service provider of the agent.
863-
- **`version`** (required, string): The version of the agent (e.g., "1.0.0").
864-
- **`documentationUrl`** (optional, string): A URL to provide additional documentation about the agent.
865-
- **`capabilities`** (required, [`AgentCapabilities`](#443-agentcapabilities)): A2A capability set supported by the agent.
866-
- **`securitySchemes`** (optional, map of string to [`SecurityScheme`](#451-securityscheme)): The security scheme details used for authenticating with this agent.
867-
- **`security`** (optional, array of Security): Security requirements for contacting the agent.
868-
- **`defaultInputModes`** (required, array of strings): The set of interaction modes that the agent supports across all skills, defined as media types.
869-
- **`defaultOutputModes`** (required, array of strings): The media types supported as outputs from this agent.
870-
- **`skills`** (required, array of [`AgentSkill`](#445-agentskill)): Skills represent units of ability an agent can perform.
871-
- **`supportsExtendedAgentCard`** (optional, boolean): Whether the agent supports providing an extended agent card when authenticated.
872-
- **`signatures`** (optional, array of [`AgentCardSignature`](#447-agentcardsignature)): JSON Web Signatures computed for this AgentCard.
873-
- **`iconUrl`** (optional, string): An optional URL to an icon for the agent.
874897
<a id="AgentProvider"></a>
875898

876899
#### 4.4.2. AgentProvider
@@ -988,7 +1011,7 @@ Agents declare their supported extensions in the [`AgentCard`](#441-agentcard) u
9881011

9891012
```json
9901013
{
991-
"protocolVersion": "0.3.0",
1014+
"protocolVersions": ["0.3"],
9921015
"name": "Research Assistant Agent",
9931016
"description": "AI agent for academic research and fact-checking",
9941017
"supportedInterfaces": [
@@ -1187,7 +1210,7 @@ All JSON serializations of the A2A protocol data model **MUST** use **camelCase*
11871210

11881211
**Naming Convention:**
11891212

1190-
- Protocol Buffer field: `protocol_version` → JSON field: `protocolVersion`
1213+
- Protocol Buffer field: `protocol_versions` → JSON field: `protocolVersions`
11911214
- Protocol Buffer field: `context_id` → JSON field: `contextId`
11921215
- Protocol Buffer field: `default_input_modes` → JSON field: `defaultInputModes`
11931216
- Protocol Buffer field: `push_notification_config` → JSON field: `pushNotificationConfig`
@@ -1246,7 +1269,7 @@ Fields marked with `[(google.api.field_behavior) = REQUIRED]` indicate that the
12461269

12471270
The Protocol Buffer `optional` keyword is used to distinguish between a field being explicitly set versus omitted. This distinction is critical for two scenarios:
12481271

1249-
1. **Explicit Default Values:** Some fields in the specification define default values that differ from Protocol Buffer's implicit defaults (e.g., `protocolVersion` defaults to `"1.0"` rather than empty string). The `optional` keyword allows implementations to detect whether a value was explicitly provided or should use the specified default.
1272+
1. **Explicit Default Values:** Some fields in the specification define default values that differ from Protocol Buffer's implicit defaults (e.g., `protocolVersions` defaults to `["1.0"]` rather than an empty array). Implementations should apply the default value when the field is not explicitly provided.
12501273

12511274
2. **Agent Card Canonicalization:** When creating cryptographic signatures of Agent Cards, it is required to produce a canonical JSON representation. The `optional` keyword enables implementations to distinguish between fields that were explicitly set (and should be included in the canonical form) versus fields that were omitted (and should be excluded from canonicalization). This ensures Agent Cards can be reconstructed to accurately match their signature.
12521275

@@ -1845,7 +1868,7 @@ HTTP/1.1 200 OK
18451868
Content-Type: application/a2a+json
18461869
18471870
{
1848-
"protocolVersion": "0.3.0",
1871+
"protocolVersions": ["1.0"],
18491872
"name": "Extended Agent with Additional Skills",
18501873
"skills": [
18511874
/* Extended skills available to authenticated users */
@@ -2073,7 +2096,7 @@ Clients verifying Agent Card signatures **MUST**:
20732096

20742097
```json
20752098
{
2076-
"protocolVersion": "0.3.0",
2099+
"protocolVersions": ["1.0"],
20772100
"name": "GeoSpatial Route Planner Agent",
20782101
"description": "Provides advanced route planning, traffic analysis, and custom map generation services. This agent can calculate optimal routes, estimate travel times considering real-time traffic, and create personalized maps with points of interest.",
20792102
"supportedInterfaces": [
@@ -3443,15 +3466,15 @@ For **Clients** upgrading from pre-0.3.x:
34433466

34443467
1. Update parsers to expect wrapper objects with member names as discriminators
34453468
2. When constructing requests, use the new wrapper format
3446-
3. Implement version detection based on the agent's `protocolVersion` in the `AgentCard`
3469+
3. Implement version detection based on the agent's `protocolVersions` in the `AgentCard`
34473470
4. Consider maintaining backward compatibility by detecting and handling both formats during a transition period
34483471

34493472
For **Servers** upgrading from pre-0.3.x:
34503473

34513474
1. Update serialization logic to emit wrapper objects
34523475
2. **Breaking:** The `kind` field is no longer part of the protocol and should not be emitted
34533476
3. Update deserialization to expect wrapper objects with member names
3454-
4. Ensure the `AgentCard` declares the correct `protocolVersion` (1.0 or later)
3477+
4. Ensure the `AgentCard` declares the correct `protocolVersions` (e.g., ["1.0"] or later)
34553478

34563479
**Rationale:**
34573480

specification/grpc/a2a.proto

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,14 @@ message AgentInterface {
408408
// communication methods, and security requirements.
409409
// Next ID: 20
410410
message AgentCard {
411+
// The versions of the A2A protocol this agent supports.
412+
// For stable versions (1.x+), list only the latest supported minor version per major version.
413+
// For legacy experimental versions (0.x), explicitly list each supported version.
414+
// Default: ["1.0"]
415+
repeated string protocol_versions = 16 [(google.api.field_behavior) = REQUIRED];
411416
// Reserve these field numbers as they were previously used by removed
412417
// fields.
413418
reserved 3, 14, 15;
414-
// The version of the A2A protocol this agent supports.
415-
// Default: "1.0"
416-
optional string protocol_version = 16 [(google.api.field_behavior) = REQUIRED];
417419
// A human readable name for the agent.
418420
// Example: "Recipe Agent"
419421
string name = 1 [(google.api.field_behavior) = REQUIRED];

0 commit comments

Comments
 (0)