rivet-dev /agentos
Tiny, fast, Linux-compatible sandboxes. Powered by WebAssembly.
★ 4,901⑂ 279👁 11⑃ 1,749● 101▤ 52
+2
Daily
4,901
stars
279
forks
11
watchers
1,749
prs
101
issues
52
releases
README
Tiny, fast, Linux-compatible sandboxes. Powered by WebAssembly.
92× faster cold starts, 47× less memory, 254× cheaper to run.
Each agent gets files, processes, shell, and networking in one lightweight OS.
Quickstart •
Documentation •
Changelog •
Discord •
X
Why agentOS
Powered by WebAssembly and V8 isolates, the same technology powering Chrome and
Cloudflare Workers. Linux with POSIX files, processes, and networking.
- Library, not extra infrastructure. Install agentOS from npm and run it inside the backend process you already operate.
- WebAssembly + V8, not a microVM. V8 isolates run JavaScript while WebAssembly contains compiled tools inside the same compact runtime.
- Direct function calls, not extra APIs. Connect agents to your application with ordinary JavaScript calls instead of another network service.
- Scoped access, not exposed credentials. Bind trusted host functions without ever giving the agent your raw secrets.
- One process, not a VM per agent. Many isolated agent operating systems share one compact runtime instead of duplicating a full microVM stack.
- Runs anywhere, no nested virtualization. Deploy on standard Linux infrastructure without a hypervisor or nested virtualization.
Benchmarks
| Metric | agentOS | Sandbox baseline | Difference |
|---|---|---|---|
| Cold start, p50 | 4.8 ms | 440 ms | 92× faster |
| Cold start, p95 | 5.6 ms | 950 ms | 170× faster |
| Cold start, p99 | 6.1 ms | 3,150 ms | 516× faster |
| Memory, shell workload | ~22 MB | 1,024 MB | 47× less |
| Cost per execution-second, shell workload | $0.000000073 | $0.000018 | 254× cheaper |
See the benchmark details for
methodology, or Performance to run
the benchmarks yourself.
Quickstart
| | Library | Hosted |
|---|---|---|
| Runs | Inside your process | Durable instance on Rivet Cloud or self-hosted |
| Lifecycle | Runs until dispose() or process exit | Sleeps when idle unless a process is running |
| Clients | Your backend | Your backend, or browsers with a scoped JWT |
| Preview URLs | None | Expiring preview URLs |
Library
Step 1: Install the library
bash
npm install @rivet-dev/agentos-core
Step 2: Create a VM and use it
ts
import { AgentOs } from "@rivet-dev/agentos-core";
// Boots a VM inside this process. It runs until dispose() or process exit.
const vm = await AgentOs.create();
try {
// Bash
const result = await vm.process.exec("echo hello && ls /home/agentos", {
output: { capture: "all" },
});
console.log(result.stdout);
// Filesystem
await vm.filesystem.writeFile("/home/agentos/hello.txt", "Hello, world!");
const file = await vm.filesystem.readFile("/home/agentos/hello.txt");
// JavaScript
await vm.javascript.execute("console.log(1 + 2)");
// Python
const answer = await vm.python.evaluate("21 2");
} finally {
await vm.dispose();
}
Step 3: Configure the VM
The filesystem is in memory by default. Pass options to AgentOs.create() to
persist it, attachTop issues
#2087Guest `node` ignores stdin as the program, and `node --input-type=module` reading stdin reports "command not found: node"2 comments · 2026-10-28#1911Docs validation gates reference the removed website/ directory and cannot run2 comments · 2026-08-24#1884Network permission rule sets never match; explicit permission objects also bypass the documented merge-over-default2 comments · 2026-08-01#2020bug: `npm install @agentos-software/build-essential` throws1 comments · 2026-10-04#1973Pi file-writing turn fails with Actor SQLite transaction timeout on local native runtime1 comments · 2026-09-10#1897Sidecar serializes all agent prompts per process: a second session's prompt cannot start until the active turn completes (across sessions and VMs)1 comments · 2026-08-06#1887ACP session dies mid-run: bufferedBytes saturates at whatever limits.acp ceiling is set (64 MiB and 256 MiB), with kilobytes of actual traffic1 comments · 2026-08-05#1760Add an awaited terminal cancellation API for ACP prompts1 comments · 2026-07-16
Discussions
#1441Adding codemode0 comments · 2026-04-11#1305Any Updates on Self Hosting Docs?1 comments · 2025-09-25#1188Does the Rivetkit Cloudflare adapter use Durable Object KV or SQL?2 comments · 2025-09-01#1171Best practices for cpu-intensive actors2 comments · 2025-08-12#1094How to get type safety ?2 comments · 2025-07-20#1076Where is the `shutdown` function and `conn` property?1 comments · 2025-07-08#719Does ActorCore on Cloudflare Workers support all features?1 comments · 2025-03-16#621How to configure cors?3 comments · 2025-02-08
Latest release
v0.4.8 v0.4.8 2026-11-12What's Changed fix(runtime): isolate AsyncLocalStorage between overlapping guest calls by @eersnington in https://github.com/rivet-dev/agentos/pull/2094 fix(runtime): add Uint8Array base64 and hex methods from TC39 proposal-arraybuffer-base64 by @eersnington in https://github.com/rivet-dev/agentos/pull/2091 docs: publish docs with the website's sync-repo script instead of a CI sync by @NathanFlurry in https://github.com/rivet-dev/agentos/pull/2096 fix(runtime): make node:v8 fail loudly on values JSON cannot keep by @eersnington in https://github.com/rivet-dev/agentos/pull/2100 fix(native-