ScalixScalix Docs

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

TypeLifetimeUse Case
EphemeralMinutesOne-shot code execution, tests
PersistentDays-weeksLong-running development environments
Scheduled wake-upsCron / time / eventWake 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 sandbox

Resource Limits

ResourceEphemeralPersistent
Memory256 MB - 32 GB512 MB - 32 GB
vCPUs1 - 161 - 16
Disk1 - 100 GB1 - 100 GB
Timeout1 min - 24 hNo limit