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#
- Check the CLI first:
sandal status --check(exit 1 = not signed in).SANDAL_API_KEYin 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 calledsandalfrom npm or PyPI (those are unrelated projects). - Create without a template:
sandal create --name <task>uses the project's default template, sizes(2 vCPU, 4 GiB). Use--size m|lfor heavy builds,--runtime general-linux-vmfor a full VM with systemd,--desktopfor computer use. - Read JSON, not text: when stdout is not a terminal every command prints JSON (JSON Lines for
create; take.idfrom the line whoseeventisready). - 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, thensandal exec logs <id> <process> --followorsandal exec wait <id> <process>. - Move files with
sandal push <id> <dir>(git-aware, lands in/workspace/<dir>) orsandal upload/sandal download;sandal files cat <id> <path>prints one file. - Previews:
sandal share <id> <port>prints a link a human can open without a key (1 hour by default,--ttlup to 24 h,--single-use).sandal ports expose <id> <port>gives a privateurlthat needs the API key as a bearer token. - 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. - Errors are typed: exit 2 usage, 3 auth, 4 not found, 5 conflict, 6 quota, 7 unavailable (
--fail-fastmakes 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" --yesWhat 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.