← Back to all spotlights

OpenHands: Run Autonomous AI Software Engineers Locally

OpenHands is an open-source autonomous AI agent platform that runs code, executes terminal commands, and resolves complex GitHub issues inside sandboxed environments.

P24
By Pickwise24 Editorial Team
Verified Open-Source Review

Quick Summary: What Is OpenHands?

OpenHands (formerly OpenDevin) is an open-source platform for autonomous AI software engineering agents developed by All-Hands-AI. Unlike basic autocomplete plugins, OpenHands acts as a full-fledged virtual software developer capable of editing multi-file codebases, running bash commands, executing unit tests, browsing web documentation, and submitting pull requests.

  • GitHub Repository: All-Hands-AI/OpenHands
  • Core Function: Autonomous software engineering, bug fixing, and task automation in sandboxed containers.
  • Key Architecture: Event-driven agent loop with Docker-isolated runtime execution and LiteLLM integration.
  • Supported Models: Anthropic Claude 3.5 Sonnet, OpenAI GPT-4o, DeepSeek-V3/R1, and local Ollama/LM Studio endpoints.

       +-------------------------------------------------------+
       |                  OpenHands Platform                   |
       |                                                       |
       |  +--------------------+     +----------------------+  |
       |  |  Agent Controller  | <-> |  Event Stream Bus    |  |
       |  +--------------------+     +----------------------+  |
       +------------|---------------------------|--------------+
                    |                           |
                    v                           v
       +-------------------------------------------------------+
       |               Sandboxed Docker Runtime                |
       |                                                       |
       |  [ Bash Engine ]   [ File Editor ]   [ Web Browser ]  |
       +-------------------------------------------------------+

The Shift from Copilots to Autonomous Software Agents

The developer tooling landscape has shifted dramatically. Autocomplete extensions and chat windows embedded in your IDE are useful for boilerplates, but they still treat you like an underpaid typist pasting snippets back and forth. When a build breaks or a integration test fails, you are still the human compiler sitting in the loop.

The industry consensus across developer communities on Reddit, X, and YouTube tech channels is clear: developers want agentic feedback loops. We want an agent that doesn't just guess code, but actually runs pytest, sees the stack trace, adjusts its implementation, re-runs the tests until they pass, and pushes a clean branch for review.

That is precisely what OpenHands delivers. It moves LLMs from static auto-suggest engines into active runtime environments, allowing agents to interact directly with terminals, file systems, and browsers while safely enclosed inside isolated Docker sandboxes.


Core Architecture and Features

Before letting an over-eager language model run wild on your repository, you need airtight isolation. OpenHands solves this by pairing a event-driven agent loop with a secure, containerised execution runtime.

1. Isolated Docker Runtime

OpenHands runs all agent actions inside a sandboxed Docker container. When the agent decides to install a Python package, modify a system binary, or execute rm -rf, it happens safely inside the container workspace—keeping your local system host completely untouched.

2. Multi-Tool Capabilities

An agent inside OpenHands isn't limited to plain text generation. It operates through three core tool systems:

  • Terminal Engine: Executes arbitrary bash commands, monitors stderr/stdout output, and reads return codes.
  • File Operations API: Performs precise line edits, creates new modules, and inspects existing repository structures.
  • Headless Browser: Navigates online documentation, reads web pages, and solves integration issues requiring fresh web context.

3. Model Agnostic via LiteLLM

While Anthropic's Claude 3.5 Sonnet remains the top model for complex logic, OpenHands isn't locked into a single provider. Thanks to built-in LiteLLM integration, you can swap between Claude, GPT-4o, DeepSeek-V3, or even locally hosted LLMs through Ollama or vLLM.


OpenHands vs. Standard Developer Tools

FeatureInline Autocomplete (Copilot)Cursor / IDE ChatOpenHands Platform
Execution ContextActive file cursorIDE file indexFull workspace sandbox
Terminal ExecutionNoOptional / Manual promptFully autonomous
Self-Correction LoopNoLimited to prompt chatYes (Runs tests & fixes)
Sandboxed SecurityN/A (Runs on Host)Host MachineIsolated Docker Container
Open SourceClosed SourceClosed Source100% Open Source

Quickstart Installation & Local Setup

Getting OpenHands running locally requires Docker and a valid LLM API key. Here is how to launch the web interface using the official Docker setup.

Step 1: Ensure Docker is Running

Verify your local system has Docker Desktop or Docker Engine installed and running:


docker --version

Step 2: Set Your Environment Variables

Export your target API key (e.g., Anthropic Claude):


export ANTHROPIC_API_KEY="your-api-key-here"
export WORKSPACE_BASE="$HOME/projects/my-app"

Step 3: Run OpenHands Container

Execute the Docker run command to launch the OpenHands agent runtime and web interface:


docker run -it --rm \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.28-nikolaik \
    -e LOG_ALL_EVENTS=true \
    -e API_KEY=$ANTHROPIC_API_KEY \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -p 3000:3000 \
    --name openhands-app \
    docker.all-hands.dev/all-hands-ai/openhands:0.28

Once started, navigate to http://localhost:3000 in your web browser to open the OpenHands GUI, select your repository, and begin issuing tasks.


Practical Usage: Fixing a Failing Test via CLI

OpenHands can also run in headless terminal mode for scriptable batch operations or integration into automated CI pipelines.

Below is an example configuration file (config.toml) for running OpenHands headlessly using local configurations:


[core]
workspace_base = "./my-python-project"
default_agent = "CodeActAgent"

[llm]
model = "anthropic/claude-3-5-sonnet-20241022"
api_key = "env:ANTHROPIC_API_KEY"
temperature = 0.0

To invoke OpenHands directly to fix a failing test suite in your workspace:


python -m openhands.core.main \
  -i "Run pytest on the repository. Locate any failing unit tests in tests/test_auth.py, fix the underlying bug, and verify all tests pass."

Example Agent Event Loop Trace:

1. Action: Runs pytest inside the Docker sandbox terminal.

2. Observation: Catches AssertionError: Expected status code 200, got 401.

3. Action: Opens src/auth/jwt.py and inspects token generation logic.

4. Action: Applies diff edit to update token expiration headers.

5. Action: Re-runs pytest.

6. Observation: All 14 tests pass (exit code 0).

7. Task Complete: Agent returns control to the user.


Key Takeaways

  • Sandboxed Security: Runs code and terminal commands inside Docker containers, keeping host development machines safe.
  • Autonomous Feedback Loops: Detects test failures, inspects terminal logs, and iteratively refactors code until task requirements pass.
  • Flexible Model Ecosystem: Native support for Claude 3.5 Sonnet, GPT-4o, DeepSeek, and locally hosted LLMs via LiteLLM.
  • Open Source Framework: Completely customizable micro-agent framework that frees developers from proprietary, locked-down IDE extensions.

🛡️ Editorial Standards & Methodology

Every repository featured on Pickwise24 undergoes testing on local workstation hardware before publication. We verify CLI installation steps, review open-source repository licensing, benchmark computational footprint, and evaluate architectural trade-offs to provide genuine, high-utility developer intelligence.