Skip to content

createSandboxTool

function createSandboxTool(sandbox, options?): Promise<SandboxTool>;

Defined in: tool/tool.ts:86

Expose a Sandbox as a single code-execution tool for an agent.

The tool reads the latest sandbox.data item for its input state, runs the script, and emits a new version on success — never in between, so a rejected or abandoned run leaves the notebook state untouched. A SandboxInterrupt is translated into a ToolInterrupt whose private state checkpoints the call log; on resumption the script replays from the log and the answer is delivered to the call that interrupted.

Parameter Type
sandbox Sandbox
options CreateSandboxToolOptions

Promise<SandboxTool>