kosa8 / Integrations / OpenHands

Integration · OpenHands · Last checked: November 2026

Run OpenHands in a microVM sandbox

OpenHands runs its agent in Docker containers and is given the Docker socket to start them, so it controls whichever Docker engine it is pointed at. Give it one that lives inside a microVM: a kosa8 Cloud sandbox created with --docker runs its own dockerd, so OpenHands, the containers it starts and the socket all stay inside that VM, away from your computer. You reach the web UI through an SSH tunnel to the sandbox.

01How it works

The universal image has the Docker CLI, dockerd, containerd and runc. With --docker and a size, the sandbox may run its own daemon, and it is persistent, so the daemon outlives the command that starts it. The sandbox's container then has the privileges a daemon needs (its own cgroup tree, every capability, no seccomp filter), and those hold only inside its microVM, which is the isolation boundary. Egress rules are enforced on the host, outside the VM, and no other sandbox shares it. Sandboxes with Docker enabled always run on a kosa8 host.

kosa8's local Docker-compatible API is not the route here: kosa8 refuses on purpose to mount its API socket into a container, and OpenHands' documented command mounts it. A whole VM with its own engine gives OpenHands the socket it expects.

02Steps

  1. Install kosa8 and sign in to kosa8 Cloud. Sign-in opens your browser; an API key works too.

  2. Create a sandbox that may run Docker. --ttl 4h --on-timeout delete deletes it after four hours if you forget.

  3. Start Docker inside it. -d starts the daemon in the background and returns at once. The second command checks it.

  4. Start OpenHands inside the sandbox. This is OpenHands' documented docker run, detached, with the UI bound to the sandbox's own 127.0.0.1. The socket it mounts is the sandbox's. Image versions are OpenHands'; check its docs for the current ones.

    terminal
    kosa8 cloud sandbox exec openhands -- docker run -d --pull=always \
        -e AGENT_SERVER_IMAGE_REPOSITORY=ghcr.io/openhands/agent-server \
        -e AGENT_SERVER_IMAGE_TAG=1.26.0-python \
        -v /var/run/docker.sock:/var/run/docker.sock \
        -v /workspace/.openhands:/.openhands \
        -p 127.0.0.1:3000:3000 \
        --add-host host.docker.internal:host-gateway \
        --name openhands-app \
        docker.openhands.dev/openhands/openhands:1.8
  5. Open the UI through a tunnel. Then open http://localhost:3000 on your computer and enter your model provider and key in OpenHands' settings.

  6. Delete it when you are done. Its disk is wiped, including what OpenHands stored.

03Settings

SettingValue hereWhy
--size4x8 (4 vCPUs, 8 GiB)--docker needs a sized create; OpenHands runs several containers
--imagekosa8-template/universal-24.04-20261115.2Has dockerd, containerd, runc and the Docker CLI
--dockeronLets the sandbox run its own dockerd
--ttl, --on-timeout4h, deleteA deadline, so a forgotten sandbox does not keep running
--allow, --preset, --no-internetnot set: the organization's policyImage pulls use the sandbox's network too, so a tight list must include the registries
UI port127.0.0.1:3000 inside the sandboxReached only through kosa8 cloud ssh ... -L, not published
OpenHands state/workspace/.openhandsOn the sandbox's disk; deleted with the sandbox

04What this protects against, and what it does not

What it protects against

  • OpenHands' Docker socket controlling your computer's Docker engine: the socket belongs to the sandbox's engine.
  • The agent's containers sharing your kernel: they share the microVM's kernel, not yours.
  • Your files, SSH keys and other projects: none of them are in the VM.
  • Network rules being changed from inside: egress policy is enforced on the host, outside the VM.

What it does not

  • Your model key: you enter it in OpenHands, so it is inside the VM. Use a dedicated key with a spending limit.
  • Isolation between OpenHands' own containers: inside a --docker sandbox they run with every capability and no seccomp filter, so the microVM is the only boundary.
  • The network: it follows your organization's policy unless you set --allow or --no-internet.
  • A tested setup: kosa8 documents Docker inside a sandbox; OpenHands itself was not run in it for this page.

kosa8 limits what a hijacked agent can reach; it does not detect or prevent prompt injection. SOC 2 Type II is in progress; there is no SOC 2 report and no external penetration test yet.

05Questions

Why not point OpenHands at kosa8's local Docker API?

OpenHands' documented command mounts the Docker socket into its app container, and kosa8 refuses on purpose to mount its own API socket into a container, because a container holding the socket controls every other container. A kosa8 Cloud sandbox with its own dockerd gives OpenHands a socket that controls only that VM.

Does OpenHands' Docker socket reach my computer?

No. The socket it mounts is the sandbox's own Docker engine, inside a microVM on a kosa8 host. Your computer only runs the SSH tunnel to the UI.

Is the OpenHands web UI public?

Not in this recipe. It is bound to 127.0.0.1 inside the sandbox and reached through kosa8 cloud ssh with -L 3000:localhost:3000. A kosa8 preview link would also work, but it serves the port at an https URL.

Has kosa8 tested OpenHands in this setup?

No. kosa8 documents running Docker inside a sandbox created with docker enabled; OpenHands itself was not run for this page. Check OpenHands' docs for its current image names and settings.

Does this stop prompt injection in OpenHands?

No. It limits what an injected instruction can reach: the sandbox's own disk and engine, and the hosts its egress policy allows. It does not detect or block the injection itself.

06Get started

The reference for this page, with every option, is in the kosa8 docs: OpenHands in a microVM.

To try a kosa8 sandbox without installing anything or making an account, kosa8.com/try runs code in a fresh sandbox with no outbound network: 15 minutes of run time free per 24 hours, each run up to 60 s.

Try it free See pricing

Try free with no account. Starter is free with no card; plans from $29 a month.

Last checked: November 2026 · Updated 2026-11-29