Skip to content

WASM Sandbox

WASM sandboxes run guest modules inside isolated worker processes on the host. They boot quickly, share the same toolbox and routing model as Docker sandboxes, and support optional checkpoint durability for daemon restarts and cluster failover.

Pass runtime: "wasm" and a module_ref. The simplest module_ref is a standard-module keyword your operator has staged on every node — e.g. "python" or "javascript" — so you never reference a host path. A module_ref can also be an oci:// registry ref (for your own modules, see WASM modules) or, for self-managed hosts, a file path. Set durability to passivatable or durable when you need restart survival.

import { MicroVM } from '@aerol-ai/aerolvm-sdk'
const client = new MicroVM({
apiUrl: process.env.SB_API_URL,
patToken: process.env.SB_PAT_TOKEN,
})
const sandbox = await client.create({
module_ref: 'python',
runtime: 'wasm',
cpu: 0.5,
memoryMB: 256,
durability: 'passivatable',
})
console.log(sandbox.id)

durability is the same cross-runtime create field documented under Durability and Failover — WASM just defaults to ephemeral (worker processes die with the daemon) instead of passivatable, and is the only runtime that currently implements durable. The values below describe how WASM backs each class:

ClassBehavior
ephemeralDefault for WASM. Lost on daemon restart.
passivatableCheckpointed to local mem.snap on drain; rehydrates on start.
durableLocal checkpoint plus AOCR push for cross-node failover.