rivet-dev /agentos

Tiny, fast, Linux-compatible sandboxes. Powered by WebAssembly.

★ 4,901⑂ 279👁 11⑃ 1,749● 101▤ 52
RustApache-2.0Created 2024-02-07rivet.dev/agentos
Download: v0.4.8v0.4.8 ↓0.4.82026-11-12
+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, attach

Top issues

Discussions

Latest release

v0.4.8 v0.4.8 2026-11-12
What'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-

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON