OpenHands: The Open-Source AI Agent That Codes Like an Engineer
Open Source 5 min read intermediate

OpenHands: The Open-Source AI Agent That Codes Like an Engineer

OpenHands is an MIT-licensed, self-hostable AI coding agent that works in a Docker sandbox to write code, run tests, and open PRs.

Marcus Rivera
Marcus Rivera
Jul 23, 2026

OpenHands: The Open-Source AI Agent That Codes Like an Engineer

Most "AI coding assistants" autocomplete. OpenHands does the job. It opens a terminal, writes files, runs your test suite, reads the failures, and iterates until the task is done — then hands you a pull request. And it's MIT-licensed, so you can run the whole thing on your own hardware.

If you've been watching the coding-agent space and wondering which open-source option is actually worth self-hosting, this is the one to know.

From OpenDevin to a real platform

OpenHands started life in 2024 as OpenDevin — a community answer to the closed, hype-heavy Devin demo. It rebranded to OpenHands in late 2024 under the All-Hands-AI organization, raised an $18.8M Series A, and has since grown into one of the most-starred coding agents on GitHub, north of 70,000 stars.

The pitch is simple and, unusually for this category, honest: give an LLM the same tools a human engineer uses, sandbox it so it can't wreck your machine, and let it work.

The agent isn't a chatbot bolted onto your editor. It's a worker with a terminal, a browser, and a filesystem.

How it actually works

Every OpenHands session runs inside an isolated Docker container. That's the core design decision, and it's the right one. The agent gets root inside a disposable sandbox where it can:

  • Run shell commands — install dependencies, execute scripts, invoke your build
  • Edit code — create and modify files across a whole repository, not just one buffer
  • Browse the web — pull up documentation or API references mid-task
  • Run and read tests — the feedback loop that separates real agents from autocomplete

Because the sandbox is a container, a botched rm -rf hits the throwaway environment, not your laptop. The one real friction point is Docker-in-Docker: OpenHands needs access to the Docker socket to spawn those sandboxes, which takes a moment to wrap your head around on first setup.

Installing it

OpenHands is deep into a V0 → V1 architecture transition (V0 was deprecated in April 2026), and the tooling reflects that. The current CLI docs recommend the uv package manager and Python 3.12+ rather than a bare pip install:

uv tool install openhands --python 3.12
openhands

The first run walks you through configuring your LLM provider, and your settings persist to ~/.openhands/settings.json for next time.

Prefer full isolation? The documented Docker path spins the CLI up inside a container and mounts the Docker socket so the agent can create its own sandboxes:

docker run -it --pull=always \
  -e SANDBOX_USER_ID=$(id -u) \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v ~/.openhands:/root/.openhands \
  --add-host host.docker.internal:host-gateway \
  python:3.12-slim \
  bash -c "pip install uv && uv tool install openhands --python 3.12 && openhands"

The PyPI package itself is published as openhands-ai — worth knowing if you're pinning versions in a project.

Bring your own model — and your own bill

OpenHands is model-agnostic. Point it at a frontier API (Claude, GPT, Gemini) for maximum capability, or wire it to an open-weight backend if you want everything local.

That choice drives everything, including the benchmark numbers. On SWE-bench Verified — the standard test of resolving real GitHub issues — OpenHands reports scores around 77% when paired with a top-tier Claude model. Swap in a small open-weight coder like a ~24B model and the score drops into the mid-40s. The harness is the same; the brain is what changes.

The practical takeaway: your token bill and your results are the same knob. A cheap local model makes OpenHands nearly free and merely helpful. A frontier model makes it expensive and genuinely capable of closing tickets unsupervised.

What's missing

No agent is magic, and OpenHands is refreshingly self-aware about its rough edges.

  • The V0 → V1 churn is real. APIs and CLI flags are shifting under an active rewrite. If you build automation on top, expect to chase breaking changes for now.
  • Docker-in-Docker setup trips people up. It's a legitimate first-run hurdle, especially in CI or on locked-down machines.
  • Long autonomous runs still drift. Like every coding agent, it can wander down a wrong path and burn tokens. Planning Mode and tighter task scoping help, but a human still needs to review the PR.

None of these are dealbreakers. They're the honest cost of running a genuinely autonomous agent instead of a glorified snippet generator.

The Bottom Line

OpenHands is the strongest open-source bet for teams that want an autonomous coding agent without surrendering their code to a black box. The MIT license, the sandboxed-container design, and the model-agnostic backend give you control that closed tools simply won't. Just go in clear-eyed: pair it with a frontier model to see what it can really do, keep a human on the PR review, and expect a few sharp edges while the V1 rewrite settles.