Run agent harnesses in a sandbox

Preview

Run Claude Code, Codex and OpenCode in a sandbox of the ubuntu template, with the API key of their vendor, a subscription, or the open models of Munito AI.

The ubuntu template has Claude Code (claude), Codex (codex) and OpenCode (opencode) installed. In a sandbox, an agent has a Linux computer of its own: it installs packages, runs tests and Docker, and changes files, and none of it reaches your machine.

HarnessVendor API keySubscriptionOpen models of Munito AI
Claude CodeANTHROPIC_API_KEYClaude Pro or Max, signed in over SSHAnthropic-compatible endpoint
CodexCODEX_API_KEYChatGPT, signed in over SSHResponses API
OpenCodeThe provider's keyGitHub Copilot, OpenCode Zen or GoOpenAI-compatible provider

How a harness runs in a sandbox

  1. Create a sandbox from ubuntu, and put the keys of the harness in env. Every command and every SSH shell of the sandbox gets that environment.
  2. Run one task with a command, or open a shell over SSH and use the harness in its terminal UI.
  3. Read the result from the output of the command, or from the files of the sandbox.
curl -sS --fail-with-body https://api.munito.ai/sandboxes/v1/sandboxes \
  -H "Authorization: Bearer $MUNITO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template": "ubuntu", "timeout": 3600, "env": {"ANTHROPIC_API_KEY": "sk-ant-..."}}'
  • Commands and SSH shells run as root. Each page gives the flags that let its harness work without asking for approval, as root.
  • A command runs for at most 30 minutes. For a longer task, start the harness in the background with nohup and read its log with later commands, or run it in tmux over SSH (apt-get install -y tmux).
  • To keep the work of an agent across pauses, create a persistent sandbox.

Keep keys safe

  • Every program in the sandbox can read its environment, the agent included. Give the sandbox a key that you can revoke, with the smallest permission and spend limit that the task needs.
  • To give a key to one command only, put it in the env of that command, not of the sandbox.
  • Sign in to a subscription inside the sandbox, over SSH. Its sign-in then stays in the sandbox and never passes through the API.
  • Delete the sandbox when the task ends, or let its timeout end it.