Communication model
The protocol follows the JSON-RPC 2.0 specification with two types of messages:- Methods are request-response pairs that expect a result or error.
- Notifications are one-way messages that don’t expect a response.
null. An error response has id: null only when the request ID could not be
determined.
A receiver rejects a message that has a method and an id of null with -32600 (Invalid request) and id: null. It does not treat the message as a notification.
Both sides send requests, and each side chooses IDs for its own requests independently, so the same ID can be in use in both directions. A sender MUST NOT reuse an ID while a request with that ID is still awaiting a response.
Unlike base JSON-RPC, ACP does not use batches. See Transports.
Message flow
A typical flow follows this pattern:1
Initialization phase
- Client → Agent:
initializeto establish connection - Client: completes an advertised authentication flow if required. For example,
auth/loginfor an Agent-handled method or launch and reconnect for a terminal method
2
Session setup, either:
- Client → Agent:
session/newto create a new session - Client → Agent:
session/resumeto resume an existing session
3
Prompt lifecycle
- Client → Agent:
session/promptto send user message - Agent → Client:
session/promptresponse once the prompt is accepted - Agent → Client:
session/updatenotifications for accepted messages, state updates, progress updates, and user-facing notices - Agent → Client: Permission requests as needed
- Client → Agent:
session/cancelto cancel foreground work if needed - Agent → Client: An idle
state_updatewith a stop reason when foreground work ends, even if background activity continues
Agent
Agents are programs that use generative AI to autonomously modify code. They typically run as subprocesses of the Client.Baseline methods
Some baseline methods are optional as a group. An Agent that returns a non-emptyauthMethods list MUST implement both auth/login and auth/logout. If authMethods is omitted or empty, Clients MUST NOT call either method. The session/* methods require capabilities.session.
Send user prompts to the
Agent.
Optional methods
Change a session configuration
option (required when
the Agent advertises config options).
Delete a session (requires the
session.delete
capability).Cancel one tool call
(required when the Agent advertises
capabilities.cancel on a tool call).Stop one terminal’s process
(required when the Agent advertises
capabilities.cancel on a terminal).Notifications
Cancel the session’s foreground
work (no response expected).
Client
Clients provide the interface between users and Agents. They are typically code editors (IDEs, text editors) but can also be other UIs for interacting with Agents. Clients manage the environment, handle user interactions, and control access to resources.Baseline methods
Request user authorization
for operations such as tool calls and commands.
Optional methods
Request structured information from the user
(requires the matching
elicitation mode capability).Notifications
Report completion of an out-of-band URL
interaction (no response expected).
Send session updates
to inform the Client of changes (no response expected). This includes message
updates and chunks, tool calls, updates, and content
chunks, display-only terminal state and output
chunks,
plans, subagent sessions,
available commands
updates, config option
updates, context
compactions, and
user-facing notices.
Request cancellation
Either side can send$/cancel_request to cancel a request it sent (no response expected).
Retrying requests
When a response is lost, for example because the connection ended, the sender cannot tell whether the request took effect. Each method has one of four retry classes:
Requests the Client sends:
Requests the Agent sends:
Notifications:
Argument requirements
- All file paths in the protocol MUST be absolute, in the native syntax of the machine the Agent runs on (for example
/home/user/project,C:\Users\user\project, or\\server\share\project), and are not URIs. - Line numbers are 1-based
Error handling
All methods follow standard JSON-RPC 2.0 error handling:- Successful responses include a
resultfield - Errors include an
errorobject withcodeandmessage - Notifications never receive responses (success or error)
Conventions
Unless explicitly defined otherwise in the schema, ACP-defined JSON object property keys usecamelCase. String values carried by discriminator fields use snake_case. The JSON-RPC envelope fields (jsonrpc, id, method, params, result, and error) follow the JSON-RPC 2.0 specification.
For an optional field whose schema allows null, omitting it and setting it to null are equivalent, unless the field says otherwise. Optional fields whose schema does not allow null, such as most arrays and objects, are omitted rather than sent as null. Upsert updates are the exception: there an omitted field leaves the stored value unchanged and null clears it.
Selected enum-like fields and tagged unions can define custom or future fallbacks. For those fields, _-prefixed values are reserved for implementation-specific extensions, while unknown non-underscore values are reserved for future ACP variants.
Extensibility
Implementations can extend the protocol without breaking compatibility:- Add custom data using
_metafields - Create custom methods by prefixing their name with underscore (
_) - Advertise custom capabilities during initialization
Next steps
- Security Considerations covers the trust model. Read it before shipping an Agent or Client.
- Initialization covers version and capability negotiation.
- Session Setup covers creating, resuming, and closing sessions.
- Prompt Lifecycle covers how prompts run and how Agents report progress.
- Subagents covers the child sessions an Agent delegates work to.
- Extensibility covers custom data, methods, and capabilities.
- The Test Compatibility Kit checks an Agent implementation against the protocol.