Hardened by default
Every invocation runs in a fresh QuickJS context without ambient access to Node.js, files, environment variables, modules, or the network.
Execute agent-generated code in a hardened sandbox.
pnpm add runGuest code accesses only the host functions you provide.
Learn how the sandbox worksimport { run } from 'run';
const result = await run({
source: `
const doubled = await tools.double(21);
return { message: 'Hello from the sandbox!', doubled };
`,
hostFunctions: {
tools: {
double: (value: number) => value * 2,
},
},
});
if (result.status === 'completed') {
console.log(result.value);
}Every invocation runs in a fresh QuickJS context without ambient access to Node.js, files, environment variables, modules, or the network.
Expose only the host functions your guest code needs. Inputs and outputs cross a serialized boundary you control.
Interrupt execution for approval or authentication, then resume from a signed continuation without repeating completed work.