OpenHands CLI: safety, approval modes and how to run it
How the OpenHands CLI handles confirmation, LLM approval and always-approve, where it keeps state, its 2026 advisory and how to run it more safely.
- Made by
- All Hands AI (OpenHands)
- Runs in
- Terminal UI, Headless CLI, Editor integration (ACP), Local web UI, Docker GUI server, OpenHands Cloud, Agent Canvas
- Platforms
- Python 3.12+ with uv, Standalone binary
- Licence
- MIT, open source
1 public advisory
Security advisories and reported issues since 2025, from vendor advisories, NVD and public reports. Checked December 2, 2026.
On this page
What OpenHands CLI is
The OpenHands CLI runs the OpenHands agent in your terminal, as an editor integration over the Agent Client Protocol, in headless mode for scripts, or as a local web UI. It is built on the OpenHands Software Agent SDK and asks you to confirm each action by default. The same project also offers a Docker based GUI server (openhands serve), OpenHands Cloud, and Agent Canvas, a self-hosted control center that the OpenHands/OpenHands repository now contains. The CLI repository's README says the CLI is no longer actively maintained and recommends Agent Canvas instead.
Install OpenHands CLI
CLI with uv (recommended by the README):
uv tool install openhands --python 3.12CLI standalone binary:
curl -fsSL https://install.openhands.dev/install.sh | shAgent Canvas (the project's replacement):
npm install -g @openhands/agent-canvasOpenHands CLI news and advisories
Releases and announcements, with public security advisories on the same line.
OpenHands/OpenHands released v1.48.0 of Agent Canvas, which adds automation grouping, tag grouping for conversations and adding secrets, MCP servers and models during a conversation. The repository now describes itself as Agent Canvas rather than the older web app.
OpenHands release pageThe latest commit on the CLI repository bumps the certifi dependency to 2026.10.19 or newer. It is labelled a security fix. It was the last commit on main at the time of checking.
OpenHands CLI repositoryOpenHands CLI 1.16.0 was published as the latest CLI release. It remains the newest of the 25 tagged releases.
OpenHands CLI release pageOpenHands published advisory GHSA-7h8w-hj9j-8rjw for a command injection in the app server's git diff route, fixed in 1.5.0.
GitHub Security Advisory- GHSA-7h8w-hj9j-8rjw
Command injection in the git diff handler of the OpenHands app server (CVE-2026-33718, CVSS 7.6). The path parameter of the git diff API route went into a shell command unescaped, so an authenticated user could run commands in the runtime container as root. The advisory lists the pip package openhands, versions up to 1.4.0. It is about the app server, and no advisories are published for the CLI repository.
GitHub Security Advisory
How OpenHands CLI keeps itself in bounds
Out of the box, asks for confirmation on each action.
| Mode | How to turn it on | Asks you | What it allows |
|---|---|---|---|
Confirm each action | openhands (default), or /confirm inside the CLI | Before each action | The agent proposes an action and waits for your answer. The dialog also offers a rejection with a reason. |
LLM-based approval | openhands --llm-approve (also on openhands acp) | For some actions | A security analyzer driven by an LLM judges each action, so the model helps decide what needs your approval. |
Always approve | openhands --always-approve (the README also shows --yolo) | Never | Approves every action without asking, including shell commands and file edits. |
Headless | openhands --headless -t "task" or -f file | For some actions | No UI for answering prompts, so it needs a task up front. The docs reviewed do not say how approvals work here, so test it before relying on it in CI. |
Where its settings live
| Path | What it holds |
|---|---|
~/.openhands/agent_settings.json | Saved LLM and agent settings, including the condenser config |
~/.openhands/cli_config.json | CLI and terminal UI preferences, such as whether the critic is on |
~/.openhands/mcp.json | MCP server configuration |
~/.openhands/conversations/ | Conversation history that --resume reads |
- The terminal CLI runs the agent's commands on your machine with your user account. Confirmation mode is the main control, and the only container in the CLI is the Docker GUI server started by openhands serve, which can mount your current folder with --mount-cwd.
- The SDK that powers the CLI has a security analyzer that rates actions by risk. Its docs describe a confirm-risky policy that asks at or above a threshold, with HIGH as the default, and say the analyzer can be turned off for trusted environments.
- The LLM-based approval flag lets a model judge actions, so it is a convenience check rather than a hard boundary. Always-approve removes the prompt entirely.
- By default the CLI ignores LLM_API_KEY, LLM_MODEL and LLM_BASE_URL in the environment. You must pass --override-with-envs to apply them, and they are not saved.
- openhands web binds to 0.0.0.0 on port 12000 by default, so pass --host 127.0.0.1 unless you mean to share it on your network.
Security incidents and advisories
| Date | Advisory | What happened |
|---|---|---|
Command injection in the git diff handler of the OpenHands app server (CVE-2026-33718, CVSS 7.6). The path parameter of the git diff API route went into a shell command unescaped, so an authenticated user could run commands in the runtime container as root. The advisory lists the pip package openhands, versions up to 1.4.0. It is about the app server, and no advisories are published for the CLI repository.Fixed in 1.5.0 |
How to run OpenHands CLI safely
- Keep the default confirm mode for anything that touches a real repository, and read each shell command before you approve it.
- Do not use --always-approve or --yolo on your main machine. If you need unattended runs, use a throwaway container or VM with no access to your home folder.
- Use openhands serve --mount-cwd to run the GUI in Docker, and mount only the project folder you want it to edit.
- Start openhands web with --host 127.0.0.1 so the browser UI is not reachable from your network.
- Give the agent a scoped, short-lived Git token and a model key with a spending limit, and keep both out of the folder it works in.
- Review MCP servers in ~/.openhands/mcp.json before you enable them, because each one adds tools the agent can call.
- Work on a git branch and read the diff before you merge. Check ~/.openhands/conversations/ if you need to see what it did.
- Because the CLI is no longer actively maintained, plan a move to Agent Canvas and keep its dependencies up to date.
Where Excellent fits
| What Excellent does | With OpenHands CLI |
|---|---|
Reads its session logs (free scan) | Yes |
Its key finder reads its key files | Yes |
Live check before risky actions (Pro) | Yes, in its own hook settings |
Before a force push to main | Refuses and tells OpenHands CLI to ask you |
Excellent's sandbox | Claude Code and Codex only |
Rule sharing | Claude Code and Codex only |
Excellent reads OpenHands CLI's session logs on your Mac. The free scan shows what it did: your email in request commands or form inputs, keys sitting in logs, secrets files read, history overwritten, checks skipped. Each finding says which agent and where.
With Pro, Excellent adds its live check to OpenHands CLI's own hook settings, after listing what it will change. It blocks your email on its way to a website, an API key typed into a command, and deleting a folder you marked never-delete.
Excellent's check can't make OpenHands CLI stop and ask you. So before a force push to main or skipping git hooks, it refuses and tells OpenHands CLI to ask you first.
Excellent's sandbox and rule sharing are for Claude Code and Codex only. The check reads what a command says, so it isn't a wall around your Mac.
Questions
Does the OpenHands CLI run commands in a container?
Not in the terminal UI. It runs commands on your machine with your account, so confirm mode matters. The openhands serve GUI runs in Docker, and OpenHands Cloud runs on the vendor's own infrastructure.
What is the default approval mode?
It asks you to confirm each action. You can switch with /confirm, or start with --llm-approve for LLM-based approval or --always-approve to skip prompts.
Is the OpenHands CLI still maintained?
Its README says it is no longer actively maintained and recommends Agent Canvas. The OpenHands/OpenHands repository is active and shipped v1.48.0 on December 2, 2026.
Where does the OpenHands CLI store its settings?
In ~/.openhands/, which holds agent_settings.json, cli_config.json, mcp.json and a conversations folder.
Does the OpenHands CLI support MCP?
Yes. Use openhands mcp add, list, enable and disable to manage stdio, http and sse servers, which are stored in mcp.json.
Sources
Checked December 2, 2026. OpenHands CLI changes often, so its own docs win where they differ from this page.
- OpenHands CLI repository README
- OpenHands CLI command reference
- OpenHands SDK: Security and action confirmation
- OpenHands repository (Agent Canvas)
- OpenHands release v1.48.0
- OpenHands CLI releases
- OpenHands CLI security advisories
- OpenHands security advisories
- Advisory GHSA-7h8w-hj9j-8rjw
- NVD: CVE-2026-33718