01 //What is the A2A (Agent2Agent) protocol?
Answer: Agent2Agent (A2A) is an open protocol for independent AI agents to discover one another, exchange messages, and coordinate work as tasks. An A2A client talks to a remote A2A server without needing access to that server’s model, memory, or internal tools. The protocol defines the communication contract; each implementation remains responsible for its own security controls.
A2A matters during code review because a remote agent can receive sensitive context, return instructions or files, and perform actions on behalf of a caller. Every handoff crosses an identity and data boundary. The secure design keeps those boundaries explicit from discovery through task completion.
Verify who published the card and where its interface URL leads.
Authenticate the caller and check its permission for each operation.
Treat messages and artifacts as untrusted input before tool use.
Where A2A sits in an agent system
| Layer | Primary job | Security question |
|---|---|---|
| A2A | Agent-to-agent discovery, messages, and tasks | May this caller ask this remote agent to do this work? |
| MCP | Connect an agent or application to tools and data | May this tool perform this operation with these arguments? |
| ADK or another framework | Build and orchestrate an agent | Are the agent’s capabilities and execution policies constrained? |
For the adjacent boundaries, read the MCP Security guide for tool and resource connections and the Google ADK Security guide for framework-level tool and session controls.
02 //A2A vs MCP: which boundary are you securing?
Answer: A2A standardizes communication between agents; MCP exposes tools, resources, and prompts to an agent or application. A2A is useful when a remote agent owns its workflow and can accept a task, ask for clarification, and return an artifact. MCP is useful when the caller wants to invoke a particular tool or retrieve context. An A2A server may itself use MCP tools to complete the task, so both boundaries can appear in one request.
A2A and MCP in a purchase-order workflow
| Step | Protocol boundary | Security control |
|---|---|---|
| Procurement agent asks a finance agent to review an invoice | A2A agent-to-agent request | Authenticate procurement, authorize the invoice and requested skill |
| Finance agent looks up purchase-order data | MCP tool/resource access, if used | Scope the lookup to the approved organization and order |
| Finance agent returns a risk report | A2A Artifact | Minimize sensitive fields and validate the report before downstream use |
| Procurement agent decides whether to pay | Application action boundary | Require a separate payment authorization; a report is not approval |
The finance agent accepting an A2A task does not grant it unlimited access to procurement data. The MCP tool responding to that agent does not prove a payment should be made. Each protocol transports a request or result; the application enforces the policy at every side effect.
The official A2A and MCP guide describes how these protocols complement each other.
03 //How does an A2A request work?
The client first discovers an Agent Card, commonly at /.well-known/agent-card.json. The card describes the server’s skills, supported interfaces, and security schemes. The client obtains credentials through the declared authentication flow, sends a message to a supported interface, and receives either a quick Message or a stateful Task. A Task can report progress and produce Artifacts.
Core A2A objects and their review implications
| Object | What it represents | What to review |
|---|---|---|
| Agent Card | Published capabilities and connection details | Trusted origin, interface URL, protocol version, public disclosures |
| Message / Part | A communication turn with text, data, or file content | Input validation, prompt injection, file and URL handling |
| Task | A stateful unit of work with status and identifiers | Caller ownership for get, list, cancel, and subscribe |
| Artifact | A deliverable produced during a task | Sensitive data exposure and safe rendering or execution |
Current A2A interfaces may use JSON-RPC, gRPC, or HTTP+JSON bindings. Read the Agent Card’s supported interface and protocol version instead of assuming an older endpoint or payload format. The security checks below apply at the operation boundary regardless of binding.
04 //Read an A2A 1.0 Agent Card before connecting
In the 1.0 data model, an Agent Card declares a required name, description, agent version, ordered supportedInterfaces, capabilities, default input and output media types, and skills. It may also declare securitySchemes, securityRequirements, a provider, and JWS signatures. A skill may carry its own security requirements. These fields describe a contract; they are not proof that a deployment implements it correctly.
1{
2 "name": "Invoice Review Agent",
3 "description": "Reviews invoices and returns a risk report",
4 "supportedInterfaces": [
5 {
6 "url": "https://finance.example.com/a2a/v1",
7 "protocolBinding": "JSONRPC",
8 "protocolVersion": "1.0"
9 }
10 ],
11 "version": "2.1.0",
12 "capabilities": {
13 "streaming": true,
14 "pushNotifications": false,
15 "extendedAgentCard": true
16 },
17 "securitySchemes": {
18 "clientBearer": {
19 "httpAuthSecurityScheme": { "scheme": "bearer" }
20 }
21 },
22 "securityRequirements": [
23 { "schemes": { "clientBearer": { "list": [] } } }
24 ],
25 "defaultInputModes": ["application/json"],
26 "defaultOutputModes": ["application/json"],
27 "skills": [
28 {
29 "id": "review-invoice",
30 "name": "Review invoice",
31 "description": "Returns findings without approving payment",
32 "tags": ["finance", "review"]
33 }
34 ]
35}The first supported interface is preferred. A client selects a binding it supports, uses that entry’s URL, and sends the matching A2A-Version value (for example 1.0) on requests. The card’s version is the agent product version; the interface’s protocolVersion is the A2A protocol version. Confusing the two can select incompatible semantics. A client that requires 1.0 should not silently fall back to an older major version.
Agent Card review questions
| Field | Security question |
|---|---|
| supportedInterfaces.url | Is this URL approved for the provider and binding? |
| protocolBinding / protocolVersion | Can the client speak this binding and version safely? |
| securitySchemes / securityRequirements | Where will credentials come from, and what do they authorize? |
| capabilities | Are streaming, push, or extended-card operations actually enforced? |
| skills / modes | Are public claims and accepted content types intentionally exposed? |
| signatures | Can a trusted key establish card integrity and origin? |
05 //Can an Agent Card be trusted?
Answer: An Agent Card is a description, not proof of trust. It can advertise an endpoint, skills, and authentication requirements, but a client must verify the card’s origin and the remote server’s identity before sending credentials or sensitive data. A signed card can provide integrity and origin evidence when its signing key is independently trusted.
A poisoned registry entry points a “finance agent” card to an attacker-controlled interface URL. A client fetches the card and sends its bearer token and invoice data to that endpoint. The failure is trusting an unverified card as authority to choose a credential destination.
- Discover cards from an approved domain or curated registry, and verify HTTPS server identity.
- Check that each
supportedInterfacesURL belongs to the expected provider before attaching credentials. - Verify card signatures when used, with a trusted key source; do not trust a key location solely because the card advertises it.
- Keep secrets and restricted skills out of public cards; use authenticated extended cards for sensitive details.
- Allow only protocol versions and bindings that your client intentionally supports.
Signed cards: A2A 1.0 permits JWS signatures. Verification removes the signatures field and follows the specification’s field-presence rules, canonicalizes the remaining card with RFC 8785, then verifies a signature using a trusted public key. A valid signature says the card was signed by the key holder; your trust policy must still establish that this key belongs to the expected provider. Reject revoked or expired keys and review key rotation.
Extended cards: When capabilities.extendedAgentCard is true, an authenticated client may request an extended card with additional skills or detail. Authenticate and authorize that operation, return only what that caller may see, and set appropriate cache controls. A shared cache serving one customer’s extended card to another is a capability disclosure and may direct requests toward privileged endpoints.
A cached card can change endpoint URLs, skills, authentication schemes, or protocol versions when refreshed. Honor cache semantics, but reapply endpoint allowlists and signature policy after every update. Pinning a familiar display name is insufficient.
A discovered Agent Card names a familiar provider but points its interface to a new domain. What should the client do before sending a token?
07 //Where can task and artifact access leak data?
A task may outlive its initial request. Clients can get or list tasks, subscribe to updates, cancel work, and configure push notifications when the server supports them. Review every operation as a fresh authorization decision. A streaming subscriber and a webhook configuration can expose the same private task data as a direct Get Task response.
- Get and List: Scope database queries to the authenticated principal and tenant before returning task existence, status, history, or artifacts.
- Subscribe: Authorize before opening a stream; recheck access when credentials expire or permissions change.
- Cancel: Require permission to change that specific task, not just a valid token.
- Artifacts: Apply the same data policy to generated files and structured output as to the source data.
- Context: Treat conversation identifiers as grouping keys, not bearer secrets or cross-tenant access grants.
Authorize each A2A operation separately
| Operation | Read or write effect | Boundary to enforce |
|---|---|---|
| Send Message | Creates or continues work | Caller may invoke this skill and access referenced task/context |
| Get Task | Returns status, history, artifacts | Caller may read this task and its outputs |
| List Tasks | Enumerates work, possibly across contexts | Query is scoped before pagination and filtering |
| Cancel Task | Changes task state | Caller may control this task |
| Subscribe to Task | Opens an ongoing data stream | Caller may read this task for the life of the stream |
| Push notification config | Adds, lists, or removes callback destinations | Caller owns task and callback configuration |
| Get Extended Agent Card | Reveals extra capabilities | Authenticated caller may see these details |
Look for authorization in both the request handler and the store query. Filtering a fully loaded result after a query can leak existence through timing, logs, counts, or error messages. A2A specifies that authorization boundaries apply even when the client omits contextId or other filters. A List Tasks cursor must also stay bound to the same principal and filter scope.
08 //Task states, context IDs, and tenant routing
A Message is one communication turn. A Task is a server-created, stateful unit of work. Its id is generated by the server, and its status can move from submitted or working to an interrupted state (INPUT_REQUIRED or AUTH_REQUIRED) or a terminal state (completed, failed, canceled, or rejected). Results should be delivered as Artifacts associated with the Task; status Messages are for communication, not a reliable output channel.
Lifecycle decisions that affect security
| State or event | Meaning | Review question |
|---|---|---|
| SUBMITTED / WORKING | Task accepted or in progress | Was the caller allowed to start this work? |
| INPUT_REQUIRED | More input is needed | Can only the authorized caller resume the same task? |
| AUTH_REQUIRED | Additional authorization is needed | Is the requested operation explicit, and is approval verified separately? |
| COMPLETED / FAILED / CANCELED / REJECTED | Terminal task outcome | Are results and history still access controlled after completion? |
| Artifact update | Output is produced incrementally | Can every subscriber receive this artifact? |
contextId groups related Tasks and Messages into a conversation; it is not an authorization token. A client that reuses another caller’s context ID must not inherit that caller’s history or permissions. If both taskId and contextId are supplied, they must refer to the same task context. The server should reject mismatches after checking access to the underlying task.
A2A 1.0 also allows an optional tenant value on an AgentInterface. The client echoes that exact value on requests to that interface. This is an opaque routing hint that may select an agent or tenant behind a shared endpoint; it does not replace authorization based on the verified caller. Keep the routing value distinct from the organization or workspace ID derived from the credential.
A request includes tenant='acme' and a valid taskId belonging to Acme, but the token belongs to a different company. What should the server do?
09 //Code review: a cross-tenant A2A task leak
Consider this illustrative TypeScript handler behind an A2A Get Task operation. The transport and SDK are omitted so the authorization flaw is easy to see.
1async function getTask(request: Request) {
2 const token = await verifyBearerToken(request); // Authentication only
3 if (!token) throw new UnauthorizedError();
4
5 const { taskId } = await request.json();
6 const task = await db.task.findUnique({ where: { id: taskId } });
7 if (!task) throw new NotFoundError();
8
9 return task; // ❌ Any authenticated client can read any known task ID
10}A valid client token requests another tenant’s task ID. Which check is missing?
The same flaw often recurs in List Tasks, Subscribe to Task, Cancel Task, and push-notification configuration routes. Review those operations as one access-control family.
10 //A2A security code review checklist
First-pass review checks
| Area | Review question | Priority |
|---|---|---|
| Discovery | Are Agent Cards and interface URLs verified before use? | High |
| Transport | Is TLS used and is the peer identity validated? | Critical |
| Identity | Is every request authenticated from transport credentials? | Critical |
| Tasks | Are get, list, cancel, subscribe, and push config scoped to the caller? | Critical |
| Skills | Are skill and downstream actions checked against scopes and ownership? | Critical |
| Content | Are messages, Parts, files, and artifacts treated as untrusted? | High |
| Webhooks | Are destinations checked against SSRF and receivers authenticated? | High |
| Secrets | Are extra credentials obtained through a secure out-of-band flow? | High |
The protocol behavior and terminology above follow the official A2A 1.0 specification, Agent Discovery guide, Multi-Tenancy guide, and Enterprise Features guide. The official streaming guide covers push and webhook behavior. Check the protocol version supported by the agent you are integrating.