Open source · MIT

A tiny Linux-like VM, in the browser and in Node

Not a Linux distro. No WASM. Just Linux/POSIX APIs, reimplemented in pure TypeScript.

A sandboxed OS for AI agents — a real filesystem, a bash-like shell, Node.js, and npm — that boots in under a millisecond. Runs Vite, Expo, and Supabase unmodified. No Docker, no cloud, no setup.

Open the demonpx lifo-sh

Watch

Lifo in 3 minutes

Benchmarks

0.3 MB. Boots in under a millisecond.

The same Lifo VM as a Node process, a single binary, or in a browser tab — next to a browser VM (WebContainers). Both ship node + npm by default.

Cold start & footprint · lower is better

Cold startFootprint
Lifo (Node)
in a Node process
~0.5 ms
0.3 MB
Lifo (browser)
in a browser tab
~27 ms
0.3 MB
Lifo (binary)
self-contained
~41 ms
59 MB
WebContainers
in a browser tab
~6,600 ms
~75-85 MB

Cold start (green) and footprint (blue) use independent linear scales (axes: 250 ms · 90 MB) — the number is the measurement, the bar length is illustrative. WebContainers' ~6.6 s boot runs off the ms axis with a torn end; its ~75-85 MB wasm-Node engine is the longest footprint bar, next to Lifo's self-contained 59 MB binary and 0.3 MB core.

Measured in the same headless Chromium (methodology). WebContainers runs a wasm build of the real Node engine (fuller, heavier); Lifo reimplements the OS and Node APIs in TypeScript (smaller, a compat subset) — so read this as fit, not a scoreboard.

Reads like Linux, isn't Linux. Lifo is a clean-room reimplementation of the OS and Node.js APIs in TypeScript — not a Linux distribution or a VM. It behaves like a Unix box for a wide range of work (shells, git, npm / pnpm, dev servers, previews, WASM packages like ffmpeg, agent code, CI), but it doesn't run native Linux binaries and its isolation is JS-level, not a security boundary. Some comparisons here span categories — read them as fit for a use case, not a like-for-like race.

Architecture

A whole OS in a browser tab

The Sandbox API drives a Linux-like kernel — a shell, coreutils, a Node.js compatibility layer, and a package manager — on a virtual filesystem and network, all inside one tab. A service worker turns in-VM ports into live previews. It's all pure TypeScript — Linux and POSIX APIs mapped onto JavaScript, with no WASM, no emulator, and no native binaries.

Your app · AI agent · terminaldrives the Sandbox API — unmodifiedsandbox.commands.run()xterm terminal@lifo-sh/corecommands · Node.js · shell scriptsLifo kernela Linux-like OS running in one browser tabShellbash-like60+ commandsls · grep · gitNode.js compathttp · fs · netnpm / npxreal registryVirtual filesystempersisted to IndexedDBVirtual networkports · TCP · DNSService worker/_sw/<port> previewsIn the browser, todayThe whole OS in one tab — no server,boots in ~27 ms, $0 infra.In Node, todayThe same VM server-side — sandbox agents & CI.A distributable binary is on the roadmap.

Sandbox API

Drive it from your code

A headless Sandbox gives you a filesystem, a shell, and Node.js as plain async calls — ideal for running and inspecting AI-generated code, building tutorials, or powering a browser IDE.

Try it in the demo →
import { Sandbox } from '@lifo-sh/core'

// A whole OS in a variable — no server, no setup.
const sandbox = await Sandbox.create()

const { stdout } = await sandbox.commands.run('echo "hello from Lifo"')
await sandbox.fs.writeFile('/home/user/app.js', 'console.log(42)')
await sandbox.commands.run('node /home/user/app.js')

// npm works — from the real registry.
await sandbox.commands.run('npm i -g cowsay && cowsay hi')

Real projects

Runs real stacks, unmodified

Not toys — the actual CLIs and dev servers, running in the tab with their own npm installs.

Expo
create-expo-app
Expo SDK 54 & 57, unmodified
Vite + React
dev server + HMR in the tab
Expo
Expo Router
file-based routing previews
Supabase (tinbase)
Postgres, Auth, Studio — no Docker

Capabilities

What's in the box

Virtual filesystem

A real POSIX-like FS with permissions, symlinks, and pipes — persisted to IndexedDB so sessions survive reloads.

Bash-like shell

Pipes, redirection, globbing, variables, subshells, job control, and scripts — a shell that behaves like the one you know.

