@tpmjs/tools-unsandbox
Execute code synchronously in a secure sandbox. Waits for completion and returns results directly. Best for quick scripts.
Unsupported language: "test". Supported languages: python, javascript, typescript, ruby, perl, php, lua, bash, r, elixir, erlang, tcl, scheme, powershell, clojure, commonlisp, crystal, groovy, deno, awk, raku, c, cpp, go, rust, java, kotlin, cobol, fortran, d, zig, nim, v, objc, dart, julia, haskell, ocaml, fsharp, csharp, prolog, forth
Last checked: 3/1/2026, 4:27:07 AM
Test @tpmjs/tools-unsandbox (execute) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-unsandboxpnpm add @tpmjs/tools-unsandboxyarn add @tpmjs/tools-unsandboxbun add @tpmjs/tools-unsandboxdeno add npm:@tpmjs/tools-unsandboximport { execute } from '@tpmjs/tools-unsandbox';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { execute } from '@tpmjs/tools-unsandbox';
const result = await generateText({
model: openai('gpt-4o'),
tools: { execute },
prompt: 'Your prompt here...',
});
console.log(result.text);(code: string, language: string, env?: Record<string, unknown>, ttl?: number, vcpu?: number, input_files?: { content: string; filename: string }[], network_mode?: string, return_artifact?: boolean, return_wasm_artifact?: boolean) => Promise<unknown>Available configuration options
languagestringProgramming language to execute
codestringThe source code to execute
input_filesarrayOptional array of input files to make available in /tmp/input/
envobjectEnvironment variables as key-value pairs.
network_modestringNetwork isolation mode. Default: 'zerotrust'
ttlnumberExecution timeout in seconds (1-900). Default: 60.
vcpunumberNumber of vCPUs (1-8). Each vCPU includes 2GB RAM. Default: 1.
return_artifactbooleanFor compiled languages, return the compiled binary.
return_wasm_artifactbooleanCompile to WebAssembly. Supported for C, C++, Rust, Zig, Go.
Schema extracted: 3/1/2026, 4:27:06 AM
ERROR: No README data found!
Downloads/month
560
GitHub Stars
0
Quality Score