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.
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).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, available commands
updates, config
option updates,
context compactions,
user-facing notices,
and unstable prompt
suggestions.
Request cancellation
Either side can send$/cancel_request to cancel a request it sent (no response expected).
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
Unstable features
The draft schema also defines experimental features that may change or be removed before they stabilize. Each is negotiated separately, as described in Experimental Features and Negotiation. Where the draft pages don’t describe a feature yet, its RFD is the reference.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.
- Extensibility covers custom data, methods, and capabilities.
- The Test Compatibility Kit checks an Agent implementation against the protocol.