Client agent
In A2A, the client agent is the application or agent that starts an interaction and sends messages to a remote agent on behalf of a user or system.
A client agent is the party in an A2A interaction that starts the exchange, sending messages and task operations to a remote agent on behalf of a user or another system.
Terminology. The specification calls this role the “A2A Client”. The project’s key-concepts guide also calls it the client agent and says it can be an application, a service or another AI agent. The role applies to one interaction at a time. An agent that is a client in one exchange can be the remote agent in another.
What a client agent does.
- Discovers. It fetches the remote agent’s Agent Card, picks the first entry in
supportedInterfacesthat it supports, uses that entry’s URL, and copies the entry’stenantvalue into every request if one is set. - Authenticates. It reads
securitySchemes, obtains credentials out of band, and sends them with every request. - States its version. It sends the
A2A-Versionheader on each request. Without it, the server assumes version 0.3. - Converses. It sends messages with
roleset toROLE_USER. That role marks messages from client to server, even when the client is itself an AI agent. To continue a task it includes thetaskId, and anycontextIdit sends must match the task’s. - Tracks work. It polls with
GetTask, streams withSendStreamingMessageorSubscribeToTask, or registers a push notification webhook. - Handles interruptions. It answers
TASK_STATE_INPUT_REQUIREDwith more information, and resolvesTASK_STATE_AUTH_REQUIREDby obtaining authorization.
A follow-up that answers an input-required task (the params of a SendMessage call):
{
"message": {
"messageId": "msg-2",
"taskId": "task-123",
"contextId": "ctx-1",
"role": "ROLE_USER",
"parts": [{"text": "Order 1042, placed on 3 September."}]
}
}
Chains of agents. A client agent may itself be working on a task for someone else. If a remote agent asks it for authorization, it can pass the request up by moving its own task to TASK_STATE_AUTH_REQUIRED, which forms a chain of tasks waiting on authorization.
Neighbouring terms. The remote agent is the other side of the exchange. The Agent Card is what the client agent reads first.