diff --git a/openhands/usage/run-openhands/acp.mdx b/openhands/usage/run-openhands/acp.mdx index 69cff159..bee4c23f 100644 --- a/openhands/usage/run-openhands/acp.mdx +++ b/openhands/usage/run-openhands/acp.mdx @@ -31,16 +31,54 @@ OpenHands CLI currently supports the following ACP features: - Initialization - version negotiation and capability exchange - Session Setup - creating new sessions and loading existing ones - Content - including embedded content and resources -- Prompt Turns - sending prompts and receiving responses (permissions coming soon) +- Prompt Turns - sending prompts and receiving responses with permission support - Tool Calls - executing tools and returning results - Agent Plan - sharing agent's planned actions - -**🚧 Coming Soon:** -- Confirmation - user authorization for tool calls -- Slash Commands - for changing confirmation mode +- Confirmation Mode - user authorization for tool calls and prompt turns +- Slash Commands - for changing confirmation mode during a session Feel free to open issues on the [OpenHands-CLI repo](https://github.com/OpenHands/OpenHands-CLI/issues) if you have feature requests or encounter any problems. +## Confirmation Modes + +OpenHands ACP supports three confirmation modes to control how agent actions are approved: + +### Always Ask (Default) + +The agent will request user confirmation before executing each tool call or prompt turn. This provides maximum control and safety. + +```bash +openhands acp # defaults to always-ask mode +``` + +### Always Approve + +The agent will automatically approve all actions without asking for confirmation. Use this mode when you trust the agent to make decisions autonomously. + +```bash +openhands acp --always-approve +``` + +### LLM-Based Approval + +The agent uses an LLM-based security analyzer to evaluate each action. Only actions predicted to be high-risk will require user confirmation, while low-risk actions are automatically approved. + +```bash +openhands acp --llm-approve +``` + +### Changing Modes During a Session + +You can change the confirmation mode during an active session using slash commands: + +- `/confirm always-ask` - Switch to always-ask mode +- `/confirm always-approve` - Switch to always-approve mode +- `/confirm llm-approve` - Switch to LLM-based approval mode +- `/help` - Show all available slash commands + + +The confirmation mode setting persists for the duration of the session but will reset to the default (or command-line specified mode) when you start a new session. + ## ACP Integration @@ -84,10 +122,31 @@ To configure OpenHands CLI with Zed: } ``` + +To use a different confirmation mode by default, add the mode flag to the `args` array: + +```json +{ + "agent_servers": { + "OpenHands": { + "command": "uvx", + "args": [ + "openhands", + "acp", + "--always-approve" + ], + "env": {} + } + } +} +``` + +Replace `--always-approve` with `--llm-approve` for LLM-based approval, or omit the flag to use the default always-ask mode. + -4. Save the file +5. Save the file -5. You can now use OpenHands within Zed! +6. You can now use OpenHands within Zed! ![Zed Use OpenHands Agent](/openhands/static/img/acp-zed-use-openhands.png)