agent2agent 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/data/a2a.json +1961 -0
  3. data/data/a2a.proto +796 -0
  4. data/data/download-a2a-resources +4 -0
  5. data/data/spec.txt +3611 -0
  6. data/lib/a2a/agent.rb +243 -0
  7. data/lib/a2a/bindings/json_rpc.rb +110 -0
  8. data/lib/a2a/bindings/rest.rb +106 -0
  9. data/lib/a2a/client.rb +85 -0
  10. data/lib/a2a/proto.rb +444 -0
  11. data/lib/a2a/schema/definition.rb +114 -0
  12. data/lib/a2a/schema/validation_error.rb +129 -0
  13. data/lib/a2a/schema.rb +429 -0
  14. data/lib/a2a/server/cancel_task.rb +14 -0
  15. data/lib/a2a/server/create_task_push_notification_config.rb +14 -0
  16. data/lib/a2a/server/delete_task_push_notification_config.rb +14 -0
  17. data/lib/a2a/server/dispatcher.rb +127 -0
  18. data/lib/a2a/server/env.rb +28 -0
  19. data/lib/a2a/server/get_extended_agent_card.rb +15 -0
  20. data/lib/a2a/server/get_task.rb +14 -0
  21. data/lib/a2a/server/get_task_push_notification_config.rb +14 -0
  22. data/lib/a2a/server/list_task_push_notification_configs.rb +14 -0
  23. data/lib/a2a/server/list_tasks.rb +14 -0
  24. data/lib/a2a/server/send_message.rb +14 -0
  25. data/lib/a2a/server/send_streaming_message.rb +14 -0
  26. data/lib/a2a/server/subscribe_to_task.rb +14 -0
  27. data/lib/a2a/server/triage.rb +96 -0
  28. data/lib/a2a/server.rb +98 -0
  29. data/lib/a2a/sse/json_rpc_stream.rb +66 -0
  30. data/lib/a2a/sse/rest_stream.rb +50 -0
  31. data/lib/a2a/sse/stream.rb +129 -0
  32. data/lib/a2a/sse.rb +5 -0
  33. data/lib/a2a/store/processor.rb +136 -0
  34. data/lib/a2a/store/pub_sub.rb +149 -0
  35. data/lib/a2a/store/sqlite.rb +533 -0
  36. data/lib/a2a/store/webhooks.rb +94 -0
  37. data/lib/a2a/store.rb +6 -0
  38. data/lib/a2a/task_store.rb +315 -0
  39. data/lib/a2a/version.rb +5 -0
  40. data/lib/a2a.rb +26 -0
  41. metadata +216 -0
