Sandboxes
Isolated environments for AI agents — run code, manage files, execute commands
Overview
Sandboxes are isolated microVM environments for AI agents. They provide a full Linux environment with file system access, shell execution, and network connectivity. Three modes cover different use cases.
Sandbox Types
| Type | Lifetime | Use Case |
|---|---|---|
| Ephemeral | Minutes | One-shot code execution, tests |
| Persistent | Days-weeks | Long-running development environments |
| Scheduled wake-ups | Cron / time / event | Wake a paused persistent sandbox for periodic tasks |
Quick Start
Create an Ephemeral Sandbox
bash
curl -X POST https://api.scalix.world/v1/sandboxes \
-H "Authorization: Bearer $SCALIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"runtime": "node22",
"timeout_ms": 300000
}'Valid runtime values: python3.12, python3.13, node22, node24, go1.22, rust-latest. timeout_ms ranges from 60000 (1 min) to 86400000 (24 h).
Execute Commands
bash
curl -X POST https://api.scalix.world/v1/sandboxes/{id}/commands \
-H "Authorization: Bearer $SCALIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cmd": "node", "args": ["-e", "console.log(1+1)"]}'Upload Files
Files are sent as a JSON array of {path, content} objects:
bash
curl -X POST https://api.scalix.world/v1/sandboxes/{id}/files \
-H "Authorization: Bearer $SCALIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"files": [{"path": "/workspace/script.js", "content": "console.log(1+1)"}]}'Download Files
The file path goes directly in the URL after /files/:
bash
curl https://api.scalix.world/v1/sandboxes/{id}/files/workspace/output.json \
-H "Authorization: Bearer $SCALIX_API_KEY"For AI Agents
Sandboxes are designed for AI agents to:
- Write and execute code safely
- Install packages and dependencies
- Read and write files
- Run tests and builds
- Interact with databases and APIs
The MCP server exposes sandbox tools:
plaintext
scalix_sandbox_run — create and execute code in a sandboxResource Limits
| Resource | Ephemeral | Persistent |
|---|---|---|
| Memory | 256 MB - 32 GB | 512 MB - 32 GB |
| vCPUs | 1 - 16 | 1 - 16 |
| Disk | 1 - 100 GB | 1 - 100 GB |
| Timeout | 1 min - 24 h | No limit |