-
Notifications
You must be signed in to change notification settings - Fork 129
Add Authentication RFD #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+139
−1
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dfebcbb
Add Authentication RFD
anna239 dfafc9d
fix formating
anna239 f46f8a8
Add suggestion for MCP-like elicitation approach for oauth authnetica…
anna239 af924bf
Add suggestion for MCP-like elicitation approach for oauth authnetica…
anna239 a24533a
Update auth rfd
anna239 a900228
fix formatting
anna239 e0da39c
fix snake case
anna239 71a61b5
Update docs/rfds/auth.mdx
anna239 4d2376e
Update based on CM discussion
benbrandt 93d600c
Update website
benbrandt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| --- | ||
| title: "Authentication Methods" | ||
| --- | ||
|
|
||
| Author(s): [anna239](https://github.com/anna239) | ||
|
|
||
| ## Elevator pitch | ||
|
|
||
| > What are you proposing to change? | ||
|
|
||
| I suggest adding more information about auth methods that agent supports, which will allow clients to draw more appropriate UI. | ||
|
|
||
| ## Status quo | ||
|
|
||
| > How do things work today and what problems does this cause? Why would we change things? | ||
|
|
||
| Agents have different ways of authenticating users: env vars with api keys, running a command like `<agent_name> login`, some just open a browser and use oauth. | ||
| [AuthMethod](https://agentclientprotocol.com/protocol/schema#authmethod) does not really tell the client what should be done to authenticate. This means we can't show the user a control for entering key if an agent supports auth through env var. | ||
|
|
||
| Very few agents can authenticate fully on their own without user input, so agents with ACP auth support are limited in the methods they can offer, or require manual setup before being run as an ACP agent. | ||
|
|
||
| ## What we propose to do about it | ||
|
|
||
| > What are you proposing to improve the situation? | ||
|
|
||
| We can add addition types of AuthMethods, to provide clients with additional information so they can assist in the login process. | ||
|
|
||
| ## Shiny future | ||
|
|
||
| > How will things will play out once this feature exists? | ||
|
|
||
| It will be easier for end-users to start using an agent from inside the IDE as auth process will be more straightforward | ||
|
|
||
| ## Implementation details and plan | ||
|
|
||
| > Tell me more about your implementation. What is your detailed implementation plan? | ||
|
|
||
| I suggest adding following auth types: | ||
|
|
||
| 1. Agent auth | ||
|
|
||
| Same as what there is now – agent handles the auth itself, this should be a default type if no type is provided for backward compatibility | ||
|
|
||
| ```json | ||
| { | ||
| "id": "123", | ||
| "name": "Agent", | ||
| "description": "Authenticate through agent", | ||
| "type": "agent" // Optional/default value | ||
| } | ||
| ``` | ||
|
|
||
| 2. Env variable | ||
|
|
||
| A user can enter a key and a client will pass it to the agent as an env variable | ||
|
|
||
| ```json | ||
| { | ||
| "id": "123", | ||
| "name": "OpenAI api key", | ||
| "description": "Provide your key", | ||
| "type": "env_var", | ||
| "varName": "OPEN_AI_KEY", | ||
| "link": "OPTIONAL link to a page where user can get their key" | ||
| } | ||
| ``` | ||
|
|
||
| Since this would need to be supplied to the agent when the process is started, the client can check if it already passed such an env variable to the process, in which case the user can click on the button and the agent will read the already available key. | ||
|
|
||
| Otherwise, when the user clicks the button, the client could restart the agent process with the desired env variable, and then automatically send the authenticate message with the correct id to sign in for the user. | ||
|
|
||
| 3. Terminal Auth | ||
|
|
||
| There have been experiments for a "terminal-auth" experience as a fallback. This requires the client to be able to run an interactive terminal for the user to login via a TUI. | ||
|
|
||
| ```json | ||
| { | ||
| "id": "123", | ||
| "name": "Run in terminal", | ||
| "description": "Setup Label", | ||
| "type": "terminal", | ||
| "args": ["--setup"], | ||
| "env": { "VAR1": "value1", "VAR2": "value2" } | ||
| } | ||
| ``` | ||
|
|
||
| The `command` cannot be specified, the client will invoke the exact same binary with the exact same setup. The agent can supply additional arguments and environment variables as necessary. These will be supplied in **addition** to any args/env supplied by default when the server is started. So agents will need to have a way to kickoff their interactive login flow even if normal acp commands/arguments are supplied as well. | ||
|
|
||
| This is so that the agent doesn't need to know about the environment it is running in. It can't know the absolute path necessarily, and shouldn't be able to supply other commands or programs to minimize security issues. | ||
|
|
||
| ### AuthErrors | ||
|
|
||
| It might be useful to include a list of AuthMethod ids to the AUTH_REQUIRED JsonRpc error. Why do we need this if they're already shared during `initialize`: | ||
| All supported auth methods are shared during `initialize`. When user starts a session, they've already selected a model, which can narrow down a list of options. | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": "2.0", | ||
| "id": 2, | ||
| "error": { | ||
| "code": -32000, | ||
| "message": "Authentication required", | ||
| "authMethods": [ | ||
| { | ||
| "id": "chatgpt", | ||
| "name": "Login with ChatGPT", | ||
| "description": "Use your ChatGPT login with Codex CLI (requires a paid ChatGPT subscription)" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Frequently asked questions | ||
|
|
||
| > What questions have arisen over the course of authoring this document or during subsequent discussions? | ||
|
|
||
| ### What alternative approaches did you consider, and why did you settle on this one? | ||
|
|
||
| An alternative approach would be to include this information to an agent's declaration making it more static, see [Registry RFD](https://github.com/agentclientprotocol/agent-client-protocol/pull/289) | ||
|
|
||
| There is also an alternative to adding a separate `elicitation` capability, which is to create a separate auth type for this. Then the client can decide themselves if they support it or not. | ||
|
|
||
| ## Revision history | ||
|
|
||
| <!-- If there have been major updates to this RFD, you can include the git revisions and a summary of the changes. --> | ||
|
|
||
| There was a part about elicitations https://github.com/agentclientprotocol/agent-client-protocol/blob/939ef116a1b14016e4e3808b8764237250afa253/docs/rfds/auth.mdx removed it for now, will move to a separate rfd | ||
|
|
||
| - 2026-01-14: Updates based on Core Maintainer discussion | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.