data/data/spec.txt ADDED
@@ -0,0 +1,3611 @@
1
+ # Agent2Agent (A2A) Protocol Specification
2
+
3
+ ??? note "**Latest Released Version** [`1.0.0`](https://a2a-protocol.org/v1.0.0/specification)"
4
+
5
+ **Previous Versions**
6
+
7
+ - [`0.3.0`](https://a2a-protocol.org/v0.3.0/specification)
8
+ - [`0.2.6`](https://a2a-protocol.org/v0.2.6/specification)
9
+ - [`0.1.0`](https://a2a-protocol.org/v0.1.0/specification)
10
+
11
+ See [Release Notes](https://github.com/a2aproject/A2A/releases) for changes made between versions.
12
+
13
+ ## 1. Introduction
14
+
15
+ The Agent2Agent (A2A) Protocol is an open standard designed to facilitate communication and interoperability between independent, potentially opaque AI agent systems. In an ecosystem where agents might be built using different frameworks, languages, or by different vendors, A2A provides a common language and interaction model.
16
+
17
+ This document provides the detailed technical specification for the A2A protocol. Its primary goal is to enable agents to:
18
+
19
+ - Discover each other's capabilities.
20
+ - Negotiate interaction modalities (text, files, structured data).
21
+ - Manage collaborative tasks.
22
+ - Securely exchange information to achieve user goals **without needing access to each other's internal state, memory, or tools.**
23
+
24
+ ### 1.1. Key Goals of A2A
25
+
26
+ - **Interoperability:** Bridge the communication gap between disparate agentic systems.
27
+ - **Collaboration:** Enable agents to delegate tasks, exchange context, and work together on complex user requests.
28
+ - **Discovery:** Allow agents to dynamically find and understand the capabilities of other agents.
29
+ - **Flexibility:** Support various interaction modes including synchronous request/response, streaming for real-time updates, and asynchronous push notifications for long-running tasks.
30
+ - **Security:** Facilitate secure communication patterns suitable for enterprise environments, relying on standard web security practices.
31
+ - **Asynchronicity:** Natively support long-running tasks and interactions that may involve human-in-the-loop scenarios.
32
+
33
+ ### 1.2. Guiding Principles
34
+
35
+ - **Simple:** Reuse existing, well-understood standards (HTTP, JSON-RPC 2.0, Server-Sent Events).
36
+ - **Enterprise Ready:** Address authentication, authorization, security, privacy, tracing, and monitoring by aligning with established enterprise practices.
37
+ - **Async First:** Designed for (potentially very) long-running tasks and human-in-the-loop interactions.
38
+ - **Modality Agnostic:** Support exchange of diverse content types including text, audio/video (via file references), structured data/forms, and potentially embedded UI components (e.g., iframes referenced in parts).
39
+ - **Opaque Execution:** Agents collaborate based on declared capabilities and exchanged information, without needing to share their internal thoughts, plans, or tool implementations.
40
+
41
+ For a broader understanding of A2A's purpose and benefits, see [What is A2A?](./topics/what-is-a2a.md).
42
+
43
+ ### 1.3. Specification Structure
44
+
45
+ This specification is organized into three distinct layers that work together to provide a complete protocol definition:
46
+
47
+ ```mermaid
48
+ graph TB
49
+ subgraph L1 ["A2A Data Model"]
50
+ direction LR
51
+ A[Task] ~~~ B[Message] ~~~ C[AgentCard] ~~~ D[Part] ~~~ E[Artifact] ~~~ F[Extension]
52
+ end
53
+
54
+ subgraph L2 ["A2A Operations"]
55
+ direction LR
56
+ G[Send Message] ~~~ H[Send Streaming Message] ~~~ I[Get Task] ~~~ J[List Tasks] ~~~ K[Cancel Task] ~~~ L[Get Agent Card]
57
+ end
58
+
59
+ subgraph L3 ["Protocol Bindings"]
60
+ direction LR
61
+ M[JSON-RPC Methods] ~~~ N[gRPC RPCs] ~~~ O[HTTP/REST Endpoints] ~~~ P[Custom Bindings]
62
+ end
63
+
64
+ %% Dependencies between layers
65
+ L1 --> L2
66
+ L2 --> L3
67
+
68
+
69
+ style A fill:#e1f5fe
70
+ style B fill:#e1f5fe
71
+ style C fill:#e1f5fe
72
+ style D fill:#e1f5fe
73
+ style E fill:#e1f5fe
74
+ style F fill:#e1f5fe
75
+
76
+ style G fill:#f3e5f5
77
+ style H fill:#f3e5f5
78
+ style I fill:#f3e5f5
79
+ style J fill:#f3e5f5
80
+ style K fill:#f3e5f5
81
+ style L fill:#f3e5f5
82
+
83
+ style M fill:#e8f5e8
84
+ style N fill:#e8f5e8
85
+ style O fill:#e8f5e8
86
+
87
+ style L1 fill:#f0f8ff,stroke:#333,stroke-width:2px
88
+ style L2 fill:#faf0ff,stroke:#333,stroke-width:2px
89
+ style L3 fill:#f0fff0,stroke:#333,stroke-width:2px
90
+ ```
91
+
92
+ **Layer 1: Canonical Data Model** defines the core data structures and message formats that all A2A implementations must understand. These are protocol agnostic definitions expressed as Protocol Buffer messages.
93
+
94
+ **Layer 2: Abstract Operations** describes the fundamental capabilities and behaviors that A2A agents must support, independent of how they are exposed over specific protocols.
95
+
96
+ **Layer 3: Protocol Bindings** provides concrete mappings of the abstract operations and data structures to specific protocol bindings (JSON-RPC, gRPC, HTTP/REST), including method names, endpoint patterns, and protocol-specific behaviors.
97
+
98
+ This layered approach ensures that:
99
+
100
+ - Core semantics remain consistent across all protocol bindings
101
+ - New protocol bindings can be added without changing the fundamental data model
102
+ - Developers can reason about A2A operations independently of binding concerns
103
+ - Interoperability is maintained through shared understanding of the canonical data model
104
+
105
+ ### 1.4 Normative Content
106
+
107
+ In addition to the protocol requirements defined in this document, the file `spec/a2a.proto` is the single authoritative normative definition of all protocol data objects and request/response messages. A generated JSON artifact (`spec/a2a.json`, produced at build time and not committed) MAY be published for convenience to tooling and the website, but it is a non-normative build artifact. SDK language bindings, schemas, and any other derived forms **MUST** be regenerated from the proto (directly or via code generation) rather than edited manually.
108
+
109
+ **Change Control and Deprecation Lifecycle:**
110
+
111
+ - Introduction: When a proto message or field is renamed, the new name is added while existing published names remain available, but marked deprecated, until the next major release.
112
+ - Documentation: Migration guidance MUST be provided via an ancillary document when introducing major breaking changes.
113
+ - Anchors: Legacy documentation anchors MUST be preserved (as hidden HTML anchors) to avoid breaking inbound links.
114
+ - SDK/Schema Aliases: SDKs and JSON Schemas SHOULD provide deprecated alias types/definitions to maintain backward compatibility.
115
+ - Removal: A deprecated name SHOULD NOT be removed earlier than the next major version after introduction of its replacement.
116
+
117
+ **Automated Generation:**
118
+
119
+ The documentation build generates `specification/json/a2a.json` on-the-fly (the file is not tracked in source control). Future improvements may publish an OpenAPI v3 + JSON Schema bundle for enhanced tooling.
120
+
121
+ **Rationale:**
122
+
123
+ Centering the proto file as the normative source ensures protocol neutrality, reduces specification drift, and provides a deterministic evolution path for the ecosystem.
124
+
125
+ ## 2. Terminology
126
+
127
+ ### 2.1. Requirements Language
128
+
129
+ The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
130
+
131
+ ### 2.2. Core Concepts
132
+
133
+ A2A revolves around several key concepts. For detailed explanations, please refer to the [Key Concepts guide](./topics/key-concepts.md).
134
+
135
+ - **A2A Client:** An application or agent that initiates requests to an A2A Server on behalf of a user or another system.
136
+ - **A2A Server (Remote Agent):** An agent or agentic system that exposes an A2A-compliant endpoint, processing tasks and providing responses.
137
+ - **Agent Card:** A JSON metadata document published by an A2A Server, describing its identity, capabilities, skills, service endpoint, and authentication requirements.
138
+ - **Message:** A communication turn between a client and a remote agent, having a `role` ("user" or "agent") and containing one or more `Parts`.
139
+ - **Task:** The fundamental unit of work managed by A2A, identified by a unique ID. Tasks are stateful and progress through a defined lifecycle.
140
+ - **Part:** The smallest unit of content within a Message or Artifact. Parts can contain text, file references, or structured data.
141
+ - **Artifact:** An output (e.g., a document, image, structured data) generated by the agent as a result of a task, composed of `Parts`.
142
+ - **Streaming:** Real-time, incremental updates for tasks (status changes, artifact chunks) delivered via protocol-specific streaming mechanisms.
143
+ - **Push Notifications:** Asynchronous task updates delivered via server-initiated HTTP POST requests to a client-provided webhook URL, for long-running or disconnected scenarios.
144
+ - **Context:** An optional identifier to logically group related tasks and messages.
145
+ - **Extension:** A mechanism for agents to provide additional functionality or data beyond the core A2A specification.
146
+
147
+ ## 3. A2A Protocol Operations
148
+
149
+ This section describes the core operations of the A2A protocol in a binding-independent manner. These operations define the fundamental capabilities that all A2A implementations must support, regardless of the underlying binding mechanism.
150
+
151
+ ### 3.1. Core Operations
152
+
153
+ The following operations define the fundamental capabilities that all A2A implementations must support, independent of the specific protocol binding used. For a quick reference mapping of these operations to protocol-specific method names and endpoints, see [Section 5.3 (Method Mapping Reference)](#53-method-mapping-reference). For detailed protocol-specific implementation details, see:
154
+
155
+ - [Section 9: JSON-RPC Protocol Binding](#9-json-rpc-protocol-binding)
156
+ - [Section 10: gRPC Protocol Binding](#10-grpc-protocol-binding)
157
+ - [Section 11: HTTP+JSON/REST Protocol Binding](#11-httpjsonrest-protocol-binding)
158
+
159
+ #### 3.1.1. Send Message
160
+
161
+ The primary operation for initiating agent interactions. Clients send a message to an agent and receive either a task that tracks the processing or a direct response message.
162
+
163
+ **Inputs:**
164
+
165
+ - [`SendMessageRequest`](#321-sendmessagerequest): Request object containing the message, configuration, and metadata
166
+
167
+ **Outputs:**
168
+
169
+ - [`Task`](#411-task): A task object representing the processing of the message, OR
170
+ - [`Message`](#414-message): A direct response message (for simple interactions that don't require task tracking)
171
+
172
+ **Errors:**
173
+
174
+ - [`ContentTypeNotSupportedError`](#332-error-handling): A Media Type provided in the request's message parts is not supported by the agent.
175
+ - [`UnsupportedOperationError`](#332-error-handling): Messages sent to Tasks that are in a terminal state (e.g., completed, canceled, rejected) cannot accept further messages.
176
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
177
+
178
+ **Behavior:**
179
+
180
+ The agent MAY create a new `Task` to process the provided message asynchronously or MAY return a direct `Message` response for simple interactions. The operation MUST return immediately with either task information or response message. Task processing MAY continue asynchronously after the response when a [`Task`](#411-task) is returned.
181
+
182
+ #### 3.1.2. Send Streaming Message
183
+
184
+ Similar to Send Message but with real-time streaming of updates during processing.
185
+
186
+ **Inputs:**
187
+
188
+ - [`SendMessageRequest`](#321-sendmessagerequest): Request object containing the message, configuration, and metadata
189
+
190
+ **Outputs:**
191
+
192
+ - [`Stream Response`](#323-stream-response) object containing:
193
+ - Initial response: [`Task`](#411-task) object OR [`Message`](#414-message) object
194
+ - Subsequent events following a `Task` MAY include stream of [`TaskStatusUpdateEvent`](#421-taskstatusupdateevent) and [`TaskArtifactUpdateEvent`](#422-taskartifactupdateevent) objects
195
+ - Final completion indicator
196
+
197
+ **Errors:**
198
+
199
+ - [`UnsupportedOperationError`](#332-error-handling): Streaming is not supported by the agent (see [Capability Validation](#334-capability-validation)).
200
+ - [`UnsupportedOperationError`](#332-error-handling): Messages sent to Tasks that are in a terminal state (e.g., completed, canceled, rejected) cannot accept further messages.
201
+ - [`ContentTypeNotSupportedError`](#332-error-handling): A Media Type provided in the request's message parts is not supported by the agent.
202
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
203
+
204
+ **Behavior:**
205
+
206
+ The operation MUST establish a streaming connection for real-time updates. The stream MUST follow one of these patterns:
207
+
208
+ 1. **Message-only stream:** If the agent returns a [`Message`](#414-message), the stream MUST contain exactly one `Message` object and then close immediately. No task tracking or updates are provided.
209
+
210
+ 2. **Task lifecycle stream:** If the agent returns a [`Task`](#411-task), the stream MUST begin with the Task object, followed by zero or more [`TaskStatusUpdateEvent`](#421-taskstatusupdateevent) or [`TaskArtifactUpdateEvent`](#422-taskartifactupdateevent) objects. The stream MUST close when the task reaches a terminal state (e.g. completed, failed, canceled, rejected).
211
+
212
+ The agent MAY return a `Task` for complex processing with status/artifact updates or MAY return a `Message` for direct streaming responses without task overhead. The implementation MUST provide immediate feedback on progress and intermediate results.
213
+
214
+ #### 3.1.3. Get Task
215
+
216
+ Retrieves the current state (including status, artifacts, and optionally history) of a previously initiated task. This is typically used for polling the status of a task initiated with Send Message, or for fetching the final state of a task after being notified via a push notification or after a stream has ended.
217
+
218
+ **Inputs:**
219
+
220
+ {{ proto_to_table("GetTaskRequest") }}
221
+
222
+ See [History Length Semantics](#324-history-length-semantics) for details about `historyLength`.
223
+
224
+ **Outputs:**
225
+
226
+ - [`Task`](#411-task): Current state and artifacts of the requested task
227
+
228
+ **Errors:**
229
+
230
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
231
+
232
+ #### 3.1.4. List Tasks
233
+
234
+ Retrieves a list of tasks with optional filtering and pagination capabilities. This method allows clients to discover and manage multiple tasks across different contexts or with specific status criteria.
235
+
236
+ **Inputs:**
237
+
238
+ {{ proto_to_table("ListTasksRequest") }}
239
+
240
+ When `includeArtifacts` is false (the default), the artifacts field MUST be omitted entirely from each Task object in the response. The field should not be present as an empty array or null value. When `includeArtifacts` is true, the artifacts field should be included with its actual content (which may be an empty array if the task has no artifacts).
241
+
242
+ **Outputs:**
243
+
244
+ {{ proto_to_table("ListTasksResponse") }}
245
+
246
+ Note on `nextPageToken`: The `nextPageToken` field MUST always be present in the response. When there are no more results to retrieve (i.e., this is the final page), the field MUST be set to an empty string (""). Clients should check for an empty string to determine if more pages are available.
247
+
248
+ **Errors:**
249
+
250
+ None specific to this operation beyond standard protocol errors.
251
+
252
+ **Behavior:**
253
+
254
+ The operation MUST return only tasks visible to the authenticated client and MUST use cursor-based pagination for performance and consistency. Tasks MUST be sorted by last update time in descending order. Implementations MUST implement appropriate authorization scoping to ensure clients can only access authorized tasks. See [Section 13.1 Data Access and Authorization Scoping](#131-data-access-and-authorization-scoping) for detailed security requirements.
255
+
256
+ ***Pagination Strategy:***
257
+
258
+ This method uses cursor-based pagination (via `pageToken`/`nextPageToken`) rather than offset-based pagination for better performance and consistency, especially with large datasets. Cursor-based pagination avoids the "deep pagination problem" where skipping large numbers of records becomes inefficient for databases. This approach is consistent with the gRPC specification, which also uses cursor-based pagination (page_token/next_page_token).
259
+
260
+ ***Ordering:***
261
+
262
+ Implementations MUST return tasks sorted by their status timestamp time in descending order (most recently updated tasks first). This ensures consistent pagination and allows clients to efficiently monitor recent task activity.
263
+
264
+ #### 3.1.5. Cancel Task
265
+
266
+ Requests the cancellation of an ongoing task. The server will attempt to cancel the task, but success is not guaranteed (e.g., the task might have already completed or failed, or cancellation might not be supported at its current stage).
267
+
268
+ **Inputs:**
269
+
270
+ {{ proto_to_table("CancelTaskRequest") }}
271
+
272
+ **Outputs:**
273
+
274
+ - Updated [`Task`](#411-task) with cancellation status
275
+
276
+ **Errors:**
277
+
278
+ - [`TaskNotCancelableError`](#332-error-handling): The task is not in a cancelable state (e.g., already completed, failed, or canceled).
279
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
280
+
281
+ **Behavior:**
282
+
283
+ The operation attempts to cancel the specified task and returns its updated state.
284
+
285
+ #### 3.1.6. Subscribe to Task
286
+
287
+ <span id="79-taskssubscribe"></span>
288
+
289
+ Establishes a streaming connection to receive updates for an existing task.
290
+
291
+ **Inputs:**
292
+
293
+ {{ proto_to_table("SubscribeToTaskRequest") }}
294
+
295
+ **Outputs:**
296
+
297
+ - [`Stream Response`](#323-stream-response) object containing:
298
+ - Initial response: [`Task`](#411-task) object with current state
299
+ - Stream of [`TaskStatusUpdateEvent`](#421-taskstatusupdateevent) and [`TaskArtifactUpdateEvent`](#422-taskartifactupdateevent) objects
300
+
301
+ **Errors:**
302
+
303
+ - [`UnsupportedOperationError`](#332-error-handling): Streaming is not supported by the agent (see [Capability Validation](#334-capability-validation)).
304
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
305
+ - [`UnsupportedOperationError`](#332-error-handling): The operation is attempted on a task that is in a terminal state (`completed`, `failed`, `canceled`, or `rejected`).
306
+
307
+ **Behavior:**
308
+
309
+ The operation enables real-time monitoring of task progress and can be used with any task that is not in a terminal state. The stream MUST terminate when the task reaches a terminal state (`completed`, `failed`, `canceled`, or `rejected`).
310
+
311
+ The operation MUST return a `Task` object as the first event in the stream, representing the current state of the task at the time of subscription. This prevents a potential loss of information between a call to `GetTask` and calling `SubscribeToTask`.
312
+
313
+ #### 3.1.7. Create Push Notification Config
314
+
315
+ <span id="75-taskspushnotificationconfigset"></span>
316
+ <span id="317-create-push-notification-config"></span>
317
+
318
+ Creates a push notification configuration for a task to receive asynchronous updates via webhook.
319
+
320
+ **Inputs:**
321
+
322
+ {{ proto_to_table("CreateTaskPushNotificationConfigRequest") }}
323
+
324
+ **Outputs:**
325
+
326
+ - [`PushNotificationConfig`](#431-pushnotificationconfig): Created configuration with assigned ID
327
+
328
+ **Errors:**
329
+
330
+ - [`PushNotificationNotSupportedError`](#332-error-handling): Push notifications are not supported by the agent (see [Capability Validation](#334-capability-validation)).
331
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
332
+
333
+ **Behavior:**
334
+
335
+ The operation MUST establish a webhook endpoint for task update notifications. When task updates occur, the agent will send HTTP POST requests to the configured webhook URL with [`StreamResponse`](#323-stream-response) payloads (see [Push Notification Payload](#433-push-notification-payload) for details). This operation is only available if the agent supports push notifications capability. The configuration MUST persist until task completion or explicit deletion.
336
+
337
+ <span id="tasks-push-notification-config-operations"></span><span id="grpc-push-notification-operations"></span><span id="push-notification-operations"></span>
338
+
339
+ #### 3.1.8. Get Push Notification Config
340
+
341
+ <span id="76-taskspushnotificationconfigget"></span>
342
+
343
+ Retrieves an existing push notification configuration for a task.
344
+
345
+ **Inputs:**
346
+
347
+ {{ proto_to_table("GetTaskPushNotificationConfigRequest") }}
348
+
349
+ **Outputs:**
350
+
351
+ - [`PushNotificationConfig`](#431-pushnotificationconfig): The requested configuration
352
+
353
+ **Errors:**
354
+
355
+ - [`PushNotificationNotSupportedError`](#332-error-handling): Push notifications are not supported by the agent (see [Capability Validation](#334-capability-validation)).
356
+ - [`TaskNotFoundError`](#332-error-handling): The push notification configuration does not exist.
357
+
358
+ **Behavior:**
359
+
360
+ The operation MUST return configuration details including webhook URL and notification settings. The operation MUST fail if the configuration does not exist or the client lacks access.
361
+
362
+ #### 3.1.9. List Push Notification Configs
363
+
364
+ Retrieves all push notification configurations for a task.
365
+
366
+ **Inputs:**
367
+
368
+ {{ proto_to_table("ListTaskPushNotificationConfigsRequest") }}
369
+
370
+ **Outputs:**
371
+
372
+ {{ proto_to_table("ListTaskPushNotificationConfigsResponse") }}
373
+
374
+ **Errors:**
375
+
376
+ - [`PushNotificationNotSupportedError`](#332-error-handling): Push notifications are not supported by the agent (see [Capability Validation](#334-capability-validation)).
377
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist or is not accessible.
378
+
379
+ **Behavior:**
380
+
381
+ The operation MUST return all active push notification configurations for the specified task and MAY support pagination for tasks with many configurations.
382
+
383
+ #### 3.1.10. Delete Push Notification Config
384
+
385
+ Removes a push notification configuration for a task.
386
+
387
+ **Inputs:**
388
+
389
+ {{ proto_to_table("DeleteTaskPushNotificationConfigRequest") }}
390
+
391
+ **Outputs:**
392
+
393
+ - Confirmation of deletion (implementation-specific)
394
+
395
+ **Errors:**
396
+
397
+ - [`PushNotificationNotSupportedError`](#332-error-handling): Push notifications are not supported by the agent (see [Capability Validation](#334-capability-validation)).
398
+ - [`TaskNotFoundError`](#332-error-handling): The task ID does not exist.
399
+
400
+ **Behavior:**
401
+
402
+ The operation MUST permanently remove the specified push notification configuration. No further notifications will be sent to the configured webhook after deletion. This operation MUST be idempotent - multiple deletions of the same config have the same effect.
403
+
404
+ #### 3.1.11. Get Extended Agent Card
405
+
406
+ Retrieves a potentially more detailed version of the Agent Card after the client has authenticated. This endpoint is available only if `AgentCard.capabilities.extendedAgentCard` is `true`.
407
+
408
+ **Inputs:**
409
+
410
+ {{ proto_to_table("GetExtendedAgentCardRequest") }}
411
+
412
+ **Outputs:**
413
+
414
+ - [`AgentCard`](#441-agentcard): A complete Agent Card object, which may contain additional details or skills not present in the public card
415
+
416
+ **Errors:**
417
+
418
+ - [`UnsupportedOperationError`](#332-error-handling): The agent does not support authenticated extended cards (see [Capability Validation](#334-capability-validation)).
419
+ - [`ExtendedAgentCardNotConfiguredError`](#332-error-handling): The agent declares support but does not have an extended agent card configured.
420
+
421
+ **Behavior:**
422
+
423
+ - **Authentication**: The client MUST authenticate the request using one of the schemes declared in the public `AgentCard.securitySchemes` and `AgentCard.security` fields.
424
+ - **Extended Information**: The operation MAY return different details based on client authentication level, including additional skills, capabilities, or configuration not available in the public Agent Card.
425
+ - **Card Replacement**: Clients retrieving this extended card SHOULD replace their cached public Agent Card with the content received from this endpoint for the duration of their authenticated session or until the card's version changes.
426
+ - **Availability**: This operation is only available if the public Agent Card declares `capabilities.extendedAgentCard: true`.
427
+
428
+ For detailed security guidance on extended agent cards, see [Section 13.3 Extended Agent Card Access Control](#133-extended-agent-card-access-control).
429
+
430
+ ### 3.2. Operation Parameter Objects
431
+
432
+ This section defines common parameter objects used across multiple operations.
433
+
434
+ #### 3.2.1. SendMessageRequest
435
+
436
+ {{ proto_to_table("SendMessageRequest") }}
437
+
438
+ #### 3.2.2. SendMessageConfiguration
439
+
440
+ {{ proto_to_table("SendMessageConfiguration") }}
441
+
442
+ **Execution Mode:**
443
+
444
+ The `return_immediately` field in [`SendMessageConfiguration`](#322-sendmessageconfiguration) controls whether the operation returns immediately or waits for task completion. Operations are blocking by default:
445
+
446
+ - **Blocking (`return_immediately: false` or unset)**: The operation MUST wait until the task reaches a terminal state (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or an interrupted state (`INPUT_REQUIRED`, `AUTH_REQUIRED`) before returning. The response MUST include the latest task state with all artifacts and status information. This is the default behavior.
447
+
448
+ - **Non-Blocking (`return_immediately: true`)**: The operation MUST return immediately after creating the task, even if processing is still in progress. The returned task will have an in-progress state (e.g., `working`, `input_required`). It is the caller's responsibility to poll for updates using [Get Task](#313-get-task), subscribe via [Subscribe to Task](#316-subscribe-to-task), or receive updates via push notifications.
449
+
450
+ The `return_immediately` field has no effect:
451
+
452
+ - when the operation returns a direct [`Message`](#414-message) response instead of a task.
453
+ - for streaming operations, which always return updates in real-time.
454
+ - on configured push notification configurations, which operates independently of execution mode.
455
+
456
+ #### 3.2.3. Stream Response
457
+
458
+ <span id="323-stream-response"></span>
459
+ <span id="72-messagestream"></span>
460
+
461
+ {{ proto_to_table("StreamResponse") }}
462
+
463
+ This wrapper allows streaming endpoints to return different types of updates through a single response stream while maintaining type safety.
464
+
465
+ #### 3.2.4. History Length Semantics
466
+
467
+ The `historyLength` parameter appears in multiple operations and controls how much task history is returned in responses. This parameter follows consistent semantics across all operations:
468
+
469
+ - **Unset/undefined**: No limit imposed; server returns its default amount of history (implementation-defined, may be all history)
470
+ - **0**: No history should be returned; the `history` field SHOULD be omitted
471
+ - **> 0**: Return at most this many recent messages from the task's history
472
+
473
+ #### 3.2.5. Metadata
474
+
475
+ A flexible key-value map for passing additional context or parameters with operations. Metadata keys and are strings and values can be any valid value that can be represented in JSON. [`Extensions`](#46-extensions) can be used to strongly type metadata values for specific use cases.
476
+
477
+ #### 3.2.6 Service Parameters
478
+
479
+ A key-value map for passing horizontally applicable context or parameters with case-insensitive string keys and case-sensitive string values. The transmission mechanism for these service parameter key-value pairs is defined by the specific protocol binding (e.g., HTTP headers for HTTP-based bindings, gRPC metadata for gRPC bindings). Custom protocol bindings **MUST** specify how service parameters are transmitted in their binding specification.
480
+
481
+ **Standard A2A Service Parameters:**
482
+
483
+ | Name | Description | Example Value |
484
+ | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------- |
485
+ | `A2A-Extensions` | Comma-separated list of extension URIs that the client wants to use for the request | `https://example.com/extensions/geolocation/v1,https://standards.org/extensions/citations/v1` |
486
+ | `A2A-Version` | The A2A protocol version that the client is using. If the version is not supported, the agent returns [`VersionNotSupportedError`](#332-error-handling) | `0.3` |
487
+
488
+ As service parameter names MAY need to co-exist with other parameters defined by the underlying transport protocol or infrastructure, all service parameters defined by this specification will be prefixed with `a2a-`.
489
+
490
+ ### 3.3. Operation Semantics
491
+
492
+ #### 3.3.1. Idempotency
493
+
494
+ - **Get operations** (Get Task, List Tasks, Get Extended Agent Card) are naturally idempotent
495
+ - **Send Message** operations MAY be idempotent. Agents may utilize the messageId to detect duplicate messages.
496
+ - **Cancel Task** operations are idempotent - multiple cancellation requests have the same effect. A duplicate cancellation request MAY return `TaskNotFoundError` if the task has already been canceled and purged.
497
+
498
+ #### 3.3.2. Error Handling
499
+
500
+ All operations may return errors in the following categories. Servers **MUST** return appropriate errors and **SHOULD** provide actionable information to help clients resolve issues.
501
+
502
+ **Error Categories and Server Requirements:**
503
+
504
+ - **Authentication Errors**: Invalid or missing credentials
505
+ - Servers **MUST** reject requests with invalid or missing authentication credentials
506
+ - Servers **SHOULD** include authentication challenge information in the error response
507
+ - Servers **SHOULD** specify which authentication scheme is required
508
+ - Example error codes: HTTP `401 Unauthorized`, gRPC `UNAUTHENTICATED`, JSON-RPC custom error
509
+ - Example scenarios: Missing bearer token, expired API key, invalid OAuth token
510
+
511
+ - **Authorization Errors**: Insufficient permissions for requested operation
512
+ - Servers **MUST** return an authorization error when the authenticated client lacks required permissions
513
+ - Servers **SHOULD** indicate what permission or scope is missing (without leaking sensitive information about resources the client cannot access)
514
+ - Servers **MUST NOT** reveal the existence of resources the client is not authorized to access
515
+ - Example error codes: HTTP `403 Forbidden`, gRPC `PERMISSION_DENIED`, JSON-RPC custom error
516
+ - Example scenarios: Attempting to access a task created by another user, insufficient OAuth scopes
517
+
518
+ - **Validation Errors**: Invalid input parameters or message format
519
+ - Servers **MUST** validate all input parameters before processing
520
+ - Servers **SHOULD** specify which parameter(s) failed validation and why
521
+ - Servers **SHOULD** provide guidance on valid parameter values or formats
522
+ - Example error codes: HTTP `400 Bad Request`, gRPC `INVALID_ARGUMENT`, JSON-RPC `-32602 Invalid params`
523
+ - Example scenarios: Invalid task ID format, missing required message parts, unsupported content type
524
+
525
+ - **Resource Errors**: Requested task not found or not accessible
526
+ - Servers **MUST** return a not found error when a requested resource does not exist or is not accessible to the authenticated client
527
+ - Servers **SHOULD NOT** distinguish between "does not exist" and "not authorized" to prevent information leakage
528
+ - Example error codes: HTTP `404 Not Found`, gRPC `NOT_FOUND`, JSON-RPC custom error (see A2A-specific errors)
529
+ - Example scenarios: Task ID does not exist, task has been deleted, configuration not found
530
+
531
+ - **System Errors**: Internal agent failures or temporary unavailability
532
+ - Servers **SHOULD** return appropriate error codes for temporary failures vs. permanent errors
533
+ - Servers **MAY** include retry guidance (e.g., Retry-After header in HTTP)
534
+ - Servers **SHOULD** log system errors for diagnostic purposes
535
+ - Example error codes: HTTP `500 Internal Server Error` or `503 Service Unavailable`, gRPC `INTERNAL` or `UNAVAILABLE`, JSON-RPC `-32603 Internal error`
536
+ - Example scenarios: Database connection failure, downstream service timeout, rate limit exceeded
537
+
538
+ **Error Payload Structure:**
539
+
540
+ All error responses in the A2A protocol, regardless of binding, **MUST** convey the following information:
541
+
542
+ 1. **Error Code**: A machine-readable identifier for the error type (e.g., string code, numeric code, or protocol-specific status)
543
+ 2. **Error Message**: A human-readable description of the error
544
+ 3. **Error Details** (optional): An array of objects providing additional structured information about the error. Each object in the array **MUST** include a `@type` key that identifies the object's type (using [ProtoJSON `Any` representation](https://protobuf.dev/programming-guides/json)). Well-known types from the [`google.rpc` error model](https://cloud.google.com/apis/design/errors#error_model) (e.g., `ErrorInfo`, `BadRequest`) **SHOULD** be used where applicable. Error details may be used for:
545
+ - Affected fields or parameters
546
+ - Contextual information (e.g., task ID, timestamp)
547
+ - Suggestions for resolution
548
+
549
+ Protocol bindings **MUST** map these elements to their native error representations while preserving semantic meaning. See binding-specific sections for concrete error format examples: [JSON-RPC Error Handling](#95-error-handling), [gRPC Error Handling](#106-error-handling), and [HTTP/REST Error Handling](#116-error-handling).
550
+
551
+ **A2A-Specific Errors:**
552
+
553
+ | Error Name | Description |
554
+ | :------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
555
+ | `TaskNotFoundError` | The specified task ID does not correspond to an existing or accessible task. It might be invalid, expired, or already completed and purged. |
556
+ | `TaskNotCancelableError` | An attempt was made to cancel a task that is not in a cancelable state (e.g., it has already reached a terminal state like `completed`, `failed`, or `canceled`). |
557
+ | `PushNotificationNotSupportedError` | Client attempted to use push notification features but the server agent does not support them (i.e., `AgentCard.capabilities.pushNotifications` is `false`). |
558
+ | `UnsupportedOperationError` | The requested operation or a specific aspect of it is not supported by this server agent implementation. |
559
+ | `ContentTypeNotSupportedError` | A Media Type provided in the request's message parts or implied for an artifact is not supported by the agent or the specific skill being invoked. |
560
+ | `InvalidAgentResponseError` | An agent returned a response that does not conform to the specification for the current method. |
561
+ | `ExtendedAgentCardNotConfiguredError` | The agent does not have an extended agent card configured when one is required for the requested operation. |
562
+ | `ExtensionSupportRequiredError` | Server requested use of an extension marked as `required: true` in the Agent Card but the client did not declare support for it in the request. |
563
+ | `VersionNotSupportedError` | The A2A protocol version specified in the request (via `A2A-Version` service parameter) is not supported by the agent. |
564
+
565
+ #### 3.3.3. Asynchronous Processing
566
+
567
+ A2A operations are designed for asynchronous task execution. Operations return immediately with either [`Task`](#411-task) objects or [`Message`](#414-message) objects, and when a Task is returned, processing continues in the background. Clients retrieve task updates through polling, streaming, or push notifications (see [Section 3.5](#35-task-update-delivery-mechanisms)). Agents MAY accept additional messages for tasks in non-terminal states to enable multi-turn interactions (see [Section 3.4](#34-multi-turn-interactions)).
568
+
569
+ #### 3.3.4. Capability Validation
570
+
571
+ Agents declare optional capabilities in their [`AgentCard`](#441-agentcard). When clients attempt to use operations or features that require capabilities not declared as supported in the Agent Card, the agent **MUST** return an appropriate error response:
572
+
573
+ - **Push Notifications**: If `AgentCard.capabilities.pushNotifications` is `false` or not present, operations related to push notification configuration (Create, Get, List, Delete) **MUST** return [`PushNotificationNotSupportedError`](#332-error-handling).
574
+ - **Streaming**: If `AgentCard.capabilities.streaming` is `false` or not present, attempts to use `SendStreamingMessage` or `SubscribeToTask` operations **MUST** return [`UnsupportedOperationError`](#332-error-handling).
575
+ - **Extended Agent Card**: If `AgentCard.capabilities.extendedAgentCard` is `false` or not present, attempts to call the Get Extended Agent Card operation **MUST** return [`UnsupportedOperationError`](#332-error-handling). If the agent declares support but has not configured an extended card, it **MUST** return [`ExtendedAgentCardNotConfiguredError`](#332-error-handling).
576
+ - **Extensions**: When a server requests use of an extension marked as `required: true` in the Agent Card but the client does not declare support for it, the agent **MUST** return [`ExtensionSupportRequiredError`](#332-error-handling).
577
+
578
+ Clients **SHOULD** validate capability support by examining the Agent Card before attempting operations that require optional capabilities.
579
+
580
+ ### 3.4. Multi-Turn Interactions
581
+
582
+ The A2A protocol supports multi-turn conversations through context identifiers and task references, enabling agents to maintain conversational continuity across multiple interactions.
583
+
584
+ #### 3.4.1. Context Identifier Semantics
585
+
586
+ A `contextId` is an identifier that logically groups multiple related [`Task`](#411-task) and [`Message`](#414-message) objects, providing continuity across a series of interactions.
587
+
588
+ **Generation and Assignment:**
589
+
590
+ - Agents **MAY** generate a new `contextId` when processing a [`Message`](#414-message) that does not include a `contextId` field
591
+ - If an agent generates a new `contextId`, it **MUST** be included in the response (either [`Task`](#411-task) or [`Message`](#414-message))
592
+ - Agents **MAY** accept and preserve client-provided `contextId` values
593
+ - If an agent cannot accept a client-provided `contextId`, it **MUST** reject the request with an error and **MUST NOT** generate a new `contextId` for the response
594
+ - Clients **SHOULD NOT** provide a client-generated `contextId` to a server unless they understand how the server will process that `contextId`
595
+ - Server-generated `contextId` values **SHOULD** be treated as opaque identifiers by clients
596
+
597
+ **Grouping and Scope:**
598
+
599
+ - A `contextId` logically groups multiple [`Task`](#411-task) objects and [`Message`](#414-message) objects that are part of the same conversational context
600
+ - All tasks and messages with the same `contextId` **SHOULD** be treated as part of the same conversational session
601
+ - Agents **MAY** use the `contextId` to maintain internal state, conversational history, or LLM context across multiple interactions
602
+ - Agents **MAY** implement context expiration or cleanup policies and **SHOULD** document any such policies
603
+
604
+ #### 3.4.2. Task Identifier Semantics
605
+
606
+ A `taskId` is a unique identifier for a [`Task`](#411-task) object, representing a stateful unit of work with a defined lifecycle.
607
+
608
+ **Generation and Assignment:**
609
+
610
+ - Task IDs are **server-generated** when a new task is created in response to a [`Message`](#414-message)
611
+ - Agents **MUST** generate a unique `taskId` for each new task they create
612
+ - The generated `taskId` **MUST** be included in the [`Task`](#411-task) object returned to the client
613
+ - When a client includes a `taskId` in a [`Message`](#414-message), it **MUST** reference an existing task
614
+ - Agents **MUST** return a [`TaskNotFoundError`](#332-error-handling) if the provided `taskId` does not correspond to an existing task
615
+ - Client-provided `taskId` values for creating new tasks is **NOT** supported
616
+
617
+ #### 3.4.3. Multi-Turn Conversation Patterns
618
+
619
+ The A2A protocol supports several patterns for multi-turn interactions:
620
+
621
+ **Context Continuity:**
622
+
623
+ - [`Task`](#411-task) objects maintain conversation context through the `contextId` field
624
+ - Clients **MAY** include the `contextId` in subsequent messages to indicate continuation of a previous interaction
625
+ - Clients **MAY** use `taskId` (with or without `contextId`) to continue or refine a specific task
626
+ - Clients **MAY** use `contextId` without `taskId` to start a new task within an existing conversation context
627
+ - Agents **MUST** infer `contextId` from the task if only `taskId` is provided
628
+ - Agents **MUST** reject messages containing mismatching `contextId` and `taskId` (i.e., the provided `contextId` is different from that of the referenced [`Task`](#411-task)).
629
+
630
+ **Input Required State:**
631
+
632
+ - Agents can request additional input mid-processing by transitioning a task to the `input-required` state
633
+ - The client continues the interaction by sending a new message with the same `taskId` and `contextId`
634
+
635
+ **Follow-up Messages:**
636
+
637
+ - Clients can send additional messages with `taskId` references to continue or refine existing tasks
638
+ - Clients **SHOULD** use the `referenceTaskIds` field in [`Message`](#414-message) to explicitly reference related tasks
639
+ - Agents **SHOULD** use referenced tasks to understand the context and intent of follow-up requests
640
+
641
+ **Context Inheritance:**
642
+
643
+ - New tasks created within the same `contextId` can inherit context from previous interactions
644
+ - Agents **SHOULD** leverage the shared `contextId` to provide contextually relevant responses
645
+
646
+ ### 3.5. Task Update Delivery Mechanisms
647
+
648
+ The A2A protocol provides three complementary mechanisms for clients to receive updates about task progress and completion.
649
+
650
+ #### 3.5.1. Overview of Update Mechanisms
651
+
652
+ **Polling (Get Task):**
653
+
654
+ - Client periodically calls Get Task ([Section 3.1.3](#313-get-task)) to check task status
655
+ - Simple to implement, works with all protocol bindings
656
+ - Higher latency, potential for unnecessary requests
657
+ - Best for: Simple integrations, infrequent updates, clients behind restrictive firewalls
658
+
659
+ **Streaming:**
660
+
661
+ - Real-time delivery of events as they occur
662
+ - Operations: Send Streaming Message ([Section 3.1.2](#312-send-streaming-message)) and Subscribe to Task ([Section 3.1.6](#316-subscribe-to-task))
663
+ - Low latency, efficient for frequent updates
664
+ - Requires persistent connection support
665
+ - Best for: Interactive applications, real-time dashboards, live progress monitoring
666
+ - Requires `AgentCard.capabilities.streaming` to be `true`
667
+
668
+ **Push Notifications (WebHooks):**
669
+
670
+ - Agent sends HTTP POST requests to client-registered endpoints when task state changes
671
+ - Client does not maintain persistent connection
672
+ - Asynchronous delivery, client must be reachable via HTTP
673
+ - Best for: Server-to-server integrations, long-running tasks, event-driven architectures
674
+ - Operations: Create ([Section 3.1.7](#317-create-push-notification-config)), Get ([Section 3.1.8](#76-taskspushnotificationconfigget)), List ([Section 3.1.9](#319-list-push-notification-configs)), Delete ([Section 3.1.10](#3110-delete-push-notification-config))
675
+ - Event types: TaskStatusUpdateEvent ([Section 4.2.1](#421-taskstatusupdateevent)), TaskArtifactUpdateEvent ([Section 4.2.2](#422-taskartifactupdateevent)), WebHook payloads ([Section 4.3](#43-push-notification-objects))
676
+ - Requires `AgentCard.capabilities.pushNotifications` to be `true`
677
+ - Regardless of the protocol binding being used by the agent, WebHook calls use plain HTTP and the JSON payloads as defined in the HTTP protocol binding
678
+
679
+ #### 3.5.2. Streaming Event Delivery
680
+
681
+ **Event Ordering:**
682
+
683
+ All implementations MUST deliver events in the order they were generated. Events MUST NOT be reordered during transmission, regardless of protocol binding.
684
+
685
+ **Multiple Streams Per Task:**
686
+
687
+ An agent MAY serve multiple concurrent streams to one or more clients for the same task. This allows multiple clients (or the same client with multiple connections) to independently subscribe to and receive updates about a task's progress.
688
+
689
+ When multiple streams are active for a task:
690
+
691
+ - Events MUST be broadcast to all active streams for that task
692
+ - Each stream MUST receive the same events in the same order
693
+ - Closing one stream MUST NOT affect other active streams for the same task
694
+ - The task lifecycle is independent of any individual stream's lifecycle
695
+
696
+ This capability enables scenarios such as:
697
+
698
+ - Multiple team members monitoring the same long-running task
699
+ - A client reconnecting to a task after a network interruption by opening a new stream
700
+ - Different applications or dashboards displaying real-time updates for the same task
701
+
702
+ #### 3.5.3. Push Notification Delivery
703
+
704
+ Push notifications are delivered via HTTP POST to client-registered webhook endpoints. The delivery semantics and reliability guarantees are defined in [Section 4.3](#43-push-notification-objects).
705
+
706
+ ### 3.6 Versioning
707
+
708
+ 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.
709
+
710
+ #### 3.6.1 Client Responsibilities
711
+
712
+ Clients MUST send the `A2A-Version` header with each request to maintain compatibility after an agent upgrades to a new version of the protocol (except for 0.3 Clients - 0.3 will be assumed for empty header). 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.
713
+
714
+ **Example of HTTP GET Request with Version Header:**
715
+
716
+ ```http
717
+ GET /tasks/task-123 HTTP/1.1
718
+ Host: agent.example.com
719
+ A2A-Version: 1.0
720
+ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
721
+ Accept: application/json
722
+ ```
723
+
724
+ Clients MAY provide the `A2A-Version` as a request parameter instead of a header.
725
+
726
+ **Example of HTTP GET Request with Version request parameter:**
727
+
728
+ ```http
729
+ GET /tasks/task-123?A2A-Version=1.0 HTTP/1.1
730
+ Host: agent.example.com
731
+ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
732
+ Accept: application/json
733
+ ```
734
+
735
+ #### 3.6.2 Server Responsibilities
736
+
737
+ Agents MUST process requests using the semantics of the requested `A2A-Version` (matching `Major.Minor`). If the version is not supported by the interface, agents MUST return a [`VersionNotSupportedError`](#332-error-handling).
738
+
739
+ Agents MUST interpret empty value as 0.3 version.
740
+
741
+ Agents CAN expose multiple interfaces for the same transport with different versions under the same or different URLs.
742
+
743
+ #### 3.6.3 Tooling support
744
+
745
+ Tooling libraries and SDKs that implement the A2A protocol MUST provide mechanisms to help clients manage protocol versioning, such as negotiation of the transport and protocol version used. Client Agents that require the latest features of the protocol should be configured to request specific versions and avoid automatic fallback to older versions, to prevent silently losing functionality.
746
+
747
+ ### 3.7 Messages and Artifacts
748
+
749
+ Messages and Artifacts serve distinct purposes within the A2A protocol. The core interaction model defined by A2A is for clients to send messages to initiate a task that produces one or more artifacts.
750
+
751
+ Messages play several key roles:
752
+
753
+ - **Task Initiation**: Clients send Messages to agents to initiate new tasks.
754
+ - **Clarification Messages**: Agents may send Messages back to the client to request clarification prior to initiating a task.
755
+ - **Status Messages**: Agents attach Messages to status update events to inform clients about task progress, request additional input, or provide informational updates.
756
+ - **Task Interaction**: Clients send Messages to provide additional input or instructions for ongoing tasks.
757
+
758
+ Messages SHOULD NOT be used to deliver task outputs. Results SHOULD BE returned using Artifacts associated with a Task. This separation allows for a clear distinction between communication (Messages) and data output (Artifacts).
759
+
760
+ The Task History field contains Messages exchanged during task execution. However, not all Messages are guaranteed to be persisted in the Task history; for example, transient informational messages may not be stored. Messages exchanged prior to task creation may not be stored in Task history. The agent is responsible to determine which Messages are persisted in the Task History.
761
+
762
+ Clients using streaming to retrieve task updates MAY not receive all status update messages if the client is disconnected and then reconnects. Messages MUST NOT be considered a reliable delivery mechanism for critical information.
763
+
764
+ Agents MAY choose to persist all Messages that contain important information in the Task history to ensure clients can retrieve it later. However, clients MUST NOT rely on this behavior unless negotiated out-of-band.
765
+
766
+ ## 4. Protocol Data Model
767
+
768
+ The A2A protocol defines a canonical data model using Protocol Buffers. All protocol bindings **MUST** provide functionally equivalent representations of these data structures.
769
+
770
+ ### 4.1. Core Objects
771
+
772
+ <a id="Task"></a>
773
+
774
+ #### 4.1.1. Task
775
+
776
+ {{ proto_to_table("Task") }}
777
+
778
+ <a id="TaskStatus"></a>
779
+
780
+ #### 4.1.2. TaskStatus
781
+
782
+ {{ proto_to_table("TaskStatus") }}
783
+
784
+ <a id="TaskState"></a>
785
+
786
+ #### 4.1.3. TaskState
787
+
788
+ {{ proto_enum_to_table("TaskState") }}
789
+
790
+ <a id="Message"></a>
791
+
792
+ #### 4.1.4. Message
793
+
794
+ {{ proto_to_table("Message") }}
795
+
796
+ <a id="Role"></a>
797
+
798
+ #### 4.1.5. Role
799
+
800
+ {{ proto_enum_to_table("Role") }}
801
+
802
+ <a id="Part"></a>
803
+
804
+ #### 4.1.6. Part
805
+
806
+ {{ proto_to_table("Part") }}
807
+
808
+ <a id="Artifact"></a>
809
+
810
+ #### 4.1.7. Artifact
811
+
812
+ {{ proto_to_table("Artifact") }}
813
+
814
+ ### 4.2. Streaming Events
815
+
816
+ <a id="TaskStatusUpdateEvent"></a>
817
+
818
+ #### 4.2.1. TaskStatusUpdateEvent
819
+
820
+ {{ proto_to_table("TaskStatusUpdateEvent") }}
821
+
822
+ <a id="TaskArtifactUpdateEvent"></a>
823
+
824
+ #### 4.2.2. TaskArtifactUpdateEvent
825
+
826
+ {{ proto_to_table("TaskArtifactUpdateEvent") }}
827
+
828
+ ### 4.3. Push Notification Objects
829
+
830
+ <a id="PushNotificationConfig"></a>
831
+
832
+ #### 4.3.1. PushNotificationConfig
833
+
834
+ {{ proto_to_table("PushNotificationConfig") }}
835
+
836
+ <a id="PushNotificationAuthenticationInfo"></a>
837
+
838
+ #### 4.3.2. AuthenticationInfo
839
+
840
+ {{ proto_to_table("AuthenticationInfo") }}
841
+
842
+ #### 4.3.3. Push Notification Payload
843
+
844
+ When a task update occurs, the agent sends an HTTP POST request to the configured webhook URL. The payload uses the same [`StreamResponse`](#323-stream-response) format as streaming operations, allowing push notifications to deliver the same event types as real-time streams.
845
+
846
+ **Request Format:**
847
+
848
+ ```http
849
+ POST {webhook_url}
850
+ Authorization: {authentication_scheme} {credentials}
851
+ Content-Type: application/a2a+json
852
+
853
+ {
854
+ /* StreamResponse object - one of: */
855
+ "task": { /* Task object */ },
856
+ "message": { /* Message object */ },
857
+ "statusUpdate": { /* TaskStatusUpdateEvent object */ },
858
+ "artifactUpdate": { /* TaskArtifactUpdateEvent object */ }
859
+ }
860
+ ```
861
+
862
+ **Payload Structure:**
863
+
864
+ The webhook payload is a [`StreamResponse`](#323-stream-response) object containing exactly one of the following:
865
+
866
+ - **task**: A [`Task`](#411-task) object with the current task state
867
+ - **message**: A [`Message`](#414-message) object containing a message response
868
+ - **statusUpdate**: A [`TaskStatusUpdateEvent`](#421-taskstatusupdateevent) indicating a status change
869
+ - **artifactUpdate**: A [`TaskArtifactUpdateEvent`](#422-taskartifactupdateevent) indicating artifact updates
870
+
871
+ **Authentication:**
872
+
873
+ The agent MUST include authentication credentials in the request headers as specified in the [`PushNotificationConfig.authentication`](#432-authenticationinfo) field. The format follows standard HTTP authentication patterns (Bearer tokens, Basic auth, etc.).
874
+
875
+ **Client Responsibilities:**
876
+
877
+ - Clients MUST respond with HTTP 2xx status codes to acknowledge successful receipt
878
+ - Clients SHOULD process notifications idempotently, as duplicate deliveries may occur
879
+ - Clients MUST validate the task ID matches an expected task
880
+ - Clients SHOULD implement appropriate security measures to verify the notification source
881
+
882
+ **Server Guarantees:**
883
+
884
+ - Agents MUST attempt delivery at least once for each configured webhook
885
+ - Agents MAY implement retry logic with exponential backoff for failed deliveries
886
+ - Agents SHOULD include a reasonable timeout for webhook requests (recommended: 10-30 seconds)
887
+ - Agents MAY stop attempting delivery after a configured number of consecutive failures
888
+
889
+ For detailed security guidance on push notifications, see [Section 13.2 Push Notification Security](#132-push-notification-security).
890
+
891
+ ### 4.4. Agent Discovery Objects
892
+
893
+ <a id="AgentCard"></a>
894
+
895
+ #### 4.4.1. AgentCard
896
+
897
+ {{ proto_to_table("AgentCard") }}
898
+
899
+ <a id="AgentProvider"></a>
900
+
901
+ #### 4.4.2. AgentProvider
902
+
903
+ {{ proto_to_table("AgentProvider") }}
904
+
905
+ <a id="AgentCapabilities"></a>
906
+
907
+ #### 4.4.3. AgentCapabilities
908
+
909
+ {{ proto_to_table("AgentCapabilities") }}
910
+
911
+ <a id="AgentExtension"></a>
912
+
913
+ #### 4.4.4. AgentExtension
914
+
915
+ {{ proto_to_table("AgentExtension") }}
916
+
917
+ <a id="AgentSkill"></a>
918
+
919
+ #### 4.4.5. AgentSkill
920
+
921
+ {{ proto_to_table("AgentSkill") }}
922
+
923
+ <a id="AgentInterface"></a>
924
+
925
+ #### 4.4.6. AgentInterface
926
+
927
+ {{ proto_to_table("AgentInterface") }}
928
+
929
+ <a id="AgentCardSignature"></a>
930
+
931
+ #### 4.4.7. AgentCardSignature
932
+
933
+ {{ proto_to_table("AgentCardSignature") }}
934
+
935
+ ### 4.5. Security Objects
936
+
937
+ <a id="Security"></a>
938
+ <a id="SecurityScheme"></a>
939
+
940
+ #### 4.5.1. SecurityScheme
941
+
942
+ {{ proto_to_table("SecurityScheme") }}
943
+
944
+ <a id="APIKeySecurityScheme"></a>
945
+
946
+ #### 4.5.2. APIKeySecurityScheme
947
+
948
+ {{ proto_to_table("APIKeySecurityScheme") }}
949
+
950
+ <a id="HTTPAuthSecurityScheme"></a>
951
+
952
+ #### 4.5.3. HTTPAuthSecurityScheme
953
+
954
+ {{ proto_to_table("HTTPAuthSecurityScheme") }}
955
+
956
+ <a id="OAuth2SecurityScheme"></a>
957
+
958
+ #### 4.5.4. OAuth2SecurityScheme
959
+
960
+ {{ proto_to_table("OAuth2SecurityScheme") }}
961
+
962
+ <a id="OpenIdConnectSecurityScheme"></a>
963
+
964
+ #### 4.5.5. OpenIdConnectSecurityScheme
965
+
966
+ {{ proto_to_table("OpenIdConnectSecurityScheme") }}
967
+
968
+ <a id="MutualTlsSecurityScheme"></a>
969
+
970
+ #### 4.5.6. MutualTlsSecurityScheme
971
+
972
+ {{ proto_to_table("MutualTlsSecurityScheme") }}
973
+
974
+ <a id="OAuthFlows"></a>
975
+
976
+ #### 4.5.7. OAuthFlows
977
+
978
+ {{ proto_to_table("OAuthFlows") }}
979
+
980
+ <a id="AuthorizationCodeOAuthFlow"></a>
981
+
982
+ #### 4.5.8. AuthorizationCodeOAuthFlow
983
+
984
+ {{ proto_to_table("AuthorizationCodeOAuthFlow") }}
985
+
986
+ <a id="ClientCredentialsOAuthFlow"></a>
987
+
988
+ #### 4.5.9. ClientCredentialsOAuthFlow
989
+
990
+ {{ proto_to_table("ClientCredentialsOAuthFlow") }}
991
+
992
+ <a id="DeviceCodeOAuthFlow"></a>
993
+
994
+ #### 4.5.10. DeviceCodeOAuthFlow
995
+
996
+ {{ proto_to_table("DeviceCodeOAuthFlow") }}
997
+
998
+ ### 4.6. Extensions
999
+
1000
+ The A2A protocol supports extensions to provide additional functionality or data beyond the core specification while maintaining backward compatibility and interoperability. Extensions allow agents to declare additional capabilities such as protocol enhancements or vendor-specific features, maintain compatibility with clients that don't support specific extensions, enable innovation through experimental or domain-specific features without modifying the core protocol, and facilitate standardization by providing a pathway for community-developed features to become part of the core specification.
1001
+
1002
+ #### 4.6.1. Extension Declaration
1003
+
1004
+ Agents declare their supported extensions in the [`AgentCard`](#441-agentcard) using the `extensions` field, which contains an array of [`AgentExtension`](#444-agentextension) objects.
1005
+
1006
+ *Example: Agent declaring extension support in AgentCard:*
1007
+
1008
+ ```json
1009
+ {
1010
+ "name": "Research Assistant Agent",
1011
+ "description": "AI agent for academic research and fact-checking",
1012
+ "supportedInterfaces": [
1013
+ {
1014
+ "url": "https://research-agent.example.com/a2a/v1",
1015
+ "protocolBinding": "HTTP+JSON",
1016
+ "protocolVersion": "0.3",
1017
+ }
1018
+ ],
1019
+ "capabilities": {
1020
+ "streaming": false,
1021
+ "pushNotifications": false,
1022
+ "extensions": [
1023
+ {
1024
+ "uri": "https://standards.org/extensions/citations/v1",
1025
+ "description": "Provides citation formatting and source verification",
1026
+ "required": false
1027
+ },
1028
+ {
1029
+ "uri": "https://example.com/extensions/geolocation/v1",
1030
+ "description": "Location-based search capabilities",
1031
+ "required": false
1032
+ }
1033
+ ]
1034
+ },
1035
+ "defaultInputModes": ["text/plain"],
1036
+ "defaultOutputModes": ["text/plain"],
1037
+ "skills": [
1038
+ {
1039
+ "id": "academic-research",
1040
+ "name": "Academic Research Assistant",
1041
+ "description": "Provides research assistance with citations and source verification",
1042
+ "tags": ["research", "citations", "academic"],
1043
+ "examples": ["Find peer-reviewed articles on climate change"],
1044
+ "inputModes": ["text/plain"],
1045
+ "outputModes": ["text/plain"]
1046
+ }
1047
+ ]
1048
+ }
1049
+ ```
1050
+
1051
+ Clients indicate their desire to opt into the use of specific extensions through binding-specific mechanisms such as HTTP headers, gRPC metadata, or JSON-RPC request parameters that identify the extension identifiers they wish to utilize during the interaction.
1052
+
1053
+ *Example: HTTP client opting into extensions using headers:*
1054
+
1055
+ ```http
1056
+ POST /message:send HTTP/1.1
1057
+ Host: agent.example.com
1058
+ Content-Type: application/a2a+json
1059
+ Authorization: Bearer token
1060
+ A2A-Extensions: https://example.com/extensions/geolocation/v1,https://standards.org/extensions/citations/v1
1061
+
1062
+ {
1063
+ "message": {
1064
+ "role": "ROLE_USER",
1065
+ "parts": [{"text": "Find restaurants near me"}],
1066
+ "extensions": ["https://example.com/extensions/geolocation/v1"],
1067
+ "metadata": {
1068
+ "https://example.com/extensions/geolocation/v1": {
1069
+ "latitude": 37.7749,
1070
+ "longitude": -122.4194
1071
+ }
1072
+ }
1073
+ }
1074
+ }
1075
+ ```
1076
+
1077
+ #### 4.6.2. Extensions Points
1078
+
1079
+ Extensions can be integrated into the A2A protocol at several well-defined extension points:
1080
+
1081
+ **Message Extensions:**
1082
+
1083
+ Messages can be extended to allow clients to provide additional strongly typed context or parameters relevant to the message being sent, or TaskStatus Messages to include extra information about the task's progress.
1084
+
1085
+ *Example: A location extension using the extensions and metadata arrays:*
1086
+
1087
+ ```json
1088
+ {
1089
+ "role": "ROLE_USER",
1090
+ "parts": [
1091
+ {"text": "Find restaurants near me"}
1092
+ ],
1093
+ "extensions": ["https://example.com/extensions/geolocation/v1"],
1094
+ "metadata": {
1095
+ "https://example.com/extensions/geolocation/v1": {
1096
+ "latitude": 37.7749,
1097
+ "longitude": -122.4194,
1098
+ "accuracy": 10.0,
1099
+ "timestamp": "2025-10-21T14:30:00Z"
1100
+ }
1101
+ }
1102
+ }
1103
+ ```
1104
+
1105
+ **Artifact Extensions:**
1106
+
1107
+ Artifacts can include extension data to provide strongly typed context or metadata about the generated content.
1108
+
1109
+ *Example: An artifact with citation extension for research sources:*
1110
+
1111
+ ```json
1112
+ {
1113
+ "artifactId": "research-summary-001",
1114
+ "name": "Climate Change Summary",
1115
+ "parts": [
1116
+ {
1117
+ "text": "Global temperatures have risen by 1.1°C since pre-industrial times, with significant impacts on weather patterns and sea levels."
1118
+ }
1119
+ ],
1120
+ "extensions": ["https://standards.org/extensions/citations/v1"],
1121
+ "metadata": {
1122
+ "https://standards.org/extensions/citations/v1": {
1123
+ "sources": [
1124
+ {
1125
+ "title": "Global Temperature Anomalies - 2023 Report",
1126
+ "authors": ["Smith, J.", "Johnson, M."],
1127
+ "url": "https://climate.gov/reports/2023-temperature",
1128
+ "accessDate": "2025-10-21",
1129
+ "relevantText": "Global temperatures have risen by 1.1°C"
1130
+ }
1131
+ ]
1132
+ }
1133
+ }
1134
+ }
1135
+ ```
1136
+
1137
+ #### 4.6.3. Extension Versioning and Compatibility
1138
+
1139
+ Extensions **SHOULD** include version information in their URI identifier. This allows clients and agents to negotiate compatible versions of extensions during interactions. A new URI **MUST** be created for breaking changes to an extension.
1140
+
1141
+ If a client requests a versions of an extension that the agent does not support, the agent **SHOULD** ignore the extension for that interaction and proceed without it, unless the extension is marked as `required` in the AgentCard, in which case the agent **MUST** return an error indicating unsupported extension. It **MUST NOT** fall back to a previous version of the extension automatically.
1142
+
1143
+ ## 5. Protocol Binding Requirements and Interoperability
1144
+
1145
+ ### 5.1. Functional Equivalence Requirements
1146
+
1147
+ When an agent supports multiple protocols, all supported protocols **MUST**:
1148
+
1149
+ - **Identical Functionality**: Provide the same set of operations and capabilities
1150
+ - **Consistent Behavior**: Return semantically equivalent results for the same requests
1151
+ - **Same Error Handling**: Map errors consistently using appropriate protocol-specific codes
1152
+ - **Equivalent Authentication**: Support the same authentication schemes declared in the AgentCard
1153
+
1154
+ ### 5.2. Protocol Selection and Negotiation
1155
+
1156
+ - **Agent Declaration**: Agents **MUST** declare all supported protocols in their AgentCard
1157
+ - **Client Choice**: Clients **MAY** choose any protocol declared by the agent
1158
+ - **Fallback Behavior**: Clients **SHOULD** implement fallback logic for alternative protocols
1159
+
1160
+ ### 5.3. Method Mapping Reference
1161
+
1162
+ | Functionality | JSON-RPC Method | gRPC Method | REST Endpoint |
1163
+ | :------------------------------ | :--------------------------------- | :--------------------------------- | :------------------------------------------------------ |
1164
+ | Send message | `SendMessage` | `SendMessage` | `POST /message:send` |
1165
+ | Send streaming message | `SendStreamingMessage` | `SendStreamingMessage` | `POST /message:stream` |
1166
+ | Get task | `GetTask` | `GetTask` | `GET /tasks/{id}` |
1167
+ | List tasks | `ListTasks` | `ListTasks` | `GET /tasks` |
1168
+ | Cancel task | `CancelTask` | `CancelTask` | `POST /tasks/{id}:cancel` |
1169
+ | Subscribe to task | `SubscribeToTask` | `SubscribeToTask` | `POST /tasks/{id}:subscribe` |
1170
+ | Create push notification config | `CreateTaskPushNotificationConfig` | `CreateTaskPushNotificationConfig` | `POST /tasks/{id}/pushNotificationConfigs` |
1171
+ | Get push notification config | `GetTaskPushNotificationConfig` | `GetTaskPushNotificationConfig` | `GET /tasks/{id}/pushNotificationConfigs/{configId}` |
1172
+ | List push notification configs | `ListTaskPushNotificationConfigs` | `ListTaskPushNotificationConfigs` | `GET /tasks/{id}/pushNotificationConfigs` |
1173
+ | Delete push notification config | `DeleteTaskPushNotificationConfig` | `DeleteTaskPushNotificationConfig` | `DELETE /tasks/{id}/pushNotificationConfigs/{configId}` |
1174
+ | Get extended Agent Card | `GetExtendedAgentCard` | `GetExtendedAgentCard` | `GET /extendedAgentCard` |
1175
+
1176
+ ### 5.4. Error Code Mappings
1177
+
1178
+ All A2A-specific errors defined in [Section 3.3.2](#332-error-handling) **MUST** be mapped to binding-specific error representations. The following table provides the canonical mappings for each standard protocol binding:
1179
+
1180
+ | A2A Error Type | JSON-RPC Code | gRPC Status | HTTP Status |
1181
+ | :------------------------------------ | :------------ | :-------------------- | :-------------------------- |
1182
+ | `TaskNotFoundError` | `-32001` | `NOT_FOUND` | `404 Not Found` |
1183
+ | `TaskNotCancelableError` | `-32002` | `FAILED_PRECONDITION` | `400 Bad Request` |
1184
+ | `PushNotificationNotSupportedError` | `-32003` | `FAILED_PRECONDITION` | `400 Bad Request` |
1185
+ | `UnsupportedOperationError` | `-32004` | `FAILED_PRECONDITION` | `400 Bad Request` |
1186
+ | `ContentTypeNotSupportedError` | `-32005` | `INVALID_ARGUMENT` | `400 Bad Request` |
1187
+ | `InvalidAgentResponseError` | `-32006` | `INTERNAL` | `500 Internal Server Error` |
1188
+ | `ExtendedAgentCardNotConfiguredError` | `-32007` | `FAILED_PRECONDITION` | `400 Bad Request` |
1189
+ | `ExtensionSupportRequiredError` | `-32008` | `FAILED_PRECONDITION` | `400 Bad Request` |
1190
+ | `VersionNotSupportedError` | `-32009` | `FAILED_PRECONDITION` | `400 Bad Request` |
1191
+
1192
+ **Custom Binding Requirements:**
1193
+
1194
+ Custom protocol bindings **MUST** define equivalent error code mappings that preserve the semantic meaning of each A2A error type. The binding specification **SHOULD** provide a similar mapping table showing how each A2A error type is represented in the custom binding's native error format.
1195
+
1196
+ For binding-specific error structures and examples, see:
1197
+
1198
+ - [JSON-RPC Error Handling](#95-error-handling)
1199
+ - [gRPC Error Handling](#106-error-handling)
1200
+ - [HTTP/REST Error Handling](#116-error-handling)
1201
+
1202
+ ### 5.5. JSON Field Naming Convention
1203
+
1204
+ All JSON serializations of the A2A protocol data model **MUST** use **camelCase** naming for field names, not the snake_case convention used in Protocol Buffer definitions.
1205
+
1206
+ **Naming Convention:**
1207
+
1208
+ - Protocol Buffer field: `protocol_version` → JSON field: `protocolVersion`
1209
+ - Protocol Buffer field: `context_id` → JSON field: `contextId`
1210
+ - Protocol Buffer field: `default_input_modes` → JSON field: `defaultInputModes`
1211
+ - Protocol Buffer field: `push_notification_config` → JSON field: `pushNotificationConfig`
1212
+
1213
+ **Enum Values:**
1214
+
1215
+ - Enum values **MUST** be represented according to the [ProtoJSON specification](https://protobuf.dev/programming-guides/json/), which serializes enums as their string names **as defined in the Protocol Buffer definition** (typically SCREAMING_SNAKE_CASE).
1216
+
1217
+ **Examples:**
1218
+
1219
+ - Protocol Buffer enum: `TASK_STATE_INPUT_REQUIRED` → JSON value: `"TASK_STATE_INPUT_REQUIRED"`
1220
+ - Protocol Buffer enum: `ROLE_USER` → JSON value: `"ROLE_USER"`
1221
+
1222
+ **Note:** This follows the ProtoJSON specification as adopted in [ADR-001](../adrs/adr-001-protojson-serialization.md).
1223
+
1224
+ ### 5.6. Data Type Conventions
1225
+
1226
+ This section documents conventions for common data types used throughout the A2A protocol, particularly as they apply to protocol bindings.
1227
+
1228
+ #### 5.6.1. Timestamps
1229
+
1230
+ The A2A protocol uses [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) for all timestamp fields in the Protocol Buffer definitions. When serialized to JSON (in JSON-RPC, HTTP/REST, or other JSON-based bindings), these timestamps **MUST** be represented as ISO 8601 formatted strings in UTC timezone.
1231
+
1232
+ **Format Requirements:**
1233
+
1234
+ - **Format:** ISO 8601 combined date and time representation
1235
+ - **Timezone:** UTC (denoted by 'Z' suffix)
1236
+ - **Precision:** Millisecond precision **SHOULD** be used where available
1237
+ - **Pattern:** `YYYY-MM-DDTHH:mm:ss.sssZ`
1238
+
1239
+ **Examples:**
1240
+
1241
+ ```json
1242
+ {
1243
+ "timestamp": "2025-10-28T10:30:00.000Z",
1244
+ "createdAt": "2025-10-28T14:25:33.142Z",
1245
+ "lastModified": "2025-10-31T17:45:22.891Z"
1246
+ }
1247
+ ```
1248
+
1249
+ **Implementation Notes:**
1250
+
1251
+ - Protocol Buffer's `google.protobuf.Timestamp` represents time as seconds since Unix epoch (January 1, 1970, 00:00:00 UTC) plus nanoseconds
1252
+ - JSON serialization automatically converts this to ISO 8601 format when using standard Protocol Buffer JSON encoding
1253
+ - Clients and servers **MUST** parse and generate ISO 8601 timestamps correctly
1254
+ - When millisecond precision is not available, the fractional seconds portion **MAY** be omitted or zero-filled
1255
+ - Timestamps **MUST NOT** include timezone offsets other than 'Z' (all times are UTC)
1256
+
1257
+ ### 5.7. Field Presence and Optionality
1258
+
1259
+ The Protocol Buffer definition in `specification/a2a.proto` uses [`google.api.field_behavior`](https://github.com/googleapis/googleapis/blob/master/google/api/field_behavior.proto) annotations to indicate whether fields are `REQUIRED`. These annotations serve as both documentation and validation hints for implementations.
1260
+
1261
+ **Required Fields:**
1262
+
1263
+ Fields marked with `[(google.api.field_behavior) = REQUIRED]` indicate that the field **MUST** be present and set in valid messages. Implementations **SHOULD** validate these requirements and reject messages with missing required fields. Arrays marked as required **MUST** contain at least one element.
1264
+
1265
+ **Optional Field Presence:**
1266
+
1267
+ The Protocol Buffer `optional` keyword is used to distinguish between a field being explicitly set versus omitted. This distinction is critical for two scenarios:
1268
+
1269
+ 1. **Explicit Default Values:** Some fields in the specification define default values that differ from Protocol Buffer's implicit defaults. Implementations should apply the default value when the field is not explicitly provided.
1270
+
1271
+ 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.
1272
+
1273
+ **Unrecognized Fields:**
1274
+
1275
+ Implementations **SHOULD** ignore unrecognized fields in messages, allowing for forward compatibility as the protocol evolves.
1276
+
1277
+ ### 5.8. Custom Binding Identification
1278
+
1279
+ Custom protocol bindings **SHOULD** be identified by a URI. Using a URI as the
1280
+ identifier provides globally unique identification across all implementers.
1281
+
1282
+ The `protocolBinding` field in the Agent Card's `supportedInterfaces` entry
1283
+ **SHOULD** be a URI:
1284
+
1285
+ ```json
1286
+ {
1287
+ "supportedInterfaces": [
1288
+ {
1289
+ "url": "wss://agent.example.com/a2a/websocket",
1290
+ "protocolBinding": "https://example.com/bindings/websocket/v1",
1291
+ "protocolVersion": "1.0"
1292
+ }
1293
+ ]
1294
+ }
1295
+ ```
1296
+
1297
+ When a breaking change is introduced to a binding, a new URI **MUST** be used
1298
+ so that clients can distinguish between incompatible versions:
1299
+
1300
+ ```text
1301
+ https://example.com/bindings/websocket/v1 → https://example.com/bindings/websocket/v2
1302
+ ```
1303
+
1304
+ ## 6. Common Workflows & Examples
1305
+
1306
+ This section provides illustrative examples of common A2A interactions across different bindings.
1307
+
1308
+ ### 6.1. Basic Task Execution
1309
+
1310
+ **Scenario:** Client asks a question and receives a completed task response.
1311
+
1312
+ **Request:**
1313
+
1314
+ ```http
1315
+ POST /message:send HTTP/1.1
1316
+ Host: agent.example.com
1317
+ Content-Type: application/a2a+json
1318
+ Authorization: Bearer token
1319
+
1320
+ {
1321
+ "message": {
1322
+ "role": "ROLE_USER",
1323
+ "parts": [{"text": "What is the weather today?"}],
1324
+ "messageId": "msg-uuid"
1325
+ }
1326
+ }
1327
+ ```
1328
+
1329
+ **Response:**
1330
+
1331
+ ```http
1332
+ HTTP/1.1 200 OK
1333
+ Content-Type: application/a2a+json
1334
+
1335
+ {
1336
+ "task": {
1337
+ "id": "task-uuid",
1338
+ "contextId": "context-uuid",
1339
+ "status": {"state": "TASK_STATE_COMPLETED"},
1340
+ "artifacts": [{
1341
+ "artifactId": "artifact-uuid",
1342
+ "name": "Weather Report",
1343
+ "parts": [{"text": "Today will be sunny with a high of 75°F"}]
1344
+ }]
1345
+ }
1346
+ }
1347
+ ```
1348
+
1349
+ ### 6.2. Streaming Task Execution
1350
+
1351
+ **Scenario:** Client requests a long-running task with real-time updates.
1352
+
1353
+ **Request:**
1354
+
1355
+ ```http
1356
+ POST /message:stream HTTP/1.1
1357
+ Host: agent.example.com
1358
+ Content-Type: application/a2a+json
1359
+ Authorization: Bearer token
1360
+
1361
+ {
1362
+ "message": {
1363
+ "role": "ROLE_USER",
1364
+ "parts": [{"text": "Write a detailed report on climate change"}],
1365
+ "messageId": "msg-uuid"
1366
+ }
1367
+ }
1368
+ ```
1369
+
1370
+ **SSE Response Stream:**
1371
+
1372
+ ```http
1373
+ HTTP/1.1 200 OK
1374
+ Content-Type: text/event-stream
1375
+
1376
+ data: {"task": {"id": "task-uuid", "status": {"state": "TASK_STATE_WORKING"}}}
1377
+
1378
+ data: {"artifactUpdate": {"taskId": "task-uuid", "artifact": {"parts": [{"text": "# Climate Change Report\n\n"}]}}}
1379
+
1380
+ data: {"statusUpdate": {"taskId": "task-uuid", "status": {"state": "TASK_STATE_COMPLETED"}}}
1381
+ ```
1382
+
1383
+ ### 6.3. Multi-Turn Interaction
1384
+
1385
+ **Scenario:** Agent requires additional input to complete a task.
1386
+
1387
+ **Initial Request:**
1388
+
1389
+ ```http
1390
+ POST /message:send HTTP/1.1
1391
+ Host: agent.example.com
1392
+ Content-Type: application/a2a+json
1393
+ Authorization: Bearer token
1394
+
1395
+ {
1396
+ "message": {
1397
+ "role": "ROLE_USER",
1398
+ "parts": [{"text": "Book me a flight"}],
1399
+ "messageId": "msg-1"
1400
+ }
1401
+ }
1402
+ ```
1403
+
1404
+ **Response (Input Required):**
1405
+
1406
+ ```http
1407
+ HTTP/1.1 200 OK
1408
+ Content-Type: application/a2a+json
1409
+
1410
+ {
1411
+ "task": {
1412
+ "id": "task-uuid",
1413
+ "status": {
1414
+ "state": "TASK_STATE_INPUT_REQUIRED",
1415
+ "message": {
1416
+ "role": "ROLE_AGENT",
1417
+ "parts": [{"text": "I need more details. Where would you like to fly from and to?"}]
1418
+ }
1419
+ }
1420
+ }
1421
+ }
1422
+ ```
1423
+
1424
+ **Follow-up Request:**
1425
+
1426
+ ```http
1427
+ POST /message:send HTTP/1.1
1428
+ Host: agent.example.com
1429
+ Content-Type: application/a2a+json
1430
+ Authorization: Bearer token
1431
+
1432
+ {
1433
+ "message": {
1434
+ "taskId": "task-uuid",
1435
+ "role": "ROLE_USER",
1436
+ "parts": [{"text": "From San Francisco to New York"}],
1437
+ "messageId": "msg-2"
1438
+ }
1439
+ }
1440
+ ```
1441
+
1442
+ ### 6.4. Version Negotiation Error
1443
+
1444
+ **Scenario:** Client requests an unsupported protocol version.
1445
+
1446
+ **Request:**
1447
+
1448
+ ```http
1449
+ POST /message:send HTTP/1.1
1450
+ Host: agent.example.com
1451
+ Content-Type: application/a2a+json
1452
+ Authorization: Bearer token
1453
+ A2A-Version: 0.5
1454
+
1455
+ {
1456
+ "message": {
1457
+ "role": "ROLE_USER",
1458
+ "parts": [{"text": "Hello"}],
1459
+ "messageId": "msg-uuid"
1460
+ }
1461
+ }
1462
+ ```
1463
+
1464
+ **Response:**
1465
+
1466
+ ```http
1467
+ HTTP/1.1 400 Bad Request
1468
+ Content-Type: application/problem+json
1469
+
1470
+ {
1471
+ "type": "https://a2a-protocol.org/errors/version-not-supported",
1472
+ "title": "Protocol Version Not Supported",
1473
+ "status": 400,
1474
+ "detail": "The requested A2A protocol version 0.5 is not supported by this agent",
1475
+ "supportedVersions": ["0.3"]
1476
+ }
1477
+ ```
1478
+
1479
+ ### 6.5. Task Listing and Management
1480
+
1481
+ **Scenario:** Client wants to see all tasks from a specific context or all tasks with a particular status.
1482
+
1483
+ #### Request: All tasks from a specific context
1484
+
1485
+ **Request:**
1486
+
1487
+ ```http
1488
+ GET /tasks?contextId=c295ea44-7543-4f78-b524-7a38915ad6e4&pageSize=10&historyLength=3 HTTP/1.1
1489
+ Host: agent.example.com
1490
+ Authorization: Bearer token
1491
+ ```
1492
+
1493
+ **Response:**
1494
+
1495
+ ```http
1496
+ HTTP/1.1 200 OK
1497
+ Content-Type: application/a2a+json
1498
+
1499
+ {
1500
+ "tasks": [
1501
+ {
1502
+ "id": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1503
+ "contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1504
+ "status": {
1505
+ "state": "TASK_STATE_COMPLETED",
1506
+ "timestamp": "2024-03-15T10:15:00Z"
1507
+ }
1508
+ }
1509
+ ],
1510
+ "totalSize": 5,
1511
+ "pageSize": 10,
1512
+ "nextPageToken": ""
1513
+ }
1514
+ ```
1515
+
1516
+ #### Request: All working tasks across all contexts
1517
+
1518
+ **Request:**
1519
+
1520
+ ```http
1521
+ GET /tasks?status=TASK_STATE_WORKING&pageSize=20 HTTP/1.1
1522
+ Host: agent.example.com
1523
+ Authorization: Bearer token
1524
+ ```
1525
+
1526
+ **Response:**
1527
+
1528
+ ```http
1529
+ HTTP/1.1 200 OK
1530
+ Content-Type: application/a2a+json
1531
+
1532
+ {
1533
+ "tasks": [
1534
+ {
1535
+ "id": "789abc-def0-1234-5678-9abcdef01234",
1536
+ "contextId": "another-context-id",
1537
+ "status": {
1538
+ "state": "TASK_STATE_WORKING",
1539
+ "message": {
1540
+ "role": "ROLE_AGENT",
1541
+ "parts": [
1542
+ {
1543
+ "text": "Processing your document analysis..."
1544
+ }
1545
+ ],
1546
+ "messageId": "msg-status-update"
1547
+ },
1548
+ "timestamp": "2024-03-15T10:20:00Z"
1549
+ }
1550
+ }
1551
+ ],
1552
+ "totalSize": 1,
1553
+ "pageSize": 20,
1554
+ "nextPageToken": ""
1555
+ }
1556
+ ```
1557
+
1558
+ #### Pagination Example
1559
+
1560
+ **Request:**
1561
+
1562
+ ```http
1563
+ GET /tasks?contextId=c295ea44-7543-4f78-b524-7a38915ad6e4&pageSize=10&pageToken=base64-encoded-cursor-token HTTP/1.1
1564
+ Host: agent.example.com
1565
+ Authorization: Bearer token
1566
+ ```
1567
+
1568
+ **Response:**
1569
+
1570
+ ```http
1571
+ HTTP/1.1 200 OK
1572
+ Content-Type: application/a2a+json
1573
+
1574
+ {
1575
+ "tasks": [
1576
+ /* ... additional tasks */
1577
+ ],
1578
+ "totalSize": 15,
1579
+ "pageSize": 10,
1580
+ "nextPageToken": "base64-encoded-next-cursor-token"
1581
+ }
1582
+ ```
1583
+
1584
+ #### Validation Error Example
1585
+
1586
+ **Request:**
1587
+
1588
+ ```http
1589
+ GET /tasks?pageSize=150&historyLength=-5&status=TASK_STATE_RUNNING HTTP/1.1
1590
+ Host: agent.example.com
1591
+ Authorization: Bearer token
1592
+ ```
1593
+
1594
+ **Response:**
1595
+
1596
+ ```http
1597
+ HTTP/1.1 400 Bad Request
1598
+ Content-Type: application/problem+json
1599
+
1600
+ {
1601
+ "status": 400,
1602
+ "detail": "Invalid parameters",
1603
+ "errors": [
1604
+ {
1605
+ "field": "pageSize",
1606
+ "message": "Must be between 1 and 100 inclusive, got 150"
1607
+ },
1608
+ {
1609
+ "field": "historyLength",
1610
+ "message": "Must be non-negative integer, got -5"
1611
+ },
1612
+ {
1613
+ "field": "status",
1614
+ "message": "Invalid status value 'running'. Must be one of: pending, working, completed, failed, canceled"
1615
+ }
1616
+ ]
1617
+ }
1618
+ ```
1619
+
1620
+ ### 6.6. Push Notification Setup and Usage
1621
+
1622
+ **Scenario:** Client requests a long-running report generation and wants to be notified via webhook when it's done.
1623
+
1624
+ **Initial Request with Push Notification Config:**
1625
+
1626
+ ```http
1627
+ POST /message:send HTTP/1.1
1628
+ Host: agent.example.com
1629
+ Content-Type: application/a2a+json
1630
+ Authorization: Bearer token
1631
+
1632
+ {
1633
+ "message": {
1634
+ "role": "ROLE_USER",
1635
+ "parts": [
1636
+ {
1637
+ "text": "Generate the Q1 sales report. This usually takes a while. Notify me when it's ready."
1638
+ }
1639
+ ],
1640
+ "messageId": "6dbc13b5-bd57-4c2b-b503-24e381b6c8d6"
1641
+ },
1642
+ "configuration": {
1643
+ "pushNotificationConfig": {
1644
+ "url": "https://client.example.com/webhook/a2a-notifications",
1645
+ "token": "secure-client-token-for-task-aaa",
1646
+ "authentication": {
1647
+ "schemes": ["Bearer"]
1648
+ }
1649
+ }
1650
+ }
1651
+ }
1652
+ ```
1653
+
1654
+ **Response (Task Submitted):**
1655
+
1656
+ ```http
1657
+ HTTP/1.1 200 OK
1658
+ Content-Type: application/a2a+json
1659
+
1660
+ {
1661
+ "task": {
1662
+ "id": "43667960-d455-4453-b0cf-1bae4955270d",
1663
+ "contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1664
+ "status": {
1665
+ "state": "submitted",
1666
+ "timestamp": "2024-03-15T11:00:00Z"
1667
+ }
1668
+ }
1669
+ }
1670
+ ```
1671
+
1672
+ **Later: Server POSTs Notification to Webhook:**
1673
+
1674
+ ```http
1675
+ POST /webhook/a2a-notifications HTTP/1.1
1676
+ Host: client.example.com
1677
+ Authorization: Bearer server-generated-jwt
1678
+ Content-Type: application/a2a+json
1679
+ X-A2A-Notification-Token: secure-client-token-for-task-aaa
1680
+
1681
+ {
1682
+ "statusUpdate": {
1683
+ "taskId": "43667960-d455-4453-b0cf-1bae4955270d",
1684
+ "contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1685
+ "status": {
1686
+ "state": "TASK_STATE_COMPLETED",
1687
+ "timestamp": "2024-03-15T18:30:00Z"
1688
+ }
1689
+ }
1690
+ }
1691
+ ```
1692
+
1693
+ ### 6.7. File Exchange (Upload and Download)
1694
+
1695
+ **Scenario:** Client sends an image for analysis, and the agent returns a modified image.
1696
+
1697
+ **Request with File Upload:**
1698
+
1699
+ ```http
1700
+ POST /message:send HTTP/1.1
1701
+ Host: agent.example.com
1702
+ Content-Type: application/a2a+json
1703
+ Authorization: Bearer token
1704
+
1705
+ {
1706
+ "message": {
1707
+ "role": "ROLE_USER",
1708
+ "parts": [
1709
+ {
1710
+ "text": "Analyze this image and highlight any faces."
1711
+ },
1712
+ {
1713
+ "raw": "iVBORw0KGgoAAAANSUhEUgAAAAUA..."
1714
+ "filename": "input_image.png",
1715
+ "mediaType": "image/png",
1716
+ }
1717
+ ],
1718
+ "messageId": "6dbc13b5-bd57-4c2b-b503-24e381b6c8d6"
1719
+ }
1720
+ }
1721
+ ```
1722
+
1723
+ **Response with File Reference:**
1724
+
1725
+ ```http
1726
+ HTTP/1.1 200 OK
1727
+ Content-Type: application/a2a+json
1728
+
1729
+ {
1730
+ "task": {
1731
+ "id": "43667960-d455-4453-b0cf-1bae4955270d",
1732
+ "contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1733
+ "status": {
1734
+ "state": "TASK_STATE_COMPLETED",
1735
+ "timestamp": "2024-03-15T12:05:00Z"
1736
+ },
1737
+ "artifacts": [
1738
+ {
1739
+ "artifactId": "9b6934dd-37e3-4eb1-8766-962efaab63a1",
1740
+ "name": "processed_image_with_faces.png",
1741
+ "parts": [
1742
+ {
1743
+ "url": "https://storage.example.com/processed/task-bbb/output.png?token=xyz",
1744
+ "filename": "output.png",
1745
+ "mediaType": "image/png"
1746
+ }
1747
+ ]
1748
+ }
1749
+ ]
1750
+ }
1751
+ }
1752
+ ```
1753
+
1754
+ ### 6.8. Structured Data Exchange
1755
+
1756
+ **Scenario:** Client asks for a list of open support tickets in a specific JSON format.
1757
+
1758
+ **Request:**
1759
+
1760
+ ```http
1761
+ POST /message:send HTTP/1.1
1762
+ Host: agent.example.com
1763
+ Content-Type: application/a2a+json
1764
+ Authorization: Bearer token
1765
+
1766
+ {
1767
+ "message": {
1768
+ "role": "ROLE_USER",
1769
+ "parts": [
1770
+ {
1771
+ "text": "Show me a list of my open IT tickets",
1772
+ "metadata": {
1773
+ "mediaType": "application/json",
1774
+ "schema": {
1775
+ "type": "array",
1776
+ "items": {
1777
+ "type": "object",
1778
+ "properties": {
1779
+ "ticketNumber": { "type": "string" },
1780
+ "description": { "type": "string" }
1781
+ }
1782
+ }
1783
+ }
1784
+ }
1785
+ }
1786
+ ],
1787
+ "messageId": "85b26db5-ffbb-4278-a5da-a7b09dea1b47"
1788
+ }
1789
+ }
1790
+ ```
1791
+
1792
+ **Response with Structured Data:**
1793
+
1794
+ ```http
1795
+ HTTP/1.1 200 OK
1796
+ Content-Type: application/a2a+json
1797
+
1798
+ {
1799
+ "task": {
1800
+ "id": "d8c6243f-5f7a-4f6f-821d-957ce51e856c",
1801
+ "contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1802
+ "status": {
1803
+ "state": "TASK_STATE_COMPLETED",
1804
+ "timestamp": "2025-04-17T17:47:09.680794Z"
1805
+ },
1806
+ "artifacts": [
1807
+ {
1808
+ "artifactId": "c5e0382f-b57f-4da7-87d8-b85171fad17c",
1809
+ "parts": [
1810
+ {
1811
+ "text": "[{\"ticketNumber\":\"REQ12312\",\"description\":\"request for VPN access\"},{\"ticketNumber\":\"REQ23422\",\"description\":\"Add to DL - team-gcp-onboarding\"}]"
1812
+ }
1813
+ ]
1814
+ }
1815
+ ]
1816
+ }
1817
+ }
1818
+ ```
1819
+
1820
+ ### 6.9. Fetching Authenticated Extended Agent Card
1821
+
1822
+ **Scenario:** A client discovers a public Agent Card indicating support for an authenticated extended card and wants to retrieve the full details.
1823
+
1824
+ **Step 1: Client fetches the public Agent Card:**
1825
+
1826
+ ```http
1827
+ GET /.well-known/agent-card.json HTTP/1.1
1828
+ Host: example.com
1829
+ ```
1830
+
1831
+ **Response includes:**
1832
+
1833
+ ```json
1834
+ {
1835
+ "capabilities": {
1836
+ "extendedAgentCard": true
1837
+ },
1838
+ "securitySchemes": {
1839
+ "google": {
1840
+ "openIdConnectSecurityScheme": {
1841
+ "openIdConnectUrl": "https://accounts.google.com/.well-known/openid-configuration"
1842
+ }
1843
+ }
1844
+ }
1845
+ }
1846
+ ```
1847
+
1848
+ ### Step 2: Client obtains credentials (out-of-band OAuth 2.0 flow)
1849
+
1850
+ ### Step 3: Client fetches authenticated extended Agent Card
1851
+
1852
+ ```http
1853
+ GET /extendedAgentCard HTTP/1.1
1854
+ Host: agent.example.com
1855
+ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
1856
+ ```
1857
+
1858
+ **Response:**
1859
+
1860
+ ```http
1861
+ HTTP/1.1 200 OK
1862
+ Content-Type: application/a2a+json
1863
+
1864
+ {
1865
+ "name": "Extended Agent with Additional Skills",
1866
+ "skills": [
1867
+ /* Extended skills available to authenticated users */
1868
+ ]
1869
+ }
1870
+ ```
1871
+
1872
+ ## 7. Authentication and Authorization
1873
+
1874
+ A2A treats agents as standard enterprise applications, relying on established web security practices. Identity information is handled at the protocol layer, not within A2A semantics.
1875
+
1876
+ For a comprehensive guide on enterprise security aspects, see [Enterprise-Ready Features](./topics/enterprise-ready.md).
1877
+
1878
+ ### 7.1. Protocol Security
1879
+
1880
+ Production deployments **MUST** use encrypted communication (HTTPS for HTTP-based bindings, TLS for gRPC). Implementations **SHOULD** use modern TLS configurations (TLS 1.3+ recommended) with strong cipher suites.
1881
+
1882
+ ### 7.2. Server Identity Verification
1883
+
1884
+ A2A Clients **SHOULD** verify the A2A Server's identity by validating its TLS certificate against trusted certificate authorities (CAs) during the TLS handshake.
1885
+
1886
+ ### 7.3. Client Authentication Process
1887
+
1888
+ 1. **Discovery of Requirements:** The client discovers the server's required authentication schemes via the `securitySchemes` field in the AgentCard.
1889
+ 2. **Credential Acquisition (Out-of-Band):** The client obtains the necessary credentials through an out-of-band process specific to the required authentication scheme.
1890
+ 3. **Credential Transmission:** The client includes these credentials in protocol-appropriate headers or metadata for every A2A request.
1891
+
1892
+ ### 7.4. Server Authentication Responsibilities
1893
+
1894
+ The A2A Server:
1895
+
1896
+ - **MUST** authenticate every incoming request based on the provided credentials and its declared authentication requirements.
1897
+ - **SHOULD** use appropriate binding-specific error codes for authentication challenges or rejections.
1898
+ - **SHOULD** provide relevant authentication challenge information with error responses.
1899
+
1900
+ ### 7.5. Server Authorization Responsibilities
1901
+
1902
+ Once authenticated, the A2A Server authorizes requests based on the authenticated identity and its own policies. Authorization logic is implementation-specific and **MAY** consider:
1903
+
1904
+ - Specific skills requested
1905
+ - Actions attempted within tasks
1906
+ - Data access policies
1907
+ - OAuth scopes (if applicable)
1908
+
1909
+ ### 7.6. In-Task Authorization
1910
+
1911
+ In the course of performing a task, an agent may require authorization to perform some action. Examples include:
1912
+
1913
+ - An agent requiring an OAuth access token to call an API or another agent
1914
+ - An agent requiring human approval before a destructive action is taken
1915
+
1916
+ In the sections below, we refer to the object that represents the approved authorization as a credential.
1917
+
1918
+ Agents may have multiple means for retrieving this authorization, such as via directly sending messages to a human.
1919
+
1920
+ A2A provides the capability for agents to delegate the fulfillment of this authorization to the client via the `TASK_STATE_AUTH_REQUIRED` Task state. This provides agents a fallback path for requesting authorization by passing the responsibility to the client.
1921
+
1922
+ #### 7.6.1 In-Task Authorization Agent Responsibilities
1923
+
1924
+ To request that a client fulfills an authorization request, the agent:
1925
+
1926
+ 1. MUST use a Task to track the operation it is performing
1927
+ 2. MUST transition the TaskState to `TASK_STATE_AUTH_REQUIRED`
1928
+ 3. MUST include a TaskStatus message explaining the required authorization, unless the details of the authorization have been negotiated out-of-band or via an extension
1929
+
1930
+ Agents MUST arrange to receive credentials via an out-of-band means, unless an in-band mechanism has been negotiated out-of-band or via an extension.
1931
+
1932
+ If the credential is received out-of-band, the agent SHOULD maintain any active response streams with the client after setting the TaskState to `TASK_STATE_AUTH_REQUIRED`. The agent MAY immediately continue Task processing after receiving the credential, without a requirement that clients send a follow-up message.
1933
+
1934
+ Agents SHOULD support receiving messages directed to the Task while the Task remains in `TASK_STATE_AUTH_REQUIRED`. This enables clients to negotiate, correct, or reject an authorization request.
1935
+
1936
+ #### 7.6.2 In-Task Authorization Client Responsibilities
1937
+
1938
+ Upon receiving a Task in `TASK_STATE_AUTH_REQUIRED`, a client is expected to take action in some way to resolve the agent's request for authorization.
1939
+
1940
+ A client may:
1941
+
1942
+ - Send a response message to the Task to negotiate, correct, or reject the authorization request.
1943
+ - Contact another human, agent, or service to fulfill the authorization request
1944
+ - Directly fulfill the authorization request via an out-of-band or extension negotiated means
1945
+
1946
+ If the client is itself an A2A agent actively processing a Task, the client may further delegate the authorization request to its client by transitioning its own Task to `TASK_STATE_AUTH_REQUIRED`. The client SHOULD follow all [In-Task Authorization Agent Responsibilities](#761-in-task-authorization-agent-responsibilities). This enables forming a chain of Tasks in `TASK_STATE_AUTH_REQUIRED`.
1947
+
1948
+ Clients may not be aware of when the agent receives credentials out-of-band and subsequently continues Task processing. If a client does not have an active response stream open with the agent, the client risks missing Task updates. To avoid this, a client SHOULD perform one of the following:
1949
+
1950
+ - Subscribe to a stream of events for the Task using the [Subscribe to Task](#316-subscribe-to-task) operation
1951
+ - Register a webhook to receive events, if supported by the agent, using the [Create Push Notification Config](#317-create-push-notification-config) operation
1952
+ - Begin polling the Task using the [Get Task](#313-get-task) operation
1953
+
1954
+ #### 7.6.3 In-Task Authorization Security Considerations
1955
+
1956
+ Agents SHOULD receive credentials for in-task authorization requests out of band via a secure channel, such as HTTPS. This ensures that credentials are provided directly to the agent.
1957
+
1958
+ In-band credential exchange may be negotiated via out-of-band means or by using extensions. In-band credential exchange can allow credentials to be passed across chains of multiple A2A agents, exposing those credentials to each agent participating in the chain.
1959
+
1960
+ If using in-band credential exchange, we recommend adhering to the following security practices:
1961
+
1962
+ - Credentials SHOULD be bound to the agent which originated the request, such that only this agent is able to use the credentials. This ensures that credentials propagating through a chain of A2A requests are only usable by the requesting agent.
1963
+ - Credentials containing sensitive information SHOULD be only readable by the agent which originated the request, such as by encrypting the credential.
1964
+
1965
+ ## 8. Agent Discovery: The Agent Card
1966
+
1967
+ <span id="5-agent-discovery-the-agent-card"></span>
1968
+
1969
+ ### 8.1. Purpose
1970
+
1971
+ A2A Servers **MUST** make an Agent Card available. The Agent Card describes the server's identity, capabilities, skills, and interaction requirements. Clients use this information for discovering suitable agents and configuring interactions.
1972
+
1973
+ For more on discovery strategies, see the [Agent Discovery guide](./topics/agent-discovery.md).
1974
+
1975
+ ### 8.2. Discovery Mechanisms
1976
+
1977
+ Clients can find Agent Cards through:
1978
+
1979
+ - **Well-Known URI:** Accessing `https://{server_domain}/.well-known/agent-card.json` (see [Section 8.6](#86-caching) for caching guidance)
1980
+ - **Registries/Catalogs:** Querying curated catalogs of agents
1981
+ - **Direct Configuration:** Pre-configured Agent Card URLs or content
1982
+
1983
+ ### 8.3. Protocol Declaration Requirements
1984
+
1985
+ The AgentCard **MUST** properly declare supported protocols:
1986
+
1987
+ #### 8.3.1. Supported Interfaces Declaration
1988
+
1989
+ - The `supportedInterfaces` field **SHOULD** declare all supported protocol combinations in preference order
1990
+ - The first entry in `supportedInterfaces` represents the preferred interface
1991
+ - Each interface **MUST** accurately declare its transport protocol and URL
1992
+ - URLs **MAY** be reused if multiple transports are available at the same endpoint
1993
+
1994
+ #### 8.3.2. Client Protocol Selection
1995
+
1996
+ Clients **MUST** follow these rules:
1997
+
1998
+ 1. Parse `supportedInterfaces` if present, and select the first supported transport
1999
+ 2. Prefer earlier entries in the ordered list when multiple options are supported
2000
+ 3. Use the correct URL for the selected transport
2001
+
2002
+ ### 8.4. Agent Card Signing
2003
+
2004
+ Agent Cards **MAY** be digitally signed using JSON Web Signature (JWS) as defined in [RFC 7515](https://tools.ietf.org/html/rfc7515) to ensure authenticity and integrity. Signatures allow clients to verify that an Agent Card has not been tampered with and originates from the claimed provider.
2005
+
2006
+ #### 8.4.1. Canonicalization Requirements
2007
+
2008
+ Before signing, the Agent Card content **MUST** be canonicalized using the JSON Canonicalization Scheme (JCS) as defined in [RFC 8785](https://tools.ietf.org/html/rfc8785). This ensures consistent signature generation and verification across different JSON implementations.
2009
+
2010
+ **Canonicalization Rules:**
2011
+
2012
+ 1. **Field Presence and Default Value Handling**: Before canonicalization, the JSON representation **MUST** respect Protocol Buffer field presence semantics as defined in [Section 5.7](#57-field-presence-and-optionality). This ensures that the canonical form accurately reflects which fields were explicitly provided versus which were omitted, enabling signature verification when Agent Cards are reconstructed:
2013
+ - **Optional fields not explicitly set**: Fields marked with the `optional` keyword that were not explicitly set **MUST** be omitted from the JSON object
2014
+ - **Optional fields explicitly set to defaults**: Fields marked with `optional` that were explicitly set to a value (even if that value matches a default) **MUST** be included in the JSON object
2015
+ - **Required fields**: Fields marked with `REQUIRED` **MUST** always be present, even if the field value matches the default.
2016
+ - **Default values**: Fields with default values **MUST** be omitted unless the field is marked as `REQUIRED` or has the `optional` keyword.
2017
+
2018
+ 2. **RFC 8785 Compliance**: The Agent Card JSON **MUST** be canonicalized according to RFC 8785, which specifies:
2019
+ - Predictable ordering of object properties (lexicographic by key)
2020
+ - Consistent representation of numbers, strings, and other primitive values
2021
+ - Removal of insignificant whitespace
2022
+
2023
+ 3. **Signature Field Exclusion**: The `signatures` field itself **MUST** be excluded from the content being signed to avoid circular dependencies.
2024
+
2025
+ **Example of Default Value Removal:**
2026
+
2027
+ Original Agent Card fragment:
2028
+
2029
+ ```json
2030
+ {
2031
+ "name": "Example Agent",
2032
+ "description": "",
2033
+ "capabilities": {
2034
+ "streaming": false,
2035
+ "pushNotifications": false,
2036
+ "extensions": []
2037
+ },
2038
+ "skills": []
2039
+ }
2040
+ ```
2041
+
2042
+ Applying the canonicalization rules:
2043
+
2044
+ - `name`: "Example Agent" - REQUIRED field → **include**
2045
+ - `description`: "" - REQUIRED field → **include**
2046
+ - `capabilities`: object - REQUIRED field → **include** (after processing children)
2047
+ - `streaming`: false - optional field, present in JSON (explicitly set) → **include**
2048
+ - `pushNotifications`: false - optional field, present in JSON (explicitly set) → **include**
2049
+ - `extensions`: [] - repeated field (not REQUIRED) with empty array → **omit**
2050
+ - `skills`: [] - REQUIRED field → **include**
2051
+
2052
+ After applying RFC 8785:
2053
+
2054
+ ```json
2055
+ {"capabilities":{"pushNotifications":false,"streaming":false},"description":"","name":"Example Agent","skills":[]}
2056
+ ```
2057
+
2058
+ #### 8.4.2. Signature Format
2059
+
2060
+ Signatures use the JSON Web Signature (JWS) format as defined in [RFC 7515](https://tools.ietf.org/html/rfc7515). The [`AgentCardSignature`](#447-agentcardsignature) object represents JWS components using three fields:
2061
+
2062
+ - **`protected`** (required, string): Base64url-encoded JSON object containing the JWS Protected Header
2063
+ - **`signature`** (required, string): Base64url-encoded signature value
2064
+ - **`header`** (optional, object): JWS Unprotected Header as a JSON object (not base64url-encoded)
2065
+
2066
+ **JWS Protected Header Parameters:**
2067
+
2068
+ The protected header **MUST** include:
2069
+
2070
+ - `alg`: Algorithm used for signing (e.g., "ES256", "RS256")
2071
+ - `typ`: **SHOULD** be set to "JOSE" for JWS
2072
+ - `kid`: Key ID for identifying the signing key
2073
+
2074
+ The protected header **MAY** include:
2075
+
2076
+ - `jku`: URL to JSON Web Key Set (JWKS) containing the public key
2077
+
2078
+ **Signature Generation Process:**
2079
+
2080
+ 1. **Prepare the payload:**
2081
+ - Remove properties with default values from the Agent Card
2082
+ - Exclude the `signatures` field
2083
+ - Canonicalize the resulting JSON using RFC 8785 to produce the canonical payload
2084
+
2085
+ 2. **Create the protected header:**
2086
+ - Construct a JSON object with the required header parameters (`alg`, `typ`, `kid`) and any optional parameters (`jku`)
2087
+ - Serialize the header to JSON
2088
+ - Base64url-encode the serialized header to produce the `protected` field value
2089
+
2090
+ 3. **Compute the signature:**
2091
+ - Construct the JWS Signing Input: `ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || BASE64URL(JWS Payload))`
2092
+ - Sign the JWS Signing Input using the algorithm specified in the `alg` header parameter and the private key
2093
+ - Base64url-encode the resulting signature bytes to produce the `signature` field value
2094
+
2095
+ 4. **Assemble the AgentCardSignature:**
2096
+ - Set `protected` to the base64url-encoded protected header from step 2
2097
+ - Set `signature` to the base64url-encoded signature value from step 3
2098
+ - Optionally set `header` to a JSON object containing any unprotected header parameters.
2099
+
2100
+ **Example:**
2101
+
2102
+ Given a canonical Agent Card payload and signing key, the signature generation produces:
2103
+
2104
+ ```json
2105
+ {
2106
+ "protected": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpPU0UiLCJraWQiOiJrZXktMSIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vYWdlbnQvandrcy5qc29uIn0",
2107
+ "signature": "QFdkNLNszlGj3z3u0YQGt_T9LixY3qtdQpZmsTdDHDe3fXV9y9-B3m2-XgCpzuhiLt8E0tV6HXoZKHv4GtHgKQ"
2108
+ }
2109
+ ```
2110
+
2111
+ Where the `protected` value decodes to:
2112
+
2113
+ ```json
2114
+ {"alg":"ES256","typ":"JOSE","kid":"key-1","jku":"https://example.com/agent/jwks.json"}
2115
+ ```
2116
+
2117
+ #### 8.4.3. Signature Verification
2118
+
2119
+ Clients verifying Agent Card signatures **MUST**:
2120
+
2121
+ 1. Extract the signature from the `signatures` array
2122
+ 2. Retrieve the public key using the `kid` and `jku` (or from a trusted key store)
2123
+ 3. Remove properties with default values from the received Agent Card
2124
+ 4. Exclude the `signatures` field
2125
+ 5. Canonicalize the resulting JSON using RFC 8785
2126
+ 6. Verify the signature against the canonicalized payload
2127
+
2128
+ **Security Considerations:**
2129
+
2130
+ - Clients **SHOULD** verify at least one signature before trusting an Agent Card
2131
+ - Public keys **SHOULD** be retrieved over secure channels (HTTPS)
2132
+ - Clients **MAY** maintain a trusted key store for known agent providers
2133
+ - Expired or revoked keys **MUST NOT** be used for verification
2134
+ - Multiple signatures **MAY** be present to support key rotation
2135
+
2136
+ ### 8.5. Sample Agent Card
2137
+
2138
+ ```json
2139
+ {
2140
+ "name": "GeoSpatial Route Planner Agent",
2141
+ "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.",
2142
+ "supportedInterfaces": [
2143
+ {"url": "https://georoute-agent.example.com/a2a/v1", "protocolBinding": "JSONRPC", "protocolVersion": "1.0"},
2144
+ {"url": "https://georoute-agent.example.com/a2a/grpc", "protocolBinding": "GRPC", "protocolVersion": "1.0"},
2145
+ {"url": "https://georoute-agent.example.com/a2a/json", "protocolBinding": "HTTP+JSON", "protocolVersion": "1.0"}
2146
+ ],
2147
+ "provider": {
2148
+ "organization": "Example Geo Services Inc.",
2149
+ "url": "https://www.examplegeoservices.com"
2150
+ },
2151
+ "iconUrl": "https://georoute-agent.example.com/icon.png",
2152
+ "version": "1.2.0",
2153
+ "documentationUrl": "https://docs.examplegeoservices.com/georoute-agent/api",
2154
+ "capabilities": {
2155
+ "streaming": true,
2156
+ "pushNotifications": true,
2157
+ "stateTransitionHistory": false,
2158
+ "extendedAgentCard": true
2159
+ },
2160
+ "securitySchemes": {
2161
+ "google": {
2162
+ "openIdConnectSecurityScheme": {
2163
+ "openIdConnectUrl": "https://accounts.google.com/.well-known/openid-configuration"
2164
+ }
2165
+ }
2166
+ },
2167
+ "security": [{ "google": ["openid", "profile", "email"] }],
2168
+ "defaultInputModes": ["application/json", "text/plain"],
2169
+ "defaultOutputModes": ["application/json", "image/png"],
2170
+ "skills": [
2171
+ {
2172
+ "id": "route-optimizer-traffic",
2173
+ "name": "Traffic-Aware Route Optimizer",
2174
+ "description": "Calculates the optimal driving route between two or more locations, taking into account real-time traffic conditions, road closures, and user preferences (e.g., avoid tolls, prefer highways).",
2175
+ "tags": ["maps", "routing", "navigation", "directions", "traffic"],
2176
+ "examples": [
2177
+ "Plan a route from '1600 Amphitheatre Parkway, Mountain View, CA' to 'San Francisco International Airport' avoiding tolls.",
2178
+ "{\"origin\": {\"lat\": 37.422, \"lng\": -122.084}, \"destination\": {\"lat\": 37.7749, \"lng\": -122.4194}, \"preferences\": [\"avoid_ferries\"]}"
2179
+ ],
2180
+ "inputModes": ["application/json", "text/plain"],
2181
+ "outputModes": [
2182
+ "application/json",
2183
+ "application/vnd.geo+json",
2184
+ "text/html"
2185
+ ]
2186
+ },
2187
+ {
2188
+ "id": "custom-map-generator",
2189
+ "name": "Personalized Map Generator",
2190
+ "description": "Creates custom map images or interactive map views based on user-defined points of interest, routes, and style preferences. Can overlay data layers.",
2191
+ "tags": ["maps", "customization", "visualization", "cartography"],
2192
+ "examples": [
2193
+ "Generate a map of my upcoming road trip with all planned stops highlighted.",
2194
+ "Show me a map visualizing all coffee shops within a 1-mile radius of my current location."
2195
+ ],
2196
+ "inputModes": ["application/json"],
2197
+ "outputModes": [
2198
+ "image/png",
2199
+ "image/jpeg",
2200
+ "application/json",
2201
+ "text/html"
2202
+ ]
2203
+ }
2204
+ ],
2205
+ "signatures": [
2206
+ {
2207
+ "protected": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpPU0UiLCJraWQiOiJrZXktMSIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vYWdlbnQvandrcy5qc29uIn0",
2208
+ "signature": "QFdkNLNszlGj3z3u0YQGt_T9LixY3qtdQpZmsTdDHDe3fXV9y9-B3m2-XgCpzuhiLt8E0tV6HXoZKHv4GtHgKQ"
2209
+ }
2210
+ ]
2211
+ }
2212
+ ```
2213
+
2214
+ ### 8.6. Caching
2215
+
2216
+ Agent Card content changes infrequently relative to the frequency at which clients may fetch it. Servers and clients **SHOULD** use standard HTTP caching mechanisms to reduce unnecessary network overhead.
2217
+
2218
+ #### 8.6.1. Server Requirements
2219
+
2220
+ - Agent Card HTTP endpoints **SHOULD** include a `Cache-Control` response header with a `max-age` directive appropriate for the agent's expected update frequency
2221
+ - Agent Card HTTP endpoints **SHOULD** include an `ETag` response header derived from the Agent Card's `version` field or a hash of the card content
2222
+ - Agent Card HTTP endpoints **MAY** include a `Last-Modified` response header
2223
+
2224
+ #### 8.6.2. Client Requirements
2225
+
2226
+ - Clients **SHOULD** honor HTTP caching semantics as defined in [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111) when fetching Agent Cards
2227
+ - When a cached Agent Card has expired, clients **SHOULD** use conditional requests (`If-None-Match` with the stored `ETag`, or `If-Modified-Since`) to avoid re-downloading unchanged cards
2228
+ - When the server does not include caching headers, clients **MAY** apply an implementation-specific default cache duration
2229
+
2230
+ ## 9. JSON-RPC Protocol Binding
2231
+
2232
+ The JSON-RPC protocol binding provides a simple, HTTP-based interface using JSON-RPC 2.0 for method calls and Server-Sent Events for streaming.
2233
+
2234
+ ### 9.1. Protocol Requirements
2235
+
2236
+ - **Protocol:** JSON-RPC 2.0 over HTTP(S)
2237
+ - **Content-Type:** `application/json` for requests and responses
2238
+ - **Method Naming:** PascalCase method names matching gRPC conventions (e.g., `SendMessage`, `GetTask`)
2239
+ - **Streaming:** Server-Sent Events (`text/event-stream`)
2240
+
2241
+ ### 9.2. Service Parameter Transmission
2242
+
2243
+ A2A service parameters defined in [Section 3.2.6](#326-service-parameters) **MUST** be transmitted using standard HTTP request headers, as JSON-RPC 2.0 operates over HTTP(S).
2244
+
2245
+ **Service Parameter Requirements:**
2246
+
2247
+ - Service parameter names **MUST** be transmitted as HTTP header fields
2248
+ - Service parameter keys are case-insensitive per HTTP specification (RFC 7230)
2249
+ - Multiple values for the same service parameter (e.g., `A2A-Extensions`) **SHOULD** be comma-separated in a single header field
2250
+
2251
+ **Example Request with A2A Service Parameters:**
2252
+
2253
+ ```http
2254
+ POST /rpc HTTP/1.1
2255
+ Host: agent.example.com
2256
+ Content-Type: application/json
2257
+ Authorization: Bearer token
2258
+ A2A-Version: 0.3
2259
+ A2A-Extensions: https://example.com/extensions/geolocation/v1,https://standards.org/extensions/citations/v1
2260
+
2261
+ {
2262
+ "jsonrpc": "2.0",
2263
+ "id": 1,
2264
+ "method": "SendMessage",
2265
+ "params": { /* SendMessageRequest */ }
2266
+ }
2267
+ ```
2268
+
2269
+ ### 9.3. Base Request Structure
2270
+
2271
+ All JSON-RPC requests **MUST** follow the standard JSON-RPC 2.0 format:
2272
+
2273
+ ```json
2274
+ {
2275
+ "jsonrpc": "2.0",
2276
+ "id": "unique-request-id",
2277
+ "method": "category/action",
2278
+ "params": { /* method-specific parameters */ }
2279
+ }
2280
+ ```
2281
+
2282
+ ### 9.4. Core Methods
2283
+
2284
+ #### 9.4.1. `SendMessage`
2285
+
2286
+ Sends a message to initiate or continue a task.
2287
+
2288
+ **Request:**
2289
+
2290
+ ```json
2291
+ {
2292
+ "jsonrpc": "2.0",
2293
+ "id": 1,
2294
+ "method": "SendMessage",
2295
+ "params": { /* SendMessageRequest object */ }
2296
+ }
2297
+ ```
2298
+
2299
+ **Referenced Objects:** [`SendMessageRequest`](#321-sendmessagerequest), [`Message`](#414-message)
2300
+
2301
+ **Response:**
2302
+
2303
+ ```json
2304
+ {
2305
+ "jsonrpc": "2.0",
2306
+ "id": 1,
2307
+ "result": {
2308
+ /* SendMessageResponse object, contains one of:
2309
+ * "task": { Task object }
2310
+ * "message": { Message object }
2311
+ */
2312
+ }
2313
+ ```
2314
+
2315
+ **Referenced Objects:** [`Task`](#411-task), [`Message`](#414-message)
2316
+
2317
+ #### 9.4.2. `SendStreamingMessage`
2318
+
2319
+ Sends a message and subscribes to real-time updates via Server-Sent Events.
2320
+
2321
+ **Request:** Same as `SendMessage`
2322
+
2323
+ **Response:** HTTP 200 with `Content-Type: text/event-stream`
2324
+
2325
+ ```text
2326
+ data: {"jsonrpc": "2.0", "id": 1, "result": { /* StreamResponse object */ }}
2327
+
2328
+ data: {"jsonrpc": "2.0", "id": 1, "result": { /* StreamResponse object */ }}
2329
+ ```
2330
+
2331
+ **Referenced Objects:** [`StreamResponse`](#323-stream-response)
2332
+
2333
+ #### 9.4.3. `GetTask`
2334
+
2335
+ Retrieves the current state of a task.
2336
+
2337
+ **Request:**
2338
+
2339
+ ```json
2340
+ {
2341
+ "jsonrpc": "2.0",
2342
+ "id": 2,
2343
+ "method": "GetTask",
2344
+ "params": {
2345
+ "id": "task-uuid",
2346
+ "historyLength": 10
2347
+ }
2348
+ }
2349
+ ```
2350
+
2351
+ #### 9.4.4. `ListTasks`
2352
+
2353
+ Lists tasks with optional filtering and pagination.
2354
+
2355
+ **Request:**
2356
+
2357
+ ```json
2358
+ {
2359
+ "jsonrpc": "2.0",
2360
+ "id": 3,
2361
+ "method": "ListTasks",
2362
+ "params": {
2363
+ "contextId": "context-uuid",
2364
+ "status": "TASK_STATE_WORKING",
2365
+ "pageSize": 50,
2366
+ "pageToken": "cursor-token"
2367
+ }
2368
+ }
2369
+ ```
2370
+
2371
+ #### 9.4.5. `CancelTask`
2372
+
2373
+ Cancels an ongoing task.
2374
+
2375
+ **Request:**
2376
+
2377
+ ```json
2378
+ {
2379
+ "jsonrpc": "2.0",
2380
+ "id": 4,
2381
+ "method": "CancelTask",
2382
+ "params": {
2383
+ "id": "task-uuid"
2384
+ }
2385
+ }
2386
+ ```
2387
+
2388
+ #### 9.4.6. `SubscribeToTask`
2389
+
2390
+ <span id="936-taskssubscribe"></span>
2391
+
2392
+ Subscribes to a task stream for receiving updates on a task that is not in a terminal state.
2393
+
2394
+ **Request:**
2395
+
2396
+ ```json
2397
+ {
2398
+ "jsonrpc": "2.0",
2399
+ "id": 5,
2400
+ "method": "SubscribeToTask",
2401
+ "params": {
2402
+ "id": "task-uuid"
2403
+ }
2404
+ }
2405
+ ```
2406
+
2407
+ **Response:** SSE stream (same format as `SendStreamingMessage`)
2408
+
2409
+ **Error:** Returns `UnsupportedOperationError` if the task is in a terminal state (`completed`, `failed`, `canceled`, or `rejected`).
2410
+
2411
+ #### 9.4.7. Push Notification Configuration Methods
2412
+
2413
+ - `CreateTaskPushNotificationConfig` - Create push notification configuration
2414
+ - `GetTaskPushNotificationConfig` - Get push notification configuration
2415
+ - `ListTaskPushNotificationConfigs` - List push notification configurations
2416
+ - `DeleteTaskPushNotificationConfig` - Delete push notification configuration
2417
+
2418
+ #### 9.4.8. `GetExtendedAgentCard`
2419
+
2420
+ Retrieves an extended Agent Card.
2421
+
2422
+ **Request:**
2423
+
2424
+ ```json
2425
+ {
2426
+ "jsonrpc": "2.0",
2427
+ "id": 6,
2428
+ "method": "GetExtendedAgentCard"
2429
+ }
2430
+ ```
2431
+
2432
+ ### 9.5. Error Handling
2433
+
2434
+ JSON-RPC error responses use the standard [JSON-RPC 2.0 error object](https://www.jsonrpc.org/specification#error_object) structure, which maps to the generic A2A error model defined in [Section 3.3.2](#332-error-handling) as follows:
2435
+
2436
+ - **Error Code**: Mapped to `error.code` (numeric JSON-RPC error code)
2437
+ - **Error Message**: Mapped to `error.message` (human-readable string)
2438
+ - **Error Details**: Mapped to `error.data` (array of objects, each containing a `@type` key, using ProtoJSON `Any` representation)
2439
+
2440
+ **Standard JSON-RPC Error Codes:**
2441
+
2442
+ | JSON-RPC Error Code | Error Name | Standard Message | Description |
2443
+ | :------------------ | :-------------------- | :--------------------------------- | :------------------------------------------------------ |
2444
+ | `-32700` | `JSONParseError` | "Invalid JSON payload" | The server received invalid JSON |
2445
+ | `-32600` | `InvalidRequestError` | "Request payload validation error" | The JSON sent is not a valid Request object |
2446
+ | `-32601` | `MethodNotFoundError` | "Method not found" | The requested method does not exist or is not available |
2447
+ | `-32602` | `InvalidParamsError` | "Invalid parameters" | The method parameters are invalid |
2448
+ | `-32603` | `InternalError` | "Internal error" | An internal error occurred on the server |
2449
+
2450
+ **A2A-Specific Error Codes:**
2451
+
2452
+ A2A-specific errors use codes in the range `-32001` to `-32099`. For the complete mapping of A2A error types to JSON-RPC error codes, see [Section 5.4 (Error Code Mappings)](#54-error-code-mappings).
2453
+
2454
+ **Error Detail Objects:**
2455
+
2456
+ Each object in the `data` array **MUST** include a `@type` key that identifies the object's type. Implementations **SHOULD** use well-known types such as `google.rpc.ErrorInfo` to refine error reporting, or `google.rpc.BadRequest` to attach structured data to validation errors. Additional error context **MAY** be included as further objects in the `data` array.
2457
+
2458
+ **Error Response Structure:**
2459
+
2460
+ ```json
2461
+ {
2462
+ "jsonrpc": "2.0",
2463
+ "id": 1,
2464
+ "error": {
2465
+ "code": -32602,
2466
+ "message": "Invalid parameters",
2467
+ "data": [
2468
+ {
2469
+ "@type": "type.googleapis.com/google.rpc.BadRequest",
2470
+ "fieldViolations": [
2471
+ {
2472
+ "field": "message.parts",
2473
+ "description": "At least one part is required"
2474
+ }
2475
+ ]
2476
+ }
2477
+ ]
2478
+ }
2479
+ }
2480
+ ```
2481
+
2482
+ **Example A2A-Specific Error Response:**
2483
+
2484
+ ```json
2485
+ {
2486
+ "jsonrpc": "2.0",
2487
+ "id": 2,
2488
+ "error": {
2489
+ "code": -32001,
2490
+ "message": "Task not found",
2491
+ "data": [
2492
+ {
2493
+ "@type": "type.googleapis.com/google.rpc.ErrorInfo",
2494
+ "reason": "TASK_NOT_FOUND",
2495
+ "domain": "a2a-protocol.org",
2496
+ "metadata": {
2497
+ "taskId": "nonexistent-task-id",
2498
+ "timestamp": "2025-11-09T10:30:00.000Z"
2499
+ }
2500
+ }
2501
+ ]
2502
+ }
2503
+ }
2504
+ ```
2505
+
2506
+ ## 10. gRPC Protocol Binding
2507
+
2508
+ The gRPC Protocol Binding provides a high-performance, strongly-typed interface using Protocol Buffers over HTTP/2. The gRPC Protocol Binding leverages the [API guidelines](https://google.aip.dev/general) to simplify gRPC to HTTP mapping.
2509
+
2510
+ ### 10.1. Protocol Requirements
2511
+
2512
+ - **Protocol:** gRPC over HTTP/2 with TLS
2513
+ - **Definition:** Use the normative Protocol Buffers definition in `specification/a2a.proto`
2514
+ - **Serialization:** Protocol Buffers version 3
2515
+ - **Service:** Implement the `A2AService` gRPC service
2516
+
2517
+ ### 10.2. Service Parameter Transmission
2518
+
2519
+ A2A service parameters defined in [Section 3.2.6](#326-service-parameters) **MUST** be transmitted using gRPC metadata (headers).
2520
+
2521
+ **Service Parameter Requirements:**
2522
+
2523
+ - Service parameter names **MUST** be transmitted as gRPC metadata keys
2524
+ - Metadata keys are case-insensitive and automatically converted to lowercase by gRPC
2525
+ - Multiple values for the same service parameter (e.g., `A2A-Extensions`) **SHOULD** be comma-separated in a single metadata entry
2526
+
2527
+ **Example gRPC Request with A2A Service Parameters:**
2528
+
2529
+ ```go
2530
+ // Go example using gRPC metadata
2531
+ md := metadata.Pairs(
2532
+ "authorization", "Bearer token",
2533
+ "a2a-version", "0.3",
2534
+ "a2a-extensions", "https://example.com/extensions/geolocation/v1,https://standards.org/extensions/citations/v1",
2535
+ )
2536
+ ctx := metadata.NewOutgoingContext(context.Background(), md)
2537
+
2538
+ // Make the RPC call with the context containing metadata
2539
+ response, err := client.SendMessage(ctx, request)
2540
+ ```
2541
+
2542
+ **Metadata Handling:**
2543
+
2544
+ - Implementations **MUST** extract A2A service parameters from gRPC metadata for processing
2545
+ - Servers **SHOULD** validate required service parameters (e.g., `A2A-Version`) from metadata
2546
+ - Service parameter keys in metadata are normalized to lowercase per gRPC conventions
2547
+
2548
+ ### 10.3. Service Definition
2549
+
2550
+ {{ proto_service_to_table("A2AService") }}
2551
+
2552
+ ### 10.4. Core Methods
2553
+
2554
+ #### 10.4.1. SendMessage
2555
+
2556
+ Sends a message to an agent.
2557
+
2558
+ **Request:**
2559
+
2560
+ {{ proto_to_table("SendMessageRequest") }}
2561
+
2562
+ **Response:**
2563
+
2564
+ {{ proto_to_table("SendMessageResponse") }}
2565
+
2566
+ #### 10.4.2. SendStreamingMessage
2567
+
2568
+ Sends a message with streaming updates.
2569
+
2570
+ **Request:**
2571
+
2572
+ {{ proto_to_table("SendMessageRequest") }}
2573
+
2574
+ **Response:** Server streaming [`StreamResponse`](#stream-response) objects.
2575
+
2576
+ #### 10.4.3. GetTask
2577
+
2578
+ Retrieves task status.
2579
+
2580
+ **Request:**
2581
+
2582
+ {{ proto_to_table("GetTaskRequest") }}
2583
+
2584
+ **Response:** See [`Task`](#411-task) object definition.
2585
+
2586
+ #### 10.4.4. ListTasks
2587
+
2588
+ Lists tasks with filtering.
2589
+
2590
+ **Request:**
2591
+
2592
+ {{ proto_to_table("ListTasksRequest") }}
2593
+
2594
+ **Response:**
2595
+
2596
+ {{ proto_to_table("ListTasksResponse") }}
2597
+
2598
+ #### 10.4.5. CancelTask
2599
+
2600
+ Cancels a running task.
2601
+
2602
+ **Request:**
2603
+
2604
+ {{ proto_to_table("CancelTaskRequest") }}
2605
+
2606
+ **Response:** See [`Task`](#411-task) object definition.
2607
+
2608
+ #### 10.4.6. SubscribeToTask
2609
+
2610
+ Subscribe to task updates via streaming. Returns `UnsupportedOperationError` if the task is in a terminal state.
2611
+
2612
+ **Request:**
2613
+
2614
+ {{ proto_to_table("SubscribeToTaskRequest") }}
2615
+
2616
+ **Response:** Server streaming [`StreamResponse`](#stream-response) objects.
2617
+
2618
+ #### 10.4.7. CreateTaskPushNotificationConfig
2619
+
2620
+ Creates a push notification configuration for a task.
2621
+
2622
+ **Request:**
2623
+
2624
+ {{ proto_to_table("CreateTaskPushNotificationConfigRequest") }}
2625
+
2626
+ **Response:** See [`PushNotificationConfig`](#431-pushnotificationconfig) object definition.
2627
+
2628
+ #### 10.4.8. GetTaskPushNotificationConfig
2629
+
2630
+ Retrieves an existing push notification configuration for a task.
2631
+
2632
+ **Request:**
2633
+
2634
+ {{ proto_to_table("GetTaskPushNotificationConfigRequest") }}
2635
+
2636
+ **Response:** See [`PushNotificationConfig`](#431-pushnotificationconfig) object definition.
2637
+
2638
+ #### 10.4.9. ListTaskPushNotificationConfigs
2639
+
2640
+ Lists all push notification configurations for a task.
2641
+
2642
+ **Request:**
2643
+
2644
+ {{ proto_to_table("ListTaskPushNotificationConfigsRequest") }}
2645
+
2646
+ **Response:**
2647
+
2648
+ {{ proto_to_table("ListTaskPushNotificationConfigsResponse") }}
2649
+
2650
+ #### 10.4.10. DeleteTaskPushNotificationConfig
2651
+
2652
+ Removes a push notification configuration for a task.
2653
+
2654
+ **Request:**
2655
+
2656
+ {{ proto_to_table("DeleteTaskPushNotificationConfigRequest") }}
2657
+
2658
+ **Response:** `google.protobuf.Empty`
2659
+
2660
+ #### 10.4.11. GetExtendedAgentCard
2661
+
2662
+ Retrieves the agent's extended capability card after authentication.
2663
+
2664
+ **Request:**
2665
+
2666
+ {{ proto_to_table("GetExtendedAgentCardRequest") }}
2667
+
2668
+ **Response:** See [`AgentCard`](#441-agentcard) object definition.
2669
+
2670
+ ### 10.5. gRPC-Specific Data Types
2671
+
2672
+ #### 10.5.1. TaskPushNotificationConfig
2673
+
2674
+ Resource wrapper for push notification configurations. This is a gRPC-specific type used in resource-oriented operations to provide the full resource name along with the configuration data.
2675
+
2676
+ {{ proto_to_table("TaskPushNotificationConfig") }}
2677
+
2678
+ ### 10.6. Error Handling
2679
+
2680
+ gRPC error responses use the standard [gRPC status](https://grpc.io/docs/guides/error/) structure with [google.rpc.Status](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto), which maps to the generic A2A error model defined in [Section 3.3.2](#332-error-handling) as follows:
2681
+
2682
+ - **Error Code**: Mapped to `status.code` (gRPC status code enum)
2683
+ - **Error Message**: Mapped to `status.message` (human-readable string)
2684
+ - **Error Details**: Mapped to `status.details` (repeated google.protobuf.Any messages)
2685
+
2686
+ **A2A Error Representation:**
2687
+
2688
+ For A2A-specific errors, implementations **MUST** include a `google.rpc.ErrorInfo` message in the `status.details` array with:
2689
+
2690
+ - `reason`: The A2A error type in UPPER_SNAKE_CASE without the "Error" suffix (e.g., `TASK_NOT_FOUND`)
2691
+ - `domain`: Set to `"a2a-protocol.org"`
2692
+ - `metadata`: Optional map of additional error context
2693
+
2694
+ For the complete mapping of A2A error types to gRPC status codes, see [Section 5.4 (Error Code Mappings)](#54-error-code-mappings).
2695
+
2696
+ **Error Response Example:**
2697
+
2698
+ ```proto
2699
+ // Standard gRPC invalid argument error
2700
+ status {
2701
+ code: INVALID_ARGUMENT
2702
+ message: "Invalid request parameters"
2703
+ details: [
2704
+ {
2705
+ type: "type.googleapis.com/google.rpc.BadRequest"
2706
+ field_violations: [
2707
+ {
2708
+ field: "message.parts"
2709
+ description: "At least one part is required"
2710
+ }
2711
+ ]
2712
+ }
2713
+ ]
2714
+ }
2715
+ ```
2716
+
2717
+ **Example A2A-Specific Error Response:**
2718
+
2719
+ ```proto
2720
+ // A2A-specific task not found error
2721
+ status {
2722
+ code: NOT_FOUND
2723
+ message: "Task with ID 'task-123' not found"
2724
+ details: [
2725
+ {
2726
+ type: "type.googleapis.com/google.rpc.ErrorInfo"
2727
+ reason: "TASK_NOT_FOUND"
2728
+ domain: "a2a-protocol.org"
2729
+ metadata: {
2730
+ task_id: "task-123"
2731
+ timestamp: "2025-11-09T10:30:00Z"
2732
+ }
2733
+ }
2734
+ ]
2735
+ }
2736
+ ```
2737
+
2738
+ ### 10.7. Streaming
2739
+
2740
+ gRPC streaming uses server streaming RPCs for real-time updates. The `StreamResponse` message provides a union of possible streaming events:
2741
+
2742
+ {{ proto_to_table("StreamResponse") }}
2743
+
2744
+ ## 11. HTTP+JSON/REST Protocol Binding
2745
+
2746
+ The HTTP+JSON protocol binding provides a RESTful interface using standard HTTP methods and JSON payloads.
2747
+
2748
+ ### 11.1. Protocol Requirements
2749
+
2750
+ - **Protocol:** HTTP(S) with JSON payloads
2751
+ - **Content-Type:** application/a2a+json **SHOULD** be used for requests and responses
2752
+ - **Methods:** Standard HTTP verbs (GET, POST, PUT, DELETE)
2753
+ - **URL Patterns:** RESTful resource-based URLs
2754
+ - **Streaming:** Server-Sent Events for real-time updates
2755
+
2756
+ ### 11.2. Service Parameter Transmission
2757
+
2758
+ A2A service parameters defined in [Section 3.2.6](#326-service-parameters) **MUST** be transmitted using standard HTTP request headers.
2759
+
2760
+ **Service Parameter Requirements:**
2761
+
2762
+ - Service parameter names **MUST** be transmitted as HTTP header fields
2763
+ - Service parameter keys are case-insensitive per HTTP specification (RFC 9110)
2764
+ - Multiple values for the same service parameter (e.g., `A2A-Extensions`) **SHOULD** be comma-separated in a single header field
2765
+
2766
+ **Example Request with A2A Service Parameters:**
2767
+
2768
+ ```http
2769
+ POST /message:send HTTP/1.1
2770
+ Host: agent.example.com
2771
+ Content-Type: application/a2a+json
2772
+ Authorization: Bearer token
2773
+ A2A-Version: 0.3
2774
+ A2A-Extensions: https://example.com/extensions/geolocation/v1,https://standards.org/extensions/citations/v1
2775
+
2776
+ {
2777
+ "message": {
2778
+ "role": "ROLE_USER",
2779
+ "parts": [{"text": "Find restaurants near me"}]
2780
+ }
2781
+ }
2782
+ ```
2783
+
2784
+ ### 11.3. URL Patterns and HTTP Methods
2785
+
2786
+ #### 11.3.1. Message Operations
2787
+
2788
+ - `POST /message:send` - Send message
2789
+ - `POST /message:stream` - Send message with streaming (SSE response)
2790
+
2791
+ #### 11.3.2. Task Operations
2792
+
2793
+ - `GET /tasks/{id}` - Get task status
2794
+ - `GET /tasks` - List tasks (with query parameters)
2795
+ - `POST /tasks/{id}:cancel` - Cancel task
2796
+ - `POST /tasks/{id}:subscribe` - Subscribe to task updates (SSE response, returns error for terminal tasks)
2797
+
2798
+ #### 11.3.3. Push Notification Configuration
2799
+
2800
+ - `POST /tasks/{id}/pushNotificationConfigs` - Create configuration
2801
+ - `GET /tasks/{id}/pushNotificationConfigs/{configId}` - Get configuration
2802
+ - `GET /tasks/{id}/pushNotificationConfigs` - List configurations
2803
+ - `DELETE /tasks/{id}/pushNotificationConfigs/{configId}` - Delete configuration
2804
+
2805
+ #### 11.3.4. Agent Card
2806
+
2807
+ - `GET /extendedAgentCard` - Get authenticated extended Agent Card
2808
+
2809
+ ### 11.4. Request/Response Format
2810
+
2811
+ All requests and responses use JSON objects structurally equivalent to the Protocol Buffer definitions.
2812
+
2813
+ **Example Send Message:**
2814
+
2815
+ ```http
2816
+ POST /message:send
2817
+ Content-Type: application/a2a+json
2818
+
2819
+ {
2820
+ "message": {
2821
+ "messageId": "uuid",
2822
+ "role": "ROLE_USER",
2823
+ "parts": [{"text": "Hello"}]
2824
+ },
2825
+ "configuration": {
2826
+ "acceptedOutputModes": ["text/plain"]
2827
+ }
2828
+ }
2829
+ ```
2830
+
2831
+ **Referenced Objects:** [`SendMessageRequest`](#321-sendmessagerequest), [`Message`](#414-message)
2832
+
2833
+ **Response:**
2834
+
2835
+ ```http
2836
+ HTTP/1.1 200 OK
2837
+ Content-Type: application/a2a+json
2838
+
2839
+ {
2840
+ "task": {
2841
+ "id": "task-uuid",
2842
+ "contextId": "context-uuid",
2843
+ "status": {
2844
+ "state": "TASK_STATE_COMPLETED"
2845
+ }
2846
+ }
2847
+ }
2848
+ ```
2849
+
2850
+ **Referenced Objects:** [`Task`](#411-task)
2851
+
2852
+ ### 11.5. Query Parameter Naming for Request Parameters
2853
+
2854
+ HTTP methods that do not support request bodies (GET, DELETE) **MUST** transmit operation request parameters as path parameters or query parameters. This section defines how to map Protocol Buffer field names to query parameter names.
2855
+
2856
+ **Naming Convention:**
2857
+
2858
+ Query parameter names **MUST** use `camelCase` to match the JSON serialization of Protocol Buffer field names. This ensures consistency with request bodies used in POST operations.
2859
+
2860
+ **Example Mappings:**
2861
+
2862
+ | Protocol Buffer Field | Query Parameter Name | Example Usage |
2863
+ | --------------------- | -------------------- | ------------------- |
2864
+ | `context_id` | `contextId` | `?contextId=uuid` |
2865
+ | `page_size` | `pageSize` | `?pageSize=50` |
2866
+ | `page_token` | `pageToken` | `?pageToken=cursor` |
2867
+ | `task_id` | `taskId` | `?taskId=uuid` |
2868
+
2869
+ **Usage Examples:**
2870
+
2871
+ List tasks with filtering:
2872
+
2873
+ ```http
2874
+ GET /tasks?contextId=uuid&status=working&pageSize=50&pageToken=cursor
2875
+ ```
2876
+
2877
+ Get task with history:
2878
+
2879
+ ```http
2880
+ GET /tasks/{id}?historyLength=10
2881
+ ```
2882
+
2883
+ **Field Type Handling:**
2884
+
2885
+ - **Strings**: Passed directly as query parameter values
2886
+ - **Booleans**: Represented as lowercase strings (`true`, `false`)
2887
+ - **Numbers**: Represented as decimal strings
2888
+ - **Enums**: Represented using their string values (e.g., `status=working`)
2889
+ - **Repeated Fields**: Multiple values **MAY** be passed by repeating the parameter name (e.g., `?tag=value1&tag=value2`) or as comma-separated values (e.g., `?tag=value1,value2`)
2890
+ - **Nested Objects**: Not supported in query parameters; operations requiring nested objects **MUST** use POST with a request body
2891
+ - **Datetimes/Timestamps**: Represented as ISO 8601 strings (e.g., `2025-11-09T10:30:00Z`)
2892
+
2893
+ **URL Encoding:**
2894
+
2895
+ All query parameter values **MUST** be properly URL-encoded per [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986.html).
2896
+
2897
+ ### 11.6. Error Handling
2898
+
2899
+ HTTP error responses use the [google.rpc.Status](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) JSON representation, which maps to the generic A2A error model defined in [Section 3.3.2](#332-error-handling) as follows:
2900
+
2901
+ - **Error Code**: Mapped to the HTTP status code and the `error.code` field
2902
+ - **Error Message**: Mapped to the `error.message` field (human-readable string)
2903
+ - **Error Details**: Mapped to the `error.details` array (array of objects, each containing a `@type` key, using ProtoJSON `Any` representation)
2904
+
2905
+ **Error Detail Objects:**
2906
+
2907
+ Each object in the `details` array **MUST** include a `@type` key that identifies the object's type. Implementations **SHOULD** use well-known types such as `google.rpc.BadRequest` to attach structured data to validation errors. Additional error context **MAY** be included as further objects in the `details` array.
2908
+
2909
+ **A2A Error Representation:**
2910
+
2911
+ Since multiple A2A error types may map to the same HTTP status code (e.g., `TaskNotCancelableError` and `PushNotificationNotSupportedError` both map to `400 Bad Request`), implementations **MUST** include a `google.rpc.ErrorInfo` object in the `details` array for A2A-specific errors with:
2912
+
2913
+ - `@type`: Set to `"type.googleapis.com/google.rpc.ErrorInfo"`
2914
+ - `reason`: The A2A error type in UPPER_SNAKE_CASE without the "Error" suffix (e.g., `TASK_NOT_FOUND`, `TASK_NOT_CANCELABLE`)
2915
+ - `domain`: Set to `"a2a-protocol.org"`
2916
+
2917
+ For the complete mapping of A2A error types to HTTP status codes, see [Section 5.4 (Error Code Mappings)](#54-error-code-mappings).
2918
+
2919
+ **Error Response Example:**
2920
+
2921
+ ```http
2922
+ HTTP/1.1 404 Not Found
2923
+ Content-Type: application/a2a+json
2924
+
2925
+ {
2926
+ "error": {
2927
+ "code": 404,
2928
+ "status": "NOT_FOUND",
2929
+ "message": "The specified task ID does not exist or is not accessible",
2930
+ "details": [
2931
+ {
2932
+ "@type": "type.googleapis.com/google.rpc.ErrorInfo",
2933
+ "reason": "TASK_NOT_FOUND",
2934
+ "domain": "a2a-protocol.org",
2935
+ "metadata": {
2936
+ "taskId": "task-123",
2937
+ "timestamp": "2025-11-09T10:30:00.000Z"
2938
+ }
2939
+ }
2940
+ ]
2941
+ }
2942
+ }
2943
+ ```
2944
+
2945
+ Extension fields like `taskId` and `timestamp` provide additional context to help diagnose the error.
2946
+
2947
+ ### 11.7. Streaming
2948
+
2949
+ <span id="stream-response"></span>
2950
+
2951
+ REST streaming uses Server-Sent Events with the `data` field containing JSON serializations of the protocol data objects:
2952
+
2953
+ ```http
2954
+ POST /message:stream
2955
+ Content-Type: application/a2a+json
2956
+
2957
+ { /* SendMessageRequest object */ }
2958
+ ```
2959
+
2960
+ **Referenced Objects:** [`SendMessageRequest`](#321-sendmessagerequest)
2961
+
2962
+ **Response:**
2963
+
2964
+ ```http
2965
+ HTTP/1.1 200 OK
2966
+ Content-Type: text/event-stream
2967
+
2968
+ data: { /* StreamResponse object */ }
2969
+
2970
+ data: { /* StreamResponse object */ }
2971
+ ```
2972
+
2973
+ **Referenced Objects:** [`StreamResponse`](#323-stream-response)
2974
+ Streaming responses are simple, linearly ordered sequences: first a `Task` (or single `Message`), then zero or more status or artifact update events until the task reaches a terminal or interrupted state, at which point the stream closes. Implementations SHOULD avoid re-ordering events and MAY optionally resend a final `Task` snapshot before closing.
2975
+
2976
+ ## 12. Custom Binding Guidelines
2977
+
2978
+ While the A2A protocol provides three standard bindings (JSON-RPC, gRPC, and HTTP+JSON/REST), implementers **MAY** create custom protocol bindings to support additional transport mechanisms or communication patterns. Custom bindings **MUST** comply with all requirements defined in [Section 5 (Protocol Binding Requirements and Interoperability)](#5-protocol-binding-requirements-and-interoperability). This section provides additional guidelines specific to developing custom bindings.
2979
+
2980
+ ### 12.1. Binding Requirements
2981
+
2982
+ Custom protocol bindings **MUST**:
2983
+
2984
+ 1. **Implement All Core Operations**: Support all operations defined in [Section 3 (A2A Protocol Operations)](#3-a2a-protocol-operations)
2985
+ 2. **Preserve Data Model**: Use data structures functionally equivalent to those defined in [Section 4 (Protocol Data Model)](#4-protocol-data-model)
2986
+ 3. **Maintain Semantics**: Ensure operations behave consistently with the abstract operation definitions
2987
+ 4. **Document Completely**: Provide comprehensive documentation of the binding specification
2988
+
2989
+ ### 12.2. Data Type Mappings
2990
+
2991
+ Custom bindings **MUST** provide clear mappings for:
2992
+
2993
+ - **Protocol Buffer Types**: Define how each Protocol Buffer message type is represented
2994
+ - **Timestamps**: Follow the conventions in [Section 5.6.1 (Timestamps)](#561-timestamps)
2995
+ - **Binary Data**: Specify encoding for binary content (e.g., base64 for text-based protocols)
2996
+ - **Enumerations**: Define representation of enum values (e.g., strings, integers)
2997
+
2998
+ ### 12.3. Service Parameter Transmission
2999
+
3000
+ As specified in [Section 3.2.6 (Service Parameters)](#326-service-parameters), custom protocol bindings **MUST** document how service parameters are transmitted. The binding specification **MUST** address:
3001
+
3002
+ 1. **Transmission Mechanism**: The protocol-specific method for transmitting service parameter key-value pairs
3003
+ 2. **Value Constraints**: Any limitations on service parameter values (e.g., character encoding, size limits)
3004
+ 3. **Reserved Names**: Any service parameter names reserved by the binding itself
3005
+ 4. **Fallback Strategy**: What happens when the protocol lacks native header support (e.g., passing service parameters in metadata)
3006
+
3007
+ **Example Documentation Requirements:**
3008
+
3009
+ - **For native header support**: "Service parameters are transmitted using HTTP request headers. Service parameter keys are case-insensitive and must conform to RFC 7230. Service parameter values must be UTF-8 strings."
3010
+ - **For protocols without headers**: "Service parameters are serialized as a JSON object and transmitted in the request metadata field `a2a-service-parameters`."
3011
+
3012
+ ### 12.4. Error Mapping
3013
+
3014
+ Custom bindings **MUST**:
3015
+
3016
+ 1. **Map Standard Errors**: Provide mappings for all A2A-specific error types defined in [Section 3.2.2 (Error Handling)](#332-error-handling)
3017
+ 2. **Preserve Error Information**: Ensure error details are accessible to clients
3018
+ 3. **Use Appropriate Codes**: Map to protocol-native error codes where applicable
3019
+ 4. **Document Error Format**: Specify the structure of error responses
3020
+
3021
+ ### 12.5. Streaming Support
3022
+
3023
+ If the binding supports streaming operations:
3024
+
3025
+ 1. **Define Stream Mechanism**: Document how streaming is implemented (e.g., WebSockets, long-polling, chunked encoding)
3026
+ 2. **Event Ordering**: Specify ordering guarantees for streaming events
3027
+ 3. **Reconnection**: Define behavior for connection interruption and resumption
3028
+ 4. **Stream Termination**: Specify how stream completion is signaled
3029
+
3030
+ If streaming is not supported, the binding **MUST** clearly document this limitation in the Agent Card.
3031
+
3032
+ ### 12.6. Authentication and Authorization
3033
+
3034
+ Custom bindings **MUST**:
3035
+
3036
+ 1. **Support Standard Schemes**: Implement authentication schemes declared in the Agent Card
3037
+ 2. **Document Integration**: Specify how credentials are transmitted in the protocol
3038
+ 3. **Handle Challenges**: Define how authentication challenges are communicated
3039
+ 4. **Maintain Security**: Follow security best practices for the transport protocol
3040
+
3041
+ ### 12.7. Agent Card Declaration
3042
+
3043
+ Custom bindings **MUST** be declared in the Agent Card:
3044
+
3045
+ 1. **Transport Identifier**: Use a URI to identify the binding (see [Section 5.8](#58-custom-binding-identification))
3046
+ 2. **Endpoint URL**: Provide the full URL where the binding is available
3047
+
3048
+ **Example:**
3049
+
3050
+ ```json
3051
+ {
3052
+ "supportedInterfaces": [
3053
+ {
3054
+ "url": "wss://agent.example.com/a2a/websocket",
3055
+ "protocolBinding": "https://example.com/bindings/websocket/v1"
3056
+ }
3057
+ ]
3058
+ }
3059
+ ```
3060
+
3061
+ ### 12.8. Interoperability Testing
3062
+
3063
+ Custom binding implementers **SHOULD**:
3064
+
3065
+ 1. **Test Against Reference**: Verify behavior matches standard bindings
3066
+ 2. **Document Differences**: Clearly note any deviations from standard binding behavior
3067
+ 3. **Provide Examples**: Include sample requests and responses
3068
+ 4. **Test Edge Cases**: Verify handling of error conditions, large payloads, and long-running tasks
3069
+
3070
+ ## 13. Security Considerations
3071
+
3072
+ This section consolidates security guidance and best practices for implementing and operating A2A agents. For additional enterprise security considerations, see [Enterprise-Ready Features](./topics/enterprise-ready.md).
3073
+
3074
+ ### 13.1. Data Access and Authorization Scoping
3075
+
3076
+ Implementations **MUST** ensure appropriate scope limitation based on the authenticated caller's authorization boundaries. This applies to all operations that access or list tasks and other resources.
3077
+
3078
+ **Authorization Principles:**
3079
+
3080
+ - Servers **MUST** implement authorization checks on every [A2A Protocol Operations](#3-a2a-protocol-operations) request
3081
+ - Implementations **MUST** scope results to the caller's authorized access boundaries as defined by the agent's authorization model
3082
+ - Even when `contextId` or other filter parameters are not specified in requests, implementations **MUST** scope results to the caller's authorized access boundaries
3083
+ - Authorization models are agent-defined and **MAY** be based on:
3084
+ - User identity (user-based authorization)
3085
+ - Organizational roles or groups (role-based authorization)
3086
+ - Project or workspace membership (project-based authorization)
3087
+ - Organizational or tenant boundaries (multi-tenant authorization)
3088
+ - Custom authorization logic specific to the agent's domain
3089
+
3090
+ **Operations Requiring Scope Limitation:**
3091
+
3092
+ - [`List Tasks`](#314-list-tasks): **MUST** only return tasks visible to the authenticated client according to the agent's authorization model
3093
+ - [`Get Task`](#313-get-task): **MUST** verify the authenticated client has access to the requested task according to the agent's authorization model
3094
+ - Task-related operations (Cancel, Subscribe, Push Notification Config): **MUST** verify the client has appropriate access rights according to the agent's authorization model
3095
+
3096
+ **Implementation Requirements:**
3097
+
3098
+ - Authorization boundaries are defined by each agent's authorization model, not prescribed by the protocol
3099
+ - Authorization checks **MUST** occur before any database queries or operations that could leak information about the existence of resources outside the caller's authorization scope
3100
+ - Agents **SHOULD** document their authorization model and access control policies
3101
+
3102
+ See also: [Section 3.1.4 List Tasks (Security Note)](#314-list-tasks) for operation-specific requirements.
3103
+
3104
+ ### 13.2. Push Notification Security
3105
+
3106
+ When implementing push notifications, both agents (as webhook callers) and clients (as webhook receivers) have security responsibilities.
3107
+
3108
+ **Agent (Webhook Caller) Requirements:**
3109
+
3110
+ - Agents **MUST** include authentication credentials in webhook requests as specified in [`PushNotificationConfig.authentication`](#432-authenticationinfo)
3111
+ - Agents **SHOULD** implement reasonable timeout values for webhook requests (recommended: 10-30 seconds)
3112
+ - Agents **SHOULD** implement retry logic with exponential backoff for failed deliveries
3113
+ - Agents **MAY** stop attempting delivery after a configured number of consecutive failures
3114
+ - Agents **SHOULD** validate webhook URLs to prevent SSRF (Server-Side Request Forgery) attacks:
3115
+ - Reject private IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
3116
+ - Reject localhost and link-local addresses
3117
+ - Implement URL allowlists where appropriate
3118
+
3119
+ **Client (Webhook Receiver) Requirements:**
3120
+
3121
+ - Clients **MUST** validate webhook authenticity using the provided authentication credentials
3122
+ - Clients **SHOULD** verify the task ID in the payload matches an expected task they created
3123
+ - Clients **MUST** respond with HTTP 2xx status codes to acknowledge successful receipt
3124
+ - Clients **SHOULD** process notifications idempotently, as duplicate deliveries may occur
3125
+ - Clients **SHOULD** implement rate limiting to prevent webhook flooding
3126
+ - Clients **SHOULD** use HTTPS endpoints for webhook URLs to ensure confidentiality
3127
+
3128
+ **Configuration Security:**
3129
+
3130
+ - Webhook URLs **SHOULD** use HTTPS to protect payload confidentiality in transit
3131
+ - Authentication tokens in [`PushNotificationConfig`](#431-pushnotificationconfig) **SHOULD** be treated as secrets and rotated periodically
3132
+ - Agents **SHOULD** securely store push notification configurations and credentials
3133
+ - Clients **SHOULD** use unique, single-purpose tokens for each push notification configuration
3134
+
3135
+ See also: [Section 4.3 Push Notification Objects](#43-push-notification-objects) and [Section 4.3.3 Push Notification Payload](#433-push-notification-payload).
3136
+
3137
+ ### 13.3. Extended Agent Card Access Control
3138
+
3139
+ The extended Agent Card feature allows agents to provide additional capabilities or information to authenticated clients beyond what is available in the public Agent Card.
3140
+
3141
+ **Access Control Requirements:**
3142
+
3143
+ - The [`Get Extended Agent Card`](#3111-get-extended-agent-card) operation **MUST** require authentication
3144
+ - Agents **MUST** authenticate requests using one of the schemes declared in the public `AgentCard.securitySchemes` and `AgentCard.security` fields
3145
+ - Agents **MAY** return different extended card content based on the authenticated client's identity or authorization level
3146
+ - Agents **SHOULD** implement appropriate caching headers to control client-side caching of extended cards
3147
+
3148
+ **Capability-Based Access:**
3149
+
3150
+ - Extended cards **MAY** include additional skills not present in the public card
3151
+ - Extended cards **MAY** expose more detailed capability information (e.g., rate limits, quotas)
3152
+ - Extended cards **MAY** include organization-specific or user-specific configuration
3153
+ - Agents **SHOULD** document which capabilities are available at different authentication levels
3154
+
3155
+ **Security Considerations:**
3156
+
3157
+ - Extended cards **SHOULD NOT** include sensitive information that could be exploited if leaked (e.g., internal service URLs, unmasked credentials)
3158
+ - Agents **MUST** validate that clients have appropriate permissions before returning privileged information in extended cards
3159
+ - Clients retrieving extended cards **SHOULD** replace their cached public Agent Card with the extended version for the duration of their authenticated session
3160
+ - Agents **SHOULD** version extended cards appropriately and honor client cache invalidation
3161
+
3162
+ **Availability Declaration:**
3163
+
3164
+ - Agents declare extended card support via `AgentCard.capabilities.extendedAgentCard`
3165
+ - When `capabilities.extendedAgentCard` is `false` or not present, the operation **MUST** return [`UnsupportedOperationError`](#332-error-handling)
3166
+ - When support is declared but no extended card is configured, the operation **MUST** return [`ExtendedAgentCardNotConfiguredError`](#332-error-handling)
3167
+
3168
+ See also: [Section 3.1.11 Get Extended Agent Card](#3111-get-extended-agent-card) and [Section 3.3.4 Capability Validation](#334-capability-validation).
3169
+
3170
+ ### 13.4. General Security Best Practices
3171
+
3172
+ **Transport Security:**
3173
+
3174
+ - Production deployments **MUST** use encrypted communication (HTTPS for HTTP-based bindings, TLS for gRPC)
3175
+ - Implementations **SHOULD** use modern TLS configurations (TLS 1.3+ recommended) with strong cipher suites
3176
+ - Agents **SHOULD** enforce HSTS (HTTP Strict Transport Security) headers when using HTTP-based bindings
3177
+ - Implementations **SHOULD** disable support for deprecated SSL/TLS versions (SSLv3, TLS 1.0, TLS 1.1)
3178
+
3179
+ **Input Validation:**
3180
+
3181
+ - Agents **MUST** validate all input parameters before processing
3182
+ - Agents **SHOULD** implement appropriate limits on message sizes, file sizes, and request complexity
3183
+ - Agents **SHOULD** sanitize or validate file content types and reject unexpected media types
3184
+
3185
+ **Credential Management:**
3186
+
3187
+ - API keys, tokens, and other credentials **MUST** be treated as secrets
3188
+ - Credentials **SHOULD** be rotated periodically
3189
+ - Credentials **SHOULD** be transmitted only over encrypted connections
3190
+ - Agents **SHOULD** implement credential revocation mechanisms
3191
+ - Agents **SHOULD** log authentication failures and implement rate limiting to prevent brute-force attacks
3192
+
3193
+ **Audit and Monitoring:**
3194
+
3195
+ - Agents **SHOULD** log security-relevant events (authentication failures, authorization denials, suspicious requests)
3196
+ - Agents **SHOULD** implement monitoring for unusual patterns (rapid task creation, excessive cancellations)
3197
+ - Agents **SHOULD** provide audit trails for sensitive operations
3198
+ - Logs **MUST NOT** include sensitive information (credentials, personal data) unless required and properly protected
3199
+
3200
+ **Rate Limiting and Abuse Prevention:**
3201
+
3202
+ - Agents **SHOULD** implement rate limiting on all operations
3203
+ - Agents **SHOULD** return appropriate error responses when rate limits are exceeded
3204
+ - Agents **MAY** implement different rate limits for different operations or user tiers
3205
+
3206
+ **Data Privacy:**
3207
+
3208
+ - Agents **MUST** comply with applicable data protection regulations
3209
+ - Agents **SHOULD** provide mechanisms for users to request deletion of their data
3210
+ - Agents **SHOULD** implement appropriate data retention policies
3211
+ - Agents **SHOULD** minimize logging of sensitive or personal information
3212
+
3213
+ **Custom Binding Security:**
3214
+
3215
+ - Custom protocol bindings **MUST** address security considerations in their specification
3216
+ - Custom bindings **SHOULD** follow the same security principles as standard bindings
3217
+ - Custom bindings **MUST** document authentication integration and credential transmission
3218
+
3219
+ See also: [Section 12.6 Authentication and Authorization (Custom Bindings)](#126-authentication-and-authorization).
3220
+
3221
+ ## 14. IANA Considerations
3222
+
3223
+ This section provides registration templates for the A2A protocol's media type, HTTP headers, and well-known URI, intended for submission to the Internet Assigned Numbers Authority (IANA).
3224
+
3225
+ ### 14.1. Media Type Registration
3226
+
3227
+ #### 14.1.1. application/a2a+json
3228
+
3229
+ **Type name:** `application`
3230
+
3231
+ **Subtype name:** `a2a+json`
3232
+
3233
+ **Required parameters:** None
3234
+
3235
+ **Optional parameters:**
3236
+
3237
+ - None
3238
+
3239
+ **Encoding considerations:** Binary (UTF-8 encoding MUST be used for JSON text)
3240
+
3241
+ **Security considerations:**
3242
+ This media type shares security considerations common to all JSON-based formats as described in RFC 8259, Section 12. Additionally:
3243
+
3244
+ - Content MUST be validated against the A2A protocol schema before processing
3245
+ - Implementations MUST sanitize user-provided content to prevent injection attacks
3246
+ - File references within A2A messages MUST be validated to prevent server-side request forgery (SSRF)
3247
+ - Authentication and authorization MUST be enforced as specified in Section 7 of the A2A specification
3248
+ - Sensitive information in task history and artifacts MUST be protected according to applicable data protection regulations
3249
+
3250
+ **Interoperability considerations:**
3251
+ The A2A protocol supports multiple protocol bindings. This media type is intended for the HTTP+JSON/REST binding.
3252
+
3253
+ **Published specification:**
3254
+ Agent2Agent (A2A) Protocol Specification, available at: <https://a2a-protocol.org/latest/specification>
3255
+
3256
+ **Applications that use this media type:**
3257
+ AI agent platforms, agentic workflow systems, multi-agent collaboration tools, and enterprise automation systems that implement the A2A protocol for agent-to-agent communication.
3258
+
3259
+ **Fragment identifier considerations:** None
3260
+
3261
+ **Additional information:**
3262
+
3263
+ - **Deprecated alias names for this type:** None
3264
+ - **Magic number(s):** None
3265
+ - **File extension(s):** .a2a.json
3266
+ - **Macintosh file type code(s):** TEXT
3267
+
3268
+ **Person & email address to contact for further information:**
3269
+ A2A Protocol Working Group, <a2a-protocol@example.org>
3270
+
3271
+ **Intended usage:** COMMON
3272
+
3273
+ **Restrictions on usage:** None
3274
+
3275
+ **Author:** A2A Protocol Working Group
3276
+
3277
+ **Change controller:** A2A Protocol Working Group
3278
+
3279
+ **Provisional registration:** No
3280
+
3281
+ ### 14.2. HTTP Header Field Registrations
3282
+
3283
+ **Note:** The following HTTP headers represent the HTTP-based protocol binding implementation of the abstract A2A service parameters defined in [Section 3.2.6](#326-service-parameters). These registrations are specific to HTTP/HTTPS transports.
3284
+
3285
+ #### 14.2.1. A2A-Version Header
3286
+
3287
+ **Header field name:** A2A-Version
3288
+
3289
+ **Applicable protocol:** HTTP
3290
+
3291
+ **Status:** Standard
3292
+
3293
+ **Author/Change controller:** A2A Protocol Working Group
3294
+
3295
+ **Specification document:** Section 3.2.5 of the A2A Protocol Specification
3296
+
3297
+ **Related information:**
3298
+ The A2A-Version header field indicates the A2A protocol version that the client is using. The value MUST be in the format `Major.Minor` (e.g., "0.3"). If the version is not supported by the agent, the agent returns a `VersionNotSupportedError`.
3299
+
3300
+ **Example:**
3301
+
3302
+ ```text
3303
+ A2A-Version: 0.3
3304
+ ```
3305
+
3306
+ #### 14.2.2. A2A-Extensions Header
3307
+
3308
+ **Header field name:** A2A-Extensions
3309
+
3310
+ **Applicable protocol:** HTTP
3311
+
3312
+ **Status:** Standard
3313
+
3314
+ **Author/Change controller:** A2A Protocol Working Group
3315
+
3316
+ **Specification document:** Section 3.2.5 of the A2A Protocol Specification
3317
+
3318
+ **Related information:**
3319
+ The A2A-Extensions header field contains a comma-separated list of extension URIs that the client wants to use for the request. Extensions allow agents to provide additional functionality beyond the core A2A specification while maintaining backward compatibility.
3320
+
3321
+ **Example:**
3322
+
3323
+ ```text
3324
+ A2A-Extensions: https://example.com/extensions/geolocation/v1,https://standards.org/extensions/citations/v1
3325
+ ```
3326
+
3327
+ ### 14.3. Well-Known URI Registration
3328
+
3329
+ **URI suffix:** agent-card.json
3330
+
3331
+ **Change controller:** A2A Protocol Working Group
3332
+
3333
+ **Specification document:** Section 8.2 of the A2A Protocol Specification
3334
+
3335
+ **Related information:**
3336
+ The `.well-known/agent-card.json` URI provides a standardized location for discovering an A2A agent's capabilities, supported protocols, authentication requirements, and available skills. The resource at this URI MUST return an AgentCard object as defined in Section 4.4.1 of the A2A specification.
3337
+
3338
+ **Status:** Permanent
3339
+
3340
+ **Security considerations:**
3341
+
3342
+ - The Agent Card MAY contain public information about an agent's capabilities and SHOULD NOT include sensitive credentials or internal implementation details
3343
+ - Implementations SHOULD support HTTPS to ensure authenticity and integrity of the Agent Card
3344
+ - Agent Cards MAY be signed using JSON Web Signatures (JWS) as specified in the AgentCardSignature object (Section 4.4.7)
3345
+ - Clients SHOULD verify signatures when present to ensure the Agent Card has not been tampered with
3346
+ - Extended Agent Cards retrieved via authenticated endpoints (Section 3.1.11) MAY contain additional information and MUST enforce appropriate access controls
3347
+
3348
+ **Example:**
3349
+
3350
+ ```text
3351
+ https://agent.example.com/.well-known/agent-card.json
3352
+ ```
3353
+
3354
+ ---
3355
+
3356
+ ## Appendix A. Migration & Legacy Compatibility
3357
+
3358
+ This appendix catalogs renamed protocol messages and objects, their legacy identifiers, and the planned deprecation/removal schedule. All legacy names and anchors MUST remain resolvable until the stated earliest removal version.
3359
+
3360
+ | Legacy Name | Current Name | Earliest Removal Version | Notes |
3361
+ | ----------------------------------------------- | ----------------------------------------- | ------------------------ | ------------------------------------------------------ |
3362
+ | `MessageSendParams` | `SendMessageRequest` | >= 0.5.0 | Request payload rename for clarity (request vs params) |
3363
+ | `SendMessageSuccessResponse` | `SendMessageResponse` | >= 0.5.0 | Unified success response naming |
3364
+ | `SendStreamingMessageSuccessResponse` | `StreamResponse` | >= 0.5.0 | Shorter, binding-agnostic streaming response |
3365
+ | `SetTaskPushNotificationConfigRequest` | `CreateTaskPushNotificationConfigRequest` | >= 0.5.0 | Explicit creation intent |
3366
+ | `ListTaskPushNotificationConfigSuccessResponse` | `ListTaskPushNotificationConfigsResponse` | >= 0.5.0 | Consistent response suffix removal |
3367
+ | `GetAuthenticatedExtendedCardRequest` | `GetExtendedAgentCardRequest` | >= 0.5.0 | Removed "Authenticated" from naming |
3368
+
3369
+ Planned Lifecycle (example timeline; adjust per release strategy):
3370
+
3371
+ 1. 0.3.x: New names introduced; legacy names documented; aliases added.
3372
+ 2. 0.4.x: Legacy names marked "deprecated" in SDKs and schemas; warning notes added.
3373
+ 3. ≥0.5.0: Legacy names eligible for removal after review; migration appendix updated.
3374
+
3375
+ ### A.1 Legacy Documentation Anchors
3376
+
3377
+ Hidden anchor spans preserve old inbound links:
3378
+
3379
+ <!-- Legacy inbound link compatibility anchors (old spec numbering & names) -->
3380
+ <span id="32-supported-transport-protocols"></span>
3381
+ <span id="324-transport-extensions"></span>
3382
+ <span id="35-method-mapping-and-naming-conventions"></span>
3383
+ <span id="5-agent-discovery-the-agent-card"></span>
3384
+ <span id="53-recommended-location"></span>
3385
+ <span id="55-agentcard-object-structure"></span>
3386
+ <span id="56-transport-declaration-and-url-relationships"></span>
3387
+ <span id="563-client-transport-selection-rules"></span>
3388
+ <span id="57-sample-agent-card"></span>
3389
+ <span id="6-protocol-data-objects"></span>
3390
+ <span id="61-task-object"></span>
3391
+ <span id="610-taskpushnotificationconfig-object"></span>
3392
+ <span id="611-json-rpc-structures"></span>
3393
+ <span id="612-jsonrpcerror-object"></span>
3394
+ <span id="63-taskstate-enum"></span>
3395
+ <span id="69-pushnotificationauthenticationinfo-object"></span>
3396
+ <span id="711-messagesendparams-object"></span>
3397
+ <span id="72-messagestream"></span>
3398
+ <span id="721-sendstreamingmessageresponse-object"></span>
3399
+ <span id="731-taskqueryparams-object"></span>
3400
+ <span id="741-listtasksparams-object"></span>
3401
+ <span id="742-listtasksresult-object"></span>
3402
+ <span id="751-taskidparams-object-for-taskscancel-and-taskspushnotificationconfigget"></span>
3403
+ <span id="77-taskspushnotificationconfigget"></span>
3404
+ <span id="771-gettaskpushnotificationconfigparams-object-taskspushnotificationconfigget"></span>
3405
+ <span id="781-listtaskpushnotificationconfigparams-object-taskspushnotificationconfiglist"></span>
3406
+ <span id="791-deletetaskpushnotificationconfigparams-object-taskspushnotificationconfigdelete"></span>
3407
+ <span id="8-error-handling"></span>
3408
+ <span id="82-a2a-specific-errors"></span>
3409
+ <!-- Legacy renamed message/object name anchors -->
3410
+ <span id="messagesendparams"></span>
3411
+ <span id="sendmessagesuccessresponse"></span>
3412
+ <span id="sendstreamingmessagesuccessresponse"></span>
3413
+ <span id="settaskpushnotificationconfigrequest"></span>
3414
+ <span id="listtaskpushnotificationconfigsuccessresponse"></span>
3415
+ <span id="getauthenticatedextendedcardrequest"></span>
3416
+ <span id="938-agentgetauthenticatedextendedcard"></span>
3417
+
3418
+ Each legacy span SHOULD be placed adjacent to the current object's heading (to be inserted during detailed object section edits). If an exact numeric-prefixed anchor existed (e.g., `#414-message`), add an additional span matching that historical form if known.
3419
+
3420
+ ### A.2 Migration Guidance
3421
+
3422
+ Client Implementations SHOULD:
3423
+
3424
+ - Prefer new names immediately for all new integrations.
3425
+ - Implement dual-handling where schemas/types permit (e.g., union type or backward-compatible decoder).
3426
+ - Log a warning when receiving legacy-named objects after the first deprecation announcement release.
3427
+
3428
+ Server Implementations MAY:
3429
+
3430
+ - Accept both legacy and current request message forms during the overlap period.
3431
+ - Emit only current form in responses (recommended) while providing explicit upgrade notes.
3432
+
3433
+ #### A.2.1 Breaking Change: Kind Discriminator Removed
3434
+
3435
+ **Version 1.0 introduces a breaking change** in how polymorphic objects are represented in the protocol. This affects `Part` types and streaming event types.
3436
+
3437
+ **Legacy Pattern (v0.3.x):**
3438
+ Objects used an inline `kind` field as a discriminator to identify the object type:
3439
+
3440
+ **Example 1 - TextPart:**
3441
+
3442
+ ```json
3443
+ {
3444
+ "kind": "text",
3445
+ "text": "Hello, world!"
3446
+ }
3447
+ ```
3448
+
3449
+ **Example 2 - FilePart:**
3450
+
3451
+ ```json
3452
+ {
3453
+ "kind": "file",
3454
+ "file": {
3455
+ "name": "diagram.png",
3456
+ "mimeType": "image/png",
3457
+ "fileWithBytes": "iVBORw0KGgo..."
3458
+ }
3459
+ }
3460
+ ```
3461
+
3462
+ **Current Pattern (v1.0):**
3463
+ Objects now use the **JSON member name** itself to identify the type. The member name acts as the discriminator, and the value structure depends on the specific type:
3464
+
3465
+ **Example 1 - TextPart:**
3466
+
3467
+ ```json
3468
+ {
3469
+ "text": "Hello, world!"
3470
+ }
3471
+ ```
3472
+
3473
+ **Example 2 - FilePart:**
3474
+
3475
+ ```json
3476
+ {
3477
+ "raw": "iVBORw0KGgo...",
3478
+ "filename": "diagram.png",
3479
+ "mediaType": "image/png"
3480
+ }
3481
+ ```
3482
+
3483
+ **Affected Types:**
3484
+
3485
+ 1. **Part Union Types**:
3486
+ - **TextPart**:
3487
+ - **Legacy:** `{ "kind": "text", "text": "..." }`
3488
+ - **Current:** `{ "text": "..." }` (member presence acts as discriminator)
3489
+ - **FilePart**:
3490
+ - **Legacy:** `{ "kind": "file", "file": { "name": "...", "mimeType": "...", "fileWithBytes": "..." } }`
3491
+ - **Current:** `{ "raw": "...", "filename": "...", "mediaType": "..." }` (or `url` instead of `raw`)
3492
+ - **DataPart**:
3493
+ - **Legacy:** `{ "kind": "data", "data": {...} }`
3494
+ - **Current:** `{ "data": {...}, "mediaType": "application/json" }`
3495
+
3496
+ 2. **Streaming Event Types**:
3497
+ - **TaskStatusUpdateEvent**:
3498
+ - **Legacy:** `{ "kind": "status-update", "taskId": "...", "status": {...} }`
3499
+ - **Current:** `{ "statusUpdate": { "taskId": "...", "status": {...} } }`
3500
+ - **TaskArtifactUpdateEvent**:
3501
+ - **Legacy:** `{ "kind": "artifact-update", "taskId": "...", "artifact": {...} }`
3502
+ - **Current:** `{ "artifactUpdate": { "taskId": "...", "artifact": {...} } }`
3503
+
3504
+ **Migration Strategy:**
3505
+
3506
+ For **Clients** upgrading from pre-0.3.x:
3507
+
3508
+ 1. Update parsers to expect wrapper objects with member names as discriminators
3509
+ 2. When constructing requests, use the new wrapper format
3510
+ 3. Implement version detection based on the agent's `protocolVersions` in the `AgentCard`
3511
+ 4. Consider maintaining backward compatibility by detecting and handling both formats during a transition period
3512
+
3513
+ For **Servers** upgrading from pre-0.3.x:
3514
+
3515
+ 1. Update serialization logic to emit wrapper objects
3516
+ 2. **Breaking:** The `kind` field is no longer part of the protocol and should not be emitted
3517
+ 3. Update deserialization to expect wrapper objects with member names
3518
+ 4. Ensure the `AgentCard` declares the correct `protocolVersions` (e.g., ["1.0"] or later)
3519
+
3520
+ **Rationale:**
3521
+
3522
+ This change aligns with modern API design practices and Protocol Buffers' `oneof` semantics, where the field name itself serves as the type discriminator. This approach:
3523
+
3524
+ - Reduces redundancy (no need for both a field name and a `kind` value)
3525
+ - Aligns JSON-RPC and gRPC representations more closely
3526
+ - Simplifies code generation from schema definitions
3527
+ - Eliminates the need for representing inheritance structures in schema languages
3528
+ - Improves type safety in strongly-typed languages
3529
+
3530
+ #### A.2.2 Breaking Change: Extended Agent Card Field Relocated
3531
+
3532
+ **Version 1.0 relocates the extended agent card capability** from a top-level field to the capabilities object for architectural consistency.
3533
+
3534
+ **Legacy Structure (pre-1.0):**
3535
+
3536
+ ```json
3537
+ {
3538
+ "supportsExtendedAgentCard": true,
3539
+ "capabilities": {
3540
+ "streaming": true
3541
+ }
3542
+ }
3543
+ ```
3544
+
3545
+ **Current Structure (1.0+):**
3546
+
3547
+ ```json
3548
+ {
3549
+ "capabilities": {
3550
+ "streaming": true,
3551
+ "extendedAgentCard": true
3552
+ }
3553
+ }
3554
+ ```
3555
+
3556
+ **Proto Changes:**
3557
+
3558
+ - Removed: `AgentCard.supports_extended_agent_card` (field 13)
3559
+ - Added: `AgentCapabilities.extended_agent_card` (field 5)
3560
+
3561
+ **Migration Steps:**
3562
+
3563
+ For **Agent Implementations**:
3564
+
3565
+ 1. Remove `supportsExtendedAgentCard` from top-level AgentCard
3566
+ 2. Add `extendedAgentCard` to `capabilities` object
3567
+ 3. Update validation: `agentCard.capabilities?.extendedAgentCard`
3568
+
3569
+ For **Client Implementations**:
3570
+
3571
+ 1. Update capability checks: `agentCard.capabilities?.extendedAgentCard`
3572
+ 2. Temporary fallback (transition period):
3573
+
3574
+ ```javascript
3575
+ const supported = agentCard.capabilities?.extendedAgentCard ||
3576
+ agentCard.supportsExtendedAgentCard;
3577
+ ```
3578
+
3579
+ 3. Remove fallback after agent ecosystem migrates
3580
+
3581
+ For **SDK Developers**:
3582
+
3583
+ 1. Regenerate code from updated proto
3584
+ 2. Update type definitions
3585
+ 3. Document breaking change in release notes
3586
+
3587
+ **Rationale:**
3588
+
3589
+ All optional features enabling specific operations (`streaming`, `pushNotifications`, `stateTransitionHistory`) reside in `AgentCapabilities`. Moving `extendedAgentCard` achieves:
3590
+
3591
+ - Architectural consistency
3592
+ - Improved discoverability
3593
+ - Semantic correctness (it is a capability)
3594
+
3595
+ ### A.3 Future Automation
3596
+
3597
+ Once the proto→schema generation pipeline lands, this appendix will be partially auto-generated (legacy mapping table sourced from a maintained manifest). Until then, edits MUST be manual and reviewed in PRs affecting `a2a.proto`.
3598
+
3599
+ ## Appendix B. Relationship to MCP (Model Context Protocol)
3600
+
3601
+ A2A and MCP are complementary protocols designed for different aspects of agentic systems:
3602
+
3603
+ - **[Model Context Protocol (MCP)](https://modelcontextprotocol.io/):** Focuses on standardizing how AI models and agents connect to and interact with **tools, APIs, data sources, and other external resources.** It defines structured ways to describe tool capabilities (like function calling in LLMs), pass inputs, and receive structured outputs. Think of MCP as the "how-to" for an agent to *use* a specific capability or access a resource.
3604
+ - **Agent2Agent Protocol (A2A):** Focuses on standardizing how independent, often opaque, **AI agents communicate and collaborate with each other as peers.** A2A provides an application-level protocol for agents to discover each other, negotiate interaction modalities, manage shared tasks, and exchange conversational context or complex results. It's about how agents *partner* or *delegate* work.
3605
+
3606
+ **How they work together:**
3607
+ An A2A Client agent might request an A2A Server agent to perform a complex task. The Server agent, in turn, might use MCP to interact with several underlying tools, APIs, or data sources to gather information or perform actions necessary to fulfill the A2A task.
3608
+
3609
+ For a more detailed comparison, see the [A2A and MCP guide](./topics/a2a-and-mcp.md).
3610
+
3611
+ ---