OpenHands, originally released as OpenDevin, is an open-source platform for autonomous software engineering agents that read and modify code, execute shell commands, run tests and browse the web inside an isolated sandbox in order to complete development tasks described in natural language. In AI for coding, it is one of the most widely used open alternatives to proprietary agentic coding products and a common research baseline for evaluating coding agents.
The project started in 2024 as a community response to closed autonomous developer demos, was renamed OpenHands later that year and is published under the permissive MIT license. It is model-agnostic: the same agent can run on commercial language models or on open-weight models served locally.
How the OpenHands agent loop works
OpenHands works by running an agent loop in which a language model repeatedly chooses an action, the runtime executes it, and the resulting observation is appended to the history before the next step. All actions and observations are recorded in an event stream, which serves as the memory of the session and makes every step auditable.
The default agent follows the CodeAct approach: instead of choosing from a narrow menu of tool calls, the model expresses actions as executable code, such as bash commands, Python snippets in an interactive kernel or structured file edits. Code is more expressive than fixed tool schemas, so one action can search, filter and transform data at once.
The table below lists the main action types and what the agent receives back.
| Action type | What it does | Observation returned |
|---|---|---|
| Shell command | Runs bash in the sandbox | Exit code and terminal output |
| Python execution | Runs code in an interactive kernel | Printed output or traceback |
| File edit | Views, creates or patches files | Updated file content or diff |
| Browser action | Navigates and reads web pages | Page text and accessibility tree |
| Message | Asks the user or reports progress | User reply, if any |
| Finish | Declares the task complete | Session summary |
Architecture and deployment options
OpenHands separates the agent controller from the runtime. The controller manages prompts, history condensation and model calls, while the runtime is usually a Docker container in which commands execute without touching the host system. This separation is the main safety mechanism and allows the same agent to run locally, on a remote server or in a hosted service.
Model access goes through an abstraction layer that supports many providers, so teams can switch models by configuration. Long sessions rely on context condensation, which summarizes older events so the history fits within the model’s context window.
The following table compares the common ways to run OpenHands.
| Mode | Interface | Typical use |
|---|---|---|
| Local GUI | Web interface on the developer machine | Interactive tasks with supervision |
| Command line | Terminal client | Quick tasks inside an existing repository |
| Headless mode | Scripted, no user interaction | Batch jobs and benchmark runs |
| Repository integration | Issue or pull request trigger | Automated fixes from issue labels |
| Hosted cloud | Managed service | Teams that avoid self-hosting |
OpenHands compared with other coding agents
OpenHands belongs to the family of autonomous coding agents, but it differs from editor assistants and other open agents in scope and design. The comparison below highlights the main distinctions.
| Tool | Primary setting | Distinguishing trait |
|---|---|---|
| OpenHands | Sandboxed autonomous platform | CodeAct actions, browser, event stream |
| SWE-agent | Research agent for issue fixing | Custom agent-computer interface |
| Aider | Terminal pair programmer | Git-centered edits with repository map |
| Cline | Editor extension | Step approval inside the IDE |
| Replit Agent | Hosted app builder | Builds and deploys whole applications |
OpenHands is frequently evaluated on SWE-bench Verified, a benchmark of real GitHub issues checked by hidden tests. Reported resolution rates depend heavily on the underlying model, prompt design and number of attempts, so a single score describes a configuration, not the platform in isolation.
Using OpenHands effectively
Results improve markedly when tasks are small, specific and verifiable. A request such as fixing a named failing test gives the agent a clear success signal, whereas a vague request to improve the code invites unfocused changes. Repository instructions, for example a file of conventions and build commands, reduce wasted steps.
Model choice is the largest single factor in outcome quality. Strong frontier models handle multi-step debugging well, while smaller open-weight models served locally reduce cost and keep code private but fail more often on long tasks. Many teams set a budget limit per task, such as a maximum number of steps or a spending cap, so that unproductive runs stop early instead of consuming tokens indefinitely.
The table below rates typical tasks by how well they suit an autonomous agent.
| Task | Suitability | Reason |
|---|---|---|
| Fix a bug with a reproducing test | High | Tests confirm success automatically |
| Add a small feature with clear specification | High | Scope and acceptance are explicit |
| Upgrade a dependency across a repository | Medium | Many files, but mechanical changes |
| Redesign the system architecture | Low | Requires judgment and stakeholder input |
Limitations and risks
Autonomy shifts effort from writing code to reviewing code, and OpenHands does not remove that responsibility. Teams should treat every agent change as an untrusted pull request.
- Token costs grow quickly in long sessions with many failed attempts.
- Agents can loop or stall when tests are flaky or the environment is misconfigured.
- Plausible but wrong fixes may pass weak tests while breaking untested behavior.
- Credentials in the sandbox can leak if secrets are mounted carelessly.
- Prompt injection through web pages or issue text can steer the agent toward unintended actions.
The idea in brief
OpenHands is free software that lets an AI act like a junior developer. You describe a task in plain words. The AI opens the code, makes changes, runs the tests and tries again if something fails. It works inside a sealed box, so it cannot harm your own computer.
A person still checks the result before it is used. The AI does the legwork, and a human makes the final decision.
A practical scenario
A three-person team maintains an open-source data validation library with about 40 open issues. Many are small: a misleading error message, a missing type hint, a date parsing edge case. The maintainers connect OpenHands to their repository so that adding a specific label to an issue starts an agent run in a container.
For a reported date parsing bug, the agent reads the issue, writes a failing test that reproduces it, traces the cause to a timezone conversion and submits a pull request with the fix and the new test in about fifteen minutes. A maintainer reviews the diff, requests one naming change and merges it. Over a month, the team routes about twenty small issues through the agent, merges roughly two thirds after review and closes the rest manually, which frees several evenings of maintainer time for design work.