Give Sandal to your coding agent

One page a coding agent (Claude Code, Codex, Cursor) can follow to create Sandal sandboxes, run code in them, open previews and clean up. Also served as /SKILL.md.


Paste this into your agent, or point it at https://sandal.dev/SKILL.md. The whole docs set for agents is /llms.txt (index) and /llms-full.txt (every page).

Use Sandal (https://sandal.dev/SKILL.md) to run code in isolated cloud sandboxes.

Rules for the agent#

  1. Check the CLI first: sandal status --check (exit 1 = not signed in). SANDAL_API_KEY in the environment is enough to be signed in. If the CLI is missing or not signed in, stop and ask the user; never install a package called sandal from npm or PyPI (those are unrelated projects).
  2. Create without a template: sandal create --name <task> uses the project's default template, size s (2 vCPU, 4 GiB). Use --size m|l for heavy builds, --runtime general-linux-vm for a full VM with systemd, --desktop for computer use.
  3. Read JSON, not text: when stdout is not a terminal every command prints JSON (JSON Lines for create; take .id from the line whose event is ready).
  4. Run commands with sandal exec <id> -- <argv> (one string with shell syntax runs through /bin/sh -lc). The exit code is the remote one. For servers and long jobs use --detach, then sandal exec logs <id> <process> --follow or sandal exec wait <id> <process>.
  5. Move files with sandal push <id> <dir> (git-aware, lands in /workspace/<dir>) or sandal upload / sandal download; sandal files cat <id> <path> prints one file.
  6. Previews: sandal share <id> <port> prints a link a human can open without a key (1 hour by default, --ttl up to 24 h, --single-use). sandal ports expose <id> <port> gives a private url that needs the API key as a bearer token.
  7. Always clean up: sandal delete <id> --yes. Stop instead (sandal stop <id>) only when the user wants the disk kept; stopped sandboxes cost no compute.
  8. Errors are typed: exit 2 usage, 3 auth, 4 not found, 5 conflict, 6 quota, 7 unavailable (--fail-fast makes create answer at once when no host is free), 8 timeout. The message names the reason and often a hint; report it to the user instead of retrying blindly.

Minimal session#

id=$(sandal create --name agent-task --json | jq -r 'select(.event=="ready") | .id')
sandal push "$id" ./repo
sandal exec "$id" -- bash -lc 'cd /workspace/repo && npm ci && npm test'
sandal delete "$id" --yes

What is not available today#

Say so instead of trying: root or sudo on the default template (sandal exec --root answers capability_unavailable, exit 7; a root + FUSE template is in preview), FUSE / S3 mounts on the default template, outbound IPv6, memory snapshots, volume snapshots, OpenTelemetry export, a per-sandbox network log. In preview only (enabled per project): Windows and Linux arm64 runners, Windows VMs, Android devices, brokered secrets. Not available yet: macOS runners, iOS Simulator tests inside a macOS VM, the Xcode builds API. iOS Simulators exist as their own product (sandal devices ios …; private beta, on request) with small capacity, so check sandal devices capabilities first. macOS VMs exist, but only on a Mac leased to the organisation, so do not create one unless the user asks for it.

From code instead of the CLI#

The TypeScript (@sandal-dev/sdk), Python (sandal-sdk, import sandal) and Go (sandal.dev/go) SDKs read SANDAL_API_KEY and have the same verbs: createSandbox() / create_sandbox(), exec, startCommand / start_command, writeText / write_text, expose, share, delete. See the quickstart and the integrations for agent frameworks. The MCP server sandal-mcp (part of the CLI) runs locally over stdio: MCP server.