Claude Agent Skill · by Aradotso

Zeroboot Vm Sandbox

Install Zeroboot Vm Sandbox skill for Claude Code from aradotso/trending-skills.

Install
Terminal · npx
$npx skills add https://github.com/nextlevelbuilder/ui-ux-pro-max-skill --skill ui-ux-pro-max
Works with Paperclip

How Zeroboot Vm Sandbox fits into a Paperclip company.

Zeroboot Vm Sandbox drops into any Paperclip agent that handles this kind of work. Assign it to a specialist inside a pre-configured PaperclipOrg company and the skill becomes available on every heartbeat — no prompt engineering, no tool wiring.

S
SaaS FactoryPaired

Pre-configured AI company — 18 agents, 18 skills, one-time purchase.

$27$59
Explore pack
Source file
SKILL.md315 lines
Expand
---name: zeroboot-vm-sandboxdescription: Sub-millisecond VM sandboxes for AI agents using copy-on-write KVM forking via Zeroboottriggers:  - run code in a sandbox  - execute code safely in a VM  - create an isolated sandbox for AI agents  - spin up a VM sandbox fast  - use zeroboot to run untrusted code  - fork a VM with copy-on-write  - sub-millisecond sandbox execution  - secure code execution for AI--- # Zeroboot VM Sandbox > Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection. Zeroboot provides sub-millisecond KVM virtual machine sandboxes for AI agents using copy-on-write forking. Each sandbox is a real hardware-isolated VM (via Firecracker + KVM), not a container. A template VM is snapshotted once, then forked in ~0.8ms per execution using `mmap(MAP_PRIVATE)` CoW semantics. ## How It Works ```Firecracker snapshot ──► mmap(MAP_PRIVATE) ──► KVM VM + restored CPU state                           (copy-on-write)          (~0.8ms)``` 1. **Template**: Firecracker boots once, pre-loads your runtime, snapshots memory + CPU state2. **Fork (~0.8ms)**: New KVM VM maps snapshot memory as CoW, restores CPU state3. **Isolation**: Each fork is a separate KVM VM with hardware-enforced memory isolation ## Installation ### Python SDK ```bashpip install zeroboot``` ### Node/TypeScript SDK ```bashnpm install @zeroboot/sdk# orpnpm add @zeroboot/sdk``` ## Authentication Set your API key as an environment variable: ```bashexport ZEROBOOT_API_KEY="zb_live_your_key_here"``` Never hardcode keys in source files. ## Quick Start ### REST API (cURL) ```bashcurl -X POST https://api.zeroboot.dev/v1/exec \  -H 'Content-Type: application/json' \  -H "Authorization: Bearer $ZEROBOOT_API_KEY" \  -d '{"code":"import numpy as np; print(np.random.rand(3))"}'``` ### Python ```pythonimport osfrom zeroboot import Sandbox # Initialize with API key from environmentsb = Sandbox(os.environ["ZEROBOOT_API_KEY"]) # Run Python coderesult = sb.run("print(1 + 1)")print(result)  # "2" # Run multi-line coderesult = sb.run("""import numpy as nparr = np.arange(10)print(arr.mean())""")print(result)``` ### TypeScript / Node.js ```typescriptimport { Sandbox } from "@zeroboot/sdk"; const apiKey = process.env.ZEROBOOT_API_KEY!;const sb = new Sandbox(apiKey); // Run JavaScript/Node codeconst result = await sb.run("console.log(1 + 1)");console.log(result); // "2" // Run async codeconst output = await sb.run(`const data = [1, 2, 3, 4, 5];const sum = data.reduce((a, b) => a + b, 0);console.log(sum / data.length);`);console.log(output);``` ## Common Patterns ### AI Agent Code Execution Loop (Python) ```pythonimport osfrom zeroboot import Sandbox def execute_agent_code(code: str) -> dict:    """Execute LLM-generated code in an isolated VM sandbox."""    sb = Sandbox(os.environ["ZEROBOOT_API_KEY"])    try:        result = sb.run(code)        return {"success": True, "output": result}    except Exception as e:        return {"success": False, "error": str(e)} # Example: running agent-generated code safelyagent_code = """import jsondata = {"agent": "result", "value": 42}print(json.dumps(data))"""response = execute_agent_code(agent_code)print(response)``` ### Concurrent Sandbox Execution (Python) ```pythonimport osimport asynciofrom zeroboot import Sandbox async def run_sandbox(code: str, index: int) -> str:    sb = Sandbox(os.environ["ZEROBOOT_API_KEY"])    result = await asyncio.to_thread(sb.run, code)    return f"[{index}] {result}" async def run_concurrent(snippets: list[str]):    tasks = [run_sandbox(code, i) for i, code in enumerate(snippets)]    results = await asyncio.gather(*tasks)    return results # Run 10 sandboxes concurrentlycodes = [f"print({i} ** 2)" for i in range(10)]outputs = asyncio.run(run_concurrent(codes))for out in outputs:    print(out)``` ### TypeScript: Agent Tool Integration ```typescriptimport { Sandbox } from "@zeroboot/sdk"; interface ExecutionResult {  success: boolean;  output?: string;  error?: string;} async function runInSandbox(code: string): Promise<ExecutionResult> {  const sb = new Sandbox(process.env.ZEROBOOT_API_KEY!);  try {    const output = await sb.run(code);    return { success: true, output };  } catch (err) {    return { success: false, error: String(err) };  }} // Integrate as a tool for an LLM agentconst tool = {  name: "execute_code",  description: "Run code in an isolated VM sandbox",  execute: async ({ code }: { code: string }) => runInSandbox(code),};``` ### REST API with fetch (TypeScript) ```typescriptconst API_BASE = "https://api.zeroboot.dev/v1"; async function execCode(code: string): Promise<string> {  const res = await fetch(`${API_BASE}/exec`, {    method: "POST",    headers: {      "Content-Type": "application/json",      Authorization: `Bearer ${process.env.ZEROBOOT_API_KEY}`,    },    body: JSON.stringify({ code }),  });  if (!res.ok) {    const err = await res.text();    throw new Error(`Zeroboot error ${res.status}: ${err}`);  }  const data = await res.json();  return data.output;}``` ### Health Check ```bashcurl https://api.zeroboot.dev/v1/health``` ## API Reference ### `POST /v1/exec` Execute code in a fresh sandbox fork. **Request:**```json{  "code": "print('hello')"}``` **Headers:**```Authorization: Bearer <ZEROBOOT_API_KEY>Content-Type: application/json``` **Response:**```json{  "output": "hello\n",  "duration_ms": 0.79}``` ## Performance Characteristics | Metric | Value ||---|---|| Spawn latency p50 | ~0.79ms || Spawn latency p99 | ~1.74ms || Memory per sandbox | ~265KB || Fork + exec Python | ~8ms || 1000 concurrent forks | ~815ms | - Each sandbox is a real KVM VM — not a container or process jail- Memory isolation is hardware-enforced (not software)- CoW means only pages written by your code consume extra RAM ## Self-Hosting / Deployment See [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) in the repo. Requirements:- Linux host with KVM support (`/dev/kvm` accessible)- Firecracker binary- Rust 2021 edition toolchain ```bash# Check KVM availabilityls /dev/kvm # Clone and buildgit clone https://github.com/adammiribyan/zerobootcd zerobootcargo build --release``` ## Architecture Notes - **Snapshot layer**: Firecracker VM boots once per runtime template, memory + vCPU state saved to disk- **Fork layer** (Rust): `mmap(MAP_PRIVATE)` on snapshot file → kernel handles CoW page faults per VM- **Isolation**: Each fork has its own KVM VM file descriptors, vCPU, and page table — fully hardware-separated- **No shared kernel**: Unlike containers, each sandbox runs its own kernel instance ## Troubleshooting **`/dev/kvm not found` (self-hosted)**```bash# Enable KVM kernel modulesudo modprobe kvmsudo modprobe kvm_intel  # or kvm_amd``` **API returns 401 Unauthorized**- Verify `ZEROBOOT_API_KEY` is set and starts with `zb_live_`- Check the key is not expired in your dashboard **Timeout on execution**- Default execution timeout is enforced server-side- Break large computations into smaller chunks- Avoid infinite loops or blocking I/O in sandbox code **High memory usage (self-hosted)**- Each VM fork starts at ~265KB CoW overhead- Pages are allocated on write — memory grows with sandbox activity- Tune concurrent fork limits based on available RAM ## Resources - [API Reference](https://github.com/adammiribyan/zeroboot/blob/main/docs/API.md)- [Architecture Docs](https://github.com/adammiribyan/zeroboot/blob/main/docs/ARCHITECTURE.md)- [Deployment Guide](https://github.com/adammiribyan/zeroboot/blob/main/docs/DEPLOYMENT.md)- [Homepage](https://zeroboot.dev)- [GitHub](https://github.com/adammiribyan/zeroboot)