authMethods, Clients choose one by calling authenticate, and Agents that support ending an authenticated state advertise the logout capability.
Advertising Authentication
Agents advertise authentication options in theauthMethods field of the initialize response. Each method has an id that the Client passes back to the Agent in a later authenticate request.
Agents that support logout also advertise capabilities.auth.logout:
capabilities.auth.logout is omitted or null, the Agent does not support logout and Clients MUST NOT call it. Supplying {} means the Agent supports the method.
Authentication Method Types
The standard authentication method type isagent, where the Agent handles authentication itself. Every authentication method must include a type discriminator:
type values can be custom or future variants. Custom method types MUST begin with _. Unknown non-underscore method types are reserved for future ACP variants. Clients that do not understand a method type should preserve the raw method payload when storing, replaying, proxying, or forwarding initialization data, and otherwise ignore the method or display it generically.
See the schema for the full stable AuthMethod definition.
Authenticating
When an Agent requires authentication before allowing session creation, the Client callsauthenticate with one of the advertised authentication method IDs:
The ID of the authentication method to use. This value must match one of the
methods advertised in the
initialize response.auth_required error for authentication-gated requests.
Logging Out
Thelogout method allows Clients to end the current authenticated state. Clients should only call it after verifying the Agent advertised capabilities.auth.logout during initialization.
logout, new sessions that require authentication will require the Client to call authenticate again.
Active Sessions
The protocol does not guarantee what happens to already-running sessions afterlogout. Agents may terminate them, keep them running, or return auth_required errors for future session activity.
Clients SHOULD be prepared for active session operations to fail with authentication-related errors after logout and should prompt the user to authenticate again when appropriate.