OpenHands

Also known as: OpenDevin

On this page 7

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 typeWhat it doesObservation returned
Shell commandRuns bash in the sandboxExit code and terminal output
Python executionRuns code in an interactive kernelPrinted output or traceback
File editViews, creates or patches filesUpdated file content or diff
Browser actionNavigates and reads web pagesPage text and accessibility tree
MessageAsks the user or reports progressUser reply, if any
FinishDeclares the task completeSession summary
Core action types in an OpenHands session

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.

ModeInterfaceTypical use
Local GUIWeb interface on the developer machineInteractive tasks with supervision
Command lineTerminal clientQuick tasks inside an existing repository
Headless modeScripted, no user interactionBatch jobs and benchmark runs
Repository integrationIssue or pull request triggerAutomated fixes from issue labels
Hosted cloudManaged serviceTeams that avoid self-hosting
Ways to run OpenHands

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.

ToolPrimary settingDistinguishing trait
OpenHandsSandboxed autonomous platformCodeAct actions, browser, event stream
SWE-agentResearch agent for issue fixingCustom agent-computer interface
AiderTerminal pair programmerGit-centered edits with repository map
ClineEditor extensionStep approval inside the IDE
Replit AgentHosted app builderBuilds and deploys whole applications
OpenHands and related coding agents

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.

TaskSuitabilityReason
Fix a bug with a reproducing testHighTests confirm success automatically
Add a small feature with clear specificationHighScope and acceptance are explicit
Upgrade a dependency across a repositoryMediumMany files, but mechanical changes
Redesign the system architectureLowRequires judgment and stakeholder input
Task suitability

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.