03 / AI AGENT SANDBOXES

Sub-200ms AI agent sandboxes.
$0/hr while waiting on LLM tokens.

Execute untrusted code safely in hardware-isolated Linux microVMs. Pause with full memory preserved during 30-second LLM reasoning turns, and live-fork running VMs to explore parallel agent hypotheses.

agent.ts — parallel hypothesis branching with $0 idle pause
LIVE FORK + $0 PAUSE
import { UncageClient } from "@uncage/sdk";

const uncage = new UncageClient({
  baseUrl: "https://api.uncage.sh",
  apiKey: process.env.UNCAGE_API_KEY,
});

// 1. Boot a 2 vCPU · 4 GB Linux microVM in us-east
const box = await uncage.sandboxes.create({
  projectId: "proj_agents",
  name: "swe-agent-42",
  region: "us-east",
  vcpu: 2,
  memoryMb: 4096,
});

await box.exec(["git", "clone", "https://github.com/acme/repo.git", "/work"]);

// 2. Live memory + disk fork for parallel A/B fix attempts (~180ms)
const [branchA, branchB] = await Promise.all([
  box.fork("swe-agent-42-fix-a"),
  box.fork("swe-agent-42-fix-b"),
]);

// 3. Pause parent while waiting on LLM API ($0.00/hr compute)
await box.pause();
Regions: us-east · eu-central · us-west · ap-south Boot a 2c/4G Sandbox →
Live Memory Fork
~180ms
While Waiting on LLM
$0.00/hr
Isolation
Dedicated MicroVM
Integrations
TS · Python · MCP
ANATOMY OF AN AGENT TURN

Why wall-clock sandbox billing drains AI budgets.

Traditional Sandbox
EXEC
LLM WAIT (BILLED)
EXEC
LLM WAIT (BILLED)
100% billed
uncage.sh Sandbox
EXEC
PAUSED · $0.00/HR
EXEC
PAUSED · $0.00/HR
~15% billed
SANDBOX PRIMITIVES

Engineered to eliminate the idle agent tax.

SBX-01 < 200ms

Sub-200ms MicroVM Boot & Resume

Every agent session gets a dedicated Linux kernel and isolated filesystem in under 200ms—fast enough to sit directly inside synchronous LLM tool-calling loops.

SBX-02 80%–90% savings

Zero Idle Compute Tax ($0/hr Sleep)

Coding agents spend 85% of wall-clock time waiting on LLM token generation. Auto-pause freezes CPU and RAM billing to $0.00/hr between tool calls while keeping processes intact.

SBX-03 ~180ms fork

Live Memory + Disk fork()

Clone a warm sandbox—including running processes, loaded Python interpreters, installed dependencies, and open files—to run parallel tree-search or pass@k evaluations.

SBX-04 Stateful sleep

Memory-Preserving Pause & Resume

Unlike container kills that wipe /tmp and running dev servers, uncage.sh snapshots live RAM and disk state so agents resume mid-session without reinstalling packages.

SBX-05 9 MCP tools

Zero-Dependency TS, Python & MCP

Integrate in 5 lines using @uncage/sdk (TypeScript), uncage-py (sync + asyncio Python), or attach uncage-mcp directly to Claude Desktop, Cursor, or custom agent frameworks.

SBX-06 Safe by default

Co-Located Databases & Egress Control

Pair sandboxes with copy-on-write Postgres branches on a private project network, with strict outbound egress policies to protect secrets and prevent abuse.

AGENT ARCHITECTURES

Built for production AI products, benchmarks, and SWE agents.

CODING AGENTS

Autonomous PR solvers and interactive IDE copilots

The Pain

Standard sandbox providers bill continuous per-second wall-clock time while Claude or GPT streams a 25-second response—inflating infra bills 5x–10x.

With uncage.sh

Pause sandboxes automatically between tool calls ($0/hr) and resume with the entire repo, build cache, and dev server still warm in RAM.

