- Author(s): @xtmq
- Champion: @benbrandt
Elevator pitch
What are you proposing to change?Add an
auth/status method and corresponding capability that allows clients to query the agent’s current authentication state. This lets clients determine whether the agent is already configured with valid credentials or requires authorization before creating a session, without relying on the ambiguous error behavior of session/new.
Status quo
How do things work today and what problems does this cause? Why would we change things?Currently, there is no dedicated way for a client to determine whether an agent has valid authentication configured. The typical workaround is:
- Call
initialize - Call
session/new - If the agent has no credentials, it may return an authorization error
- The client handles the error and initiates an authorization flow
- Unreliable detection: The
session/newmethod is not required by the specification to check authorization. Some agents validate credentials eagerly, others do so lazily (e.g., on the first LLM call). The client cannot rely onsession/newto consistently surface auth issues. - Wasted resources: Creating a session only to discard it on auth failure is wasteful, especially if session creation has side effects (resource allocation, logging, history file creation, etc.).
- Poor user experience: The client cannot proactively guide the user through authorization before session creation. Instead, users encounter errors mid-flow.
Shiny future
How will things play out once this feature exists?Clients will be able to:
- Discover whether an agent supports auth state queries via capabilities during initialization
- Query the agent’s current authentication state immediately after initialization
- Make an informed decision about whether to proceed with session creation, initiate an authorization flow, or configure endpoints (e.g., via
setLlmEndpoints) - Provide clear, proactive UX — e.g., showing a “Sign in” prompt before any session is created
- Completely skip authentication process if the agent is already authenticated
Implementation details and plan
Tell me more about your implementation. What is your detailed implementation plan?
Intended flow
The client callsinitialize, inspects capabilities to confirm auth/status support, then queries auth state before deciding how to proceed.
- Initialization: The client calls
initialize. The agent responds with capabilities, includingauth/statussupport viaagentCapabilities.auth. - Auth state query: The client calls
auth/status. The agent inspects its local configuration, stored credentials, or environment to determine the current auth state. - Client-side decision: Based on the response, the client either proceeds to session creation or initiates an authorization flow first.
Capability advertisement
The agent advertises support for theauth/status method via the existing auth capability in agentCapabilities:
auth/status method
A method that can be called after initialization to query the agent’s current authentication state.
JSON Schema Additions
Example Exchange
auth/status Request:Behavior
-
Capability advertisement: The agent SHOULD include
auth.statusinagentCapabilitiesif it supports theauth/statusmethod. Clients MUST check for this capability before calling the method. -
Timing: The
auth/statusmethod MUST be callable afterinitialize. It MAY be called multiple times (e.g., afterauthenticate, to re-check state). -
Local checks only: The agent MAY determine auth state based on locally available information (config files, environment variables, stored tokens) or by making external API calls.
authenticated: truemeans credentials are present, NOT that they are guaranteed to be valid. -
No side effects: Calling
auth/statusMUST NOT modify any agent state. It is a pure query. -
Aggregate response: The response includes only top-level
authenticatedand optionalmessage, keeping the API surface minimal and avoiding per-method complexity.
Frequently asked questions
What questions have arisen over the course of authoring this document?
Why not rely on session/new errors?
The session/new method is designed for session creation, not for auth validation. Per the specification, agents are not required to validate credentials during session creation — some agents defer validation to the first actual LLM call. This means a successful session/new does not guarantee the agent is authenticated, and a failed session/new may fail for reasons unrelated to authentication. A dedicated method provides a clear, unambiguous signal.
Why not include auth state in the initialize response directly?
The initialize response contains capabilities — what the agent supports. Auth state is runtime information — what the agent currently has configured. Mixing these concerns would make initialize less predictable. Additionally, auth state may change after initialization (e.g., after a setLlmEndpoints call), and a separate method allows re-querying.
Why not just check for the presence of environment variables on the client side?
Agents may obtain credentials from many sources: config files, keychains, OAuth tokens, environment variables, or even embedded keys. The client has no visibility into these mechanisms. Only the agent knows whether it has usable credentials configured.Why did we remove additional auth details from auth/status for now?
Extra fields (such as per-auth-method state or “which auth method was used”) are not consistently well-defined across agents. In practice, one auth flow can enable multiple credential types (for example, terminal login resulting in an API key), so a strict 1:1 mapping can be ambiguous and potentially misleading for clients.
To avoid locking in confusing semantics, the proposal currently keeps auth/status minimal and reliable: top-level authenticated plus optional message. This solves the immediate UX and control-flow problem while preserving room to add richer, standardized details later once cross-agent semantics are clearer.
Revision history
- 2026-07-21: Accepted as a Draft RFD
- 2026-03-15: Remove
authMethodsfrom the proposal and keep aggregate auth state only (authenticated+ optionalmessage) - 2026-03-10: Rename
getAuthStatetoauth/status, nest capability underagentCapabilities.auth - 2026-03-07: Address review feedback on auth state structure
- 2026-03-05: Initial draft — preliminary proposal to start discussion