60+ Unix commands

ls, grep, sed, awk, find, tar, git, curl and more — real implementations, not stubs.

Node.js compatibility

http, fs, net, child_process, streams, crypto… enough that real CLIs and dev servers run unmodified.

Real npm & npx

Install packages straight from the npm registry and run their binaries — inside the tab.

Live previews

A service worker turns in-VM ports into real URLs, so dev servers render in an embedded browser with HMR — with a blob + postMessage fallback for browsers with incomplete service-worker support (e.g. some iOS).

AI-agent sandboxing

Run agent-generated code safely on the user's machine — no VM, no cloud sandbox, no setup.

Boots in milliseconds, $0 infra

~27 ms to a ready box in a browser tab, ~0.5 ms headless in Node. No server to provision, so it scales for free.

Open source (MIT)

The kernel, shell, and node-compat layer are open — build on them, or embed the whole thing.

How Lifo Compares

FeatureLifoWebContainers (browser)Cloudflare SandboxVercel Sandbox
Runs inBrowser tab or NodeBrowser onlyContainer on edgeCloud microVM
Cold boot~0.5 ms (Node) · ~27 ms (browser)~6.6 s~hundreds of ms~hundreds of ms – s
Download footprint0.3 MB (gzipped)~75-85 MB runtime— (server-side)— (server-side)
Special browser headersNoneCOOP/COEP requiredn/an/a
Cost / infra$0, noneCommercial licensePer-request pricingPer-use, provisioned
IsolationJS-level (not a boundary)JS-level (browser)Container / VMmicroVM (real)
Node / runtime fidelityCompat subsetNear-full NodeWorkers APIFull Linux + native
OfflineYesNoNoNo
LicenseMIT (open source)Proprietary (commercial license)Proprietary SaaSProprietary SaaS
Best forAI sandboxing, browser IDEs, previews, teachingBrowser IDEs, tutorialsEdge compute, API workersReal isolation, full Linux

Not an apples-to-apples race. WebContainers embeds a wasm build of the real Node engine — a fuller, heavier runtime. Lifo is a clean-room reimplementation of the OS and Node APIs in TypeScript: far smaller and faster to boot, but a compat subset rather than the real thing. Read these numbers as fit for a use case (AI sandboxes, browser IDEs, previews, teaching) rather than a scoreboard.

Boot times for Lifo and WebContainers were measured in the same headless Chromium — methodology & numbers.

The spectrum

Where Lifo sits among cloud sandboxes

Server-side microVMs boot fast and give you real isolation — but they run on provisioned, paid infra. Lifo trades that boundary for zero infra and instant boot, and runs the same VM either in a browser tab or in your own Node process (server-side too).

Cold start to a ready box · lower is better

Lifo (Node)
~0.5 ms
Lifo (browser)
~27 ms
Lifo (binary)
~41 ms
Firecracker microVM
~125 ms*
E2B
~150-300 ms*
Fly.io Machines
~0.3-3 s*
Vercel Sandbox
~hundreds ms-s*
WebContainers
~6.6 s

Axis capped at 1.5 s; the WebContainers browser VM tears off the end. * server-side figures are published / typical numbers — they exclude your network round-trip and are not measured in our harness.

SandboxRuns whereCold startIsolationFootprint
Lifo (Node)Your Node process~0.5 msJS-level (not a boundary)0.3 MB
Lifo (browser)Browser tab~27 msJS-level (not a boundary)0.3 MB
Lifo (binary)Any host, single file~41 msJS-level (not a boundary)59 MB
Firecracker microVMServer host~125 ms*microVM (real)
E2BCloud (Firecracker)~150-300 ms*microVM (real)
Fly.io MachinesCloud (Firecracker)~0.3-3 s*microVM (real)
Vercel SandboxCloud microVM~hundreds ms-s*microVM (real)
WebContainersBrowser tab~6.6 sJS-level (browser)~75-85 MB

Cloud microVMs (Firecracker, E2B, Fly.io, Vercel Sandbox) are a different category: real isolation and full Linux, at the cost of provisioned infra, per-use pricing, and a network hop. Pick them when you need a real boundary; pick Lifo for zero-infra, instant-boot sandboxes — in the browser or on your own server (Node).

Roadmap

Where Lifo is headed

Browser + Node benchmarks, a Node binary that isolates VMs on the host, and tunnelling to use Lifo in place of Docker for dev sandboxes.

View the roadmap →