→ Up to 85% reduction in per-session sandbox compute cost.
RL & EVALS

High-concurrency SWE-bench and RL trajectory rollouts

The Pain

Cloning repos and installing npm/pip dependencies inside 500 fresh containers burns minutes of CPU before a single test executes.

With uncage.sh

Warm one base sandbox per repository commit and call fork() 50 times in parallel (~180ms each) to evaluate candidate patches simultaneously.

→ 10x faster evaluation wall-clock time with zero redundant package installs.
DATA & CODE INTERPRETERS

Safe multi-tenant Python & shell execution for SaaS apps

The Pain

Running user- or LLM-generated Python inside shared containers risks kernel escapes, noisy neighbors, and OOM crashes.

With uncage.sh

Give every user conversation its own hardware-isolated microVM with hard vCPU/RAM caps, strict timeouts, and automatic idle sleep.

→ Strong tenant isolation at pennies per thousand executions.
IDLE TAX COMPARISON

Why active-CPU billing transforms AI agent unit economics.

A typical 10-minute coding agent session only executes commands for ~75 seconds while spending 8m 45s waiting on LLM API responses. On uncage.sh, you only pay for those 75 active seconds.

Full Cost Comparison vs E2B →
1,000 Coding Agent Sessions
2 vCPU · 4 GB · 75s active / session
20.8 active hrs (vs 166.7 wall-clock hrs)
Active Compute $1.95 total
10,000 Code Interpreter Runs
1 vCPU · 1 GB · 12s active / run
33.3 active hrs total
Active Compute $1.38 total
Parallel SWE Eval Suite (500 tasks)
4 vCPU · 8 GB · 45s active / task
6.25 active hrs via warm fork()
Active Compute $1.17 total
Sandbox Size Included NVMe Active Rate Paused / Waiting on LLM Launch
1 vCPU · 1 GB 10 GB $0.0414/hr $0.0000/hr Boot →
2 vCPU · 4 GB 20 GB $0.0936/hr $0.0000/hr Boot →
4 vCPU · 8 GB 40 GB $0.1872/hr $0.0000/hr Boot →
8 vCPU · 16 GB 80 GB $0.3744/hr $0.0000/hr Boot →
AI SANDBOXES FAQ

Technical FAQ on microVM isolation, fork(), and billing.

01 How does uncage.sh avoid charging while my agent waits for an LLM API?
When you call pause()—or when your configured idle_timeout_seconds elapses between tool calls—the microVM snapshots its live memory and filesystem and stops consuming CPU. Billing drops strictly to $0.00/hr until the next exec() or resume() wakes it.
02 What is preserved when I call fork() on a running sandbox?
fork() clones both live memory state and disk via copy-on-write in ~180ms. Running background processes, virtual environments, environment variables, and files on disk are instantaneously available in the child sandbox without affecting the parent.
03 Can I bring custom Docker/OCI images with preinstalled toolchains?
Yes. Pass any public or private OCI image (such as python:3.12, node:22, rust:1.82, or your own monorepo dev image) in the image parameter of the CLI, SDK, or MCP tool.
04 How is untrusted LLM-generated code isolated from other tenants?
Every sandbox runs inside its own hardware-isolated microVM with a dedicated Linux kernel, private virtual network interface, and strict resource cgroups—never sharing a host kernel with neighboring tenants.
05 Is there a native MCP server for Claude Desktop and Cursor?
Yes. uncage-mcp exposes 9 JSON-RPC tools over stdio—including sandbox creation, command execution, pause/resume, live fork, database creation, and app deployment. See our MCP setup guide at /docs/mcp.
STOP PAYING THE IDLE AGENT TAX

Spin up sub-200ms AI sandboxes today.

Connect via TypeScript, Python, CLI, or MCP in under 60 seconds. Strictly $0/hr while waiting on tokens.

✓ $10 starter credit on signup
✓ Strictly $0.00/hr compute when sleeping
✓ Sub-second boot across 4 global regions