agentOS

Active
GitHub TypeScript Apache-2.0

Description

Rivet's open-source portable operating system for AI agents, based on V8 isolates with millisecond cold starts and fine-grained permission control, embeddable as an npm package into any Node.js backend.

Key Features

  • Millisecond cold start — V8 isolate-based startup at ~6 ms, 90-500x faster than traditional sandboxes like E2B/Daytona
  • Runs in-process — No VM boot or container pull, embeds directly into Node.js process as npm package
  • Fine-grained permission control — Deny-by-default policy for filesystem, network, and process access
  • Built-in ACP agents — Bundled Pi, Claude Code, OpenCode, and other mainstream AI agents
  • Cross-platform deployment — Runs locally, on Rivet Cloud, Railway, Vercel, Kubernetes, or any container platform
  • Composable with traditional sandboxes — Mount full sandbox file systems on demand via sandbox extension

Use Cases

💡 Embed AI agent capabilities in backend services without separate sandbox deployment
💡 Build high-concurrency Agent-as-a-Service with millisecond start time
💡 Run Claude Code and other coding agents under strict permission control
💡 Run long-task agents on Serverless platforms like Vercel/Cloudflare
💡 Prevent agent overreach on sensitive resources via fine-grained permission model

Quick Start

npm install @rivet-dev/agent-os-core @agent-os-pkgs/common @rivet-dev/agent-os-pi
import { AgentOs } from "@rivet-dev/agent-os-core";
import common from "@agent-os-pkgs/common";
import pi from "@rivet-dev/agent-os-pi";
const vm = await AgentOs.create({ software: [common, pi] });
const { sessionId } = await vm.createSession("pi", { env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! } });
await vm.prompt(sessionId, "Write a hello world script");
const content = await vm.readFile("/home/user/hello.js");
await vm.dispose();

Related Projects