Skip to content
Soulsand Docs

Coding agents

soulsand prompt gives a task to a coding agent in the sandbox and streams its work (text on stdout, tool calls on stderr) until the turn ends:

$ soulsand prompt my-box "make the failing tests pass"
$ soulsand prompt my-box "now add a test for the edge case"      # same conversation: it remembers
$ soulsand prompt my-box "add a /health endpoint" --agent codex --new
$ soulsand prompt my-box "review the diff" --model opus --effort high --fast
$ soulsand prompt my-box "why does this crash?" --attach error.png --attach trace.log
$ soulsand prompt --list-models                                   # models, effort levels, fast mode per harness

Ten harnesses are installed in every sandbox. --model and --effort pass straight to the harness. API: GET /v1/provider-models (no key needed).

--agentHarnessKey or login--model · --effort
claude (default)Claude CodeANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN, a subscription or a loginyes · low … max
codexOpenAI CodexOPENAI_API_KEY, a subscription or a loginyes · minimal … xhigh
geminiGemini CLIGEMINI_API_KEY or a Google loginyes · no
opencodeOpenCodeyour provider's keyyes (provider/model) · no
pipiyour provider's keyyes · off … max
ampAmpAMP_API_KEYno · no
cursorCursor CLICURSOR_API_KEYyes · no
primePrime Agentyour provider's key (e.g. PRIME_API_KEY)yes · off … max
kimiKimi CodeMOONSHOT_API_KEY or kimi loginyes · low … max
mistralMistral VibeMISTRAL_API_KEY or vibe --setupyes · no

Without a key or login the prompt is refused with 400 provider_not_configured. Set keys once as variables and every sandbox has them:

$ soulsand env set ANTHROPIC_API_KEY      # prompts for the value
$ soulsand env set OPENAI_API_KEY

Or connect a subscription, or log in once inside (soulsand ssh my-box, run claude). That login stays on the disk through restarts and forks.

Fast mode. --fast (API fast: true) uses the provider's faster, pricier tier. Unsupported models answer 400 fast_mode_not_supported.

Conversations

A prompt continues the sandbox's most recent conversation. --new starts another; --conversation ID picks one. Each prompt prints its conversation id first.

$ soulsand conversations my-box                                 # list
$ soulsand conversations my-box conv_3f9a…                      # its turns; --delete removes it
$ soulsand prompt my-box --conversation conv_3f9a… --agent codex "take it from here"
  • One turn at a time per conversation; up to 4 conversations run at once per sandbox. Extra prompts are queued. Statuses: queued, running, done, failed, interrupted.
  • Switching harness hands the new one the earlier turns (up to 16 KB).
  • Conversations survive stop, start and fork. A running prompt holds off auto-stop.
  • --timeout per turn: default 3600 s, max 21600. Ctrl+C stops following, not the agent.

Steer and interrupt. soulsand steer my-box "skip the integration tests" (API POST /steer) messages the running turn. Claude Code takes it mid-turn (mode native); other harnesses get it as the next turn (mode queued). Nothing running: 409 no_running_turn. soulsand interrupt my-box (API POST /interrupt) stops running turns and cancels queued ones; --conversation ID for one. Files and memory stay.

Events. soulsand events my-box --follow streams what agents do. Types: status, text, tool_call, tool_result, steer, log, error; each has an increasing id, prompt_id, conversation_id. API: GET /v1/sandboxes/{name}/events or /prompts/{id}/events, as JSON pages (cursor), SSE (Accept: text/event-stream, resumable with Last-Event-ID) or NDJSON. Kept 90 days; with monitoring off only status changes are stored.

Attachments. --attach FILE (API attachments: [{name, content_b64}]): up to 12 files, 25 MB each, 64 MB total. Saved to ~/attachments/<prompt id>/, with paths added to the prompt.

From code. POST /v1/sandboxes/{name}/prompts queues and answers 202 (id, conversation_id); poll GET /prompts/{id} until done (result, or error_code). POST /v1/sandboxes/{name}/prompt waits and returns the answer in stdout. Both take prompt, agent, model, effort, fast, new, conversation_id, attachments, timeout_secs. SDKs: sandbox.prompt, queue_prompt, watch_prompt, steer, interrupt.

Subscriptions

Run Claude Code on a Claude Pro/Max plan and Codex on a ChatGPT plan instead of API keys. Dashboard Agents > Sign in, or:

$ soulsand subscriptions login claude --sandbox my-box     # or chatgpt; runs the vendor's sign-in there
$ soulsand subscriptions logout claude

froog runs the vendor's own sign-in in a running sandbox and stores the result encrypted: Claude as CLAUDE_CODE_OAUTH_TOKEN (valid a year), ChatGPT as the secret file ~/.codex/auth.json. Every sandbox gets it at its next start. froog only shows links to the vendor's hosts and only stores a credential of the vendor's format; the sign-in times out after 15 minutes. Logged in the audit log.

Your plan's terms and usage limits apply. Anyone with a shell in a sandbox can read these credentials, so keep them out of shared sandboxes (--no-environment). They are never proxied. API: GET /v1/subscriptions, POST /v1/subscriptions/{claude|chatgpt}/login {sandbox}, POST …/login/code, DELETE /v1/subscriptions/{provider}.

Computer use

Every harness gets an MCP server named computer that sees and drives the sandbox's Linux desktop. Watch with soulsand desktop:

$ soulsand prompt my-box "open example.com in Chrome and tell me the page title"
Lookscreenshot, get_window_state, get_screen_size, list_windows
Point and typeclick, double_click, right_click, move_cursor, drag, scroll, type_text, press_key, hotkey, set_value
Apps and windowslaunch_app, kill_app, bring_to_front, set_window_frame, invoke_menu, close_window
Browserbrowser_navigate, get_browser_state, browser_click, browser_type, browser_download
Clipboardclipboard_read, clipboard_write

The desktop starts on first use. All agents on a sandbox share one screen: give parallel GUI tasks their own sandboxes. Screenshots are big in context; prefer get_browser_state or get_window_state, which return text. The server is ~/.froog/computer/mcp.py; froog rewrites only the computer entry in each harness's config at start. Prime Agent calls it from Python (await mcp.call_tool("computer", "screenshot", {})); Mistral Vibe names the tools computer_screenshot etc.

The browser. Browser tools drive Chrome over CDP on 127.0.0.1:9222 with its own profile, ~/.config/froog-chrome, so sign-ins survive stops and forks. get_browser_state lists the page's links, buttons and fields with numbers; browser_click and browser_type take a number, CSS selector or visible text. They work with Chrome behind other windows. browser_download saves to ~/Downloads with the browser's cookies. The port is unreachable from outside, but any program in the sandbox can use it and its sign-ins.

Accessibility tree. get_window_state returns a window's screenshot plus its AT-SPI tree, each element with a ref like 0.3.1 (screenshot: false, max_nodes default 300). click with a ref, set_value and invoke_menu need no focus or coordinates. GTK, Qt and LibreOffice have trees; Chrome/Electron only with --force-renderer-accessibility; Wine none.

Input without focus. Pass a window to click/type tools to raise it for the action and restore focus after. "delivery_mode": "background" sends X11 synthetic events without raising it, but many apps (Chrome, Firefox, GTK, terminals) ignore those: check with a screenshot. Not available on Omarchy (Wayland). Browser tools and accessibility refs always work without focus.

Android. On an Android sandbox the server adds phone_* tools: phone_state first (screenshot and UI tree), then phone_tap, phone_swipe, phone_type, phone_key, phone_launch, phone_open_url, phone_install, phone_apps.

Customize the agents

Harnesses read their config from the sandbox home; soulsand prompt runs from ~. froog adds a froog skill, a short headless system prompt (Claude Code, pi, Prime Agent) and the computer server. You add the rest:

HarnessHouse rulesMCP serversSkills
Claude Code~/CLAUDE.mdclaude mcp add --scope user NAME -- CMD~/.claude/skills/
Codex~/AGENTS.mdcodex mcp add NAME -- CMD~/.codex/skills/
Gemini CLI~/GEMINI.md~/.gemini/settings.json~/.gemini/skills/
OpenCode~/AGENTS.md~/.config/opencode/opencode.json~/.config/opencode/skills/
pi~/AGENTS.mdpi mcp add NAME -- CMD~/.pi/agent/skills/
Prime Agent~/AGENTS.mdprime-agent mcp add NAME -- CMD~/.prime/agent/skills/
Kimi Code~/AGENTS.md~/.kimi-code/mcp.json~/.kimi-code/skills/
Mistral VibeAGENTS.md in a trusted repo~/.vibe/config.toml~/.vibe/skills/
Amp, Cursor~/AGENTS.mdsee their docs~/.agents/skills/ (Amp)

To give every new sandbox the same rules, add them as account secret files (register MCP servers in the setup script):

$ soulsand environment add-file AGENTS.md ./house-rules.md
$ soulsand environment add-file CLAUDE.md ./house-rules.md

soulsand forward NAME PORT --reverse exposes a port on your computer at 127.0.0.1:PORT inside the sandbox while it runs, e.g. for a local MCP server or model. It reconnects if the sandbox restarts.

$ soulsand forward my-box 7777 --reverse     # leave running
$ soulsand exec my-box -- 'claude mcp add --scope user mine --transport http http://127.0.0.1:7777/mcp'
$ soulsand forward my-box 11434 --reverse    # Ollama

Or run the agent on your own machine and give it the sandbox as a tool: soulsand exec and the API return stdout, stderr and the exit code.