Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 2.98 KB

File metadata and controls

98 lines (77 loc) · 2.98 KB
title description
Introduction
Cloud sandboxes for AI agents

OpenComputer gives your AI agents a full Linux VM in the cloud. Each sandbox is an isolated Firecracker microVM with its own filesystem, network, and process space — persistent, long-running, and capable of hibernating when idle. Run Claude inside a sandbox and it can write files, install packages, run commands, and build complete projects autonomously.

Claude runs inside the VM with full filesystem and shell access. Think → act → observe loop, streaming events back to your code. Hours or days, not minutes. Install packages, build projects, run test suites, iterate — no cold starts between steps. Named snapshots you can fork from. Try five approaches in parallel from the same starting point — like git branches for VMs. Not a container. Real VM with its own kernel, memory, and disk. Hardware-level isolation via Firecracker — the same technology behind AWS Lambda.

Install

npm install @opencomputer/sdk
pip install opencomputer-sdk
# See cli/overview for platform-specific install
curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
export OPENCOMPUTER_API_KEY=your-api-key

Grab your API key from app.opencomputer.dev

Quick Example

import { Sandbox } from "@opencomputer/sdk";

const sandbox = await Sandbox.create();
const session = await sandbox.agent.start({
  prompt: "Create a hello world Express app and test it",
  onEvent: (event) => {
    if (event.type === "assistant") console.log(event.message);
  },
});

await session.done;
await sandbox.kill();
from opencomputer import Sandbox

sandbox = await Sandbox.create()
session = await sandbox.agent.start(
    prompt="Create a hello world Express app and test it",
    on_event=lambda event: print(event.data.get("message", ""))
    if event.type == "assistant" else None,
)

await session.wait()
await sandbox.kill()

Next Steps

Working agent in 2 minutes Architecture: Firecracker VMs, hibernation, checkpoints Run Claude inside sandboxes The compute primitive