Sandbox API
Base path: /api/sandbox
All endpoints require authentication. See API Overview for auth details.
Configuration
Section titled “Configuration”Get sandbox config
Section titled “Get sandbox config”GET /api/sandbox/configResponse — the full config plus the derived profile (read-only):
{ "config": { "mode": "selective", "scope": "session", "workspace_access": "ro", "network": { "enabled": true, "allowed_domains": [], "blocked_domains": [] }, "resources": { "cpu_cores": 1.0, "memory_mb": 512, "disk_mb": 1024, "max_processes": 64, "timeout_seconds": 300 }, "smart_sandbox_risk_threshold": 0.5, "block_when_no_runtime": false }, "profile": "safe"}Update sandbox config
Section titled “Update sandbox config”PUT /api/sandbox/config{ "mode": "all", "network": { "enabled": true, "allowed_domains": ["api.github.com", "registry.npmjs.org"] }}Config values:
| Field | Options | Description |
|---|---|---|
mode | off, selective, all | Off / Safe / Strict mapping |
scope | session, agent, shared | Container persistence |
workspace_access | none, ro, rw | Access to agent workspace |
smart_sandbox_risk_threshold | 0–1 | Safe-mode risk cutoff (≥ ⇒ containerize) |
block_when_no_runtime | true/false | Fail closed (block) instead of host fallback |
Status
Section titled “Status”Get sandbox status
Section titled “Get sandbox status”GET /api/sandbox/status{ "status": "ok", "mode": "selective", "scope": "session", "profile": "safe", "runtime": { "available": true, "type": "docker", "version": "25.0.4" }, "active_containers": 2, "degraded": false, "platform": { "system": "Darwin", "os_fence_supported": true, "windows_needs_wsl2": false }}runtime.available— whether a container runtime is reachable (withtype/version).degraded—truewhen the profile is Safe/Strict but no runtime is available, so commands run unsandboxed (surfaced, never silent). The engine also emits asandbox.degradedevent.platform— OS and capability signals for the runtime-status banner (os_fence_supported,windows_needs_wsl2).
Container management
Section titled “Container management”List active containers
Section titled “List active containers”GET /api/sandbox/containersResponse:
{ "containers": [ { "id": "container_abc123", "agent_id": "agent_123", "scope": "agent", "status": "running", "created_at": "2026-03-02T10:00:00Z", "cpu_percent": 5.2, "memory_mb": 256, "executions_count": 42 } ]}Get container details
Section titled “Get container details”GET /api/sandbox/containers/{id}Stop a container
Section titled “Stop a container”POST /api/sandbox/containers/{id}/stopRestart a container
Section titled “Restart a container”POST /api/sandbox/containers/{id}/restartDestroy a container
Section titled “Destroy a container”DELETE /api/sandbox/containers/{id}Permanently removes the container and its data.
Cleanup containers
Section titled “Cleanup containers”POST /api/sandbox/containers/cleanupRemoves idle or orphaned containers.
Snapshots
Section titled “Snapshots”GET /api/sandbox/containers/{id}/snapshotsPOST /api/sandbox/containers/{id}/snapshotsPOST /api/sandbox/containers/{id}/snapshots/{sid}/rollbackDELETE /api/sandbox/containers/{id}/snapshots/{sid}Save and restore container state via snapshots.
Templates
Section titled “Templates”GET /api/sandbox/templatesPOST /api/sandbox/templatesPOST /api/sandbox/templates/{id}/buildPOST /api/sandbox/templates/{id}/pullDELETE /api/sandbox/templates/{id}Manage container image templates.
GET /api/sandbox/auditGET /api/sandbox/audit/summaryPOST /api/sandbox/audit/cleanupGET /api/sandbox/audit/{id}/outputQuery sandbox execution audit logs.
GET /api/sandbox/poolPOST /api/sandbox/pool/drainManage the pre-warmed container pool.
GET /api/sandbox/gpuList available GPU resources.
Resource limits
Section titled “Resource limits”Default limits by permission tier:
| Tier | CPU | Memory | Disk | Max procs | Timeout |
|---|---|---|---|---|---|
| Sandbox | 0.5 cores | 256 MB | 256 MB | 32 | 60s |
| Restricted | 1.0 core | 512 MB | 512 MB | 64 | 120s |
| Standard | 2.0 cores | 1 GB | 2 GB | 128 | 300s |
| Elevated | 4.0 cores | 4 GB | 8 GB | 256 | 600s |
| Unrestricted | unlimited | unlimited | unlimited | unlimited | 1800s |
Network access is a flat, per-config setting (on/off), not tied to these tiers.