◐ Shell
clean mode source ↗

Quickstart

Guest code is deny-by-default: the sandbox has no network access until you opt in (the filesystem and processes are fully virtualized and never touch the host). Pass a permissions policy to NodeRuntime.create() to open up capabilities. It merges over the secure default, so you only specify what you want to change. The full set of scopes, shown here all set to "allow":

const runtime = await NodeRuntime.create({

permissions: {

// Virtualized and enabled by default (these never touch the host):

fs: "allow", // the in-VM filesystem

childProcess: "allow", // spawning processes inside the VM

process: "allow", // process info (pid, cwd, ...)

env: "allow", // environment variables

// Denied by default - opt in explicitly:

network: "allow", // outbound network access

tool: "allow", // host callbacks

},

});