@thomasdavis/unsandbox
Execute code synchronously in a secure sandbox. Supports 42+ languages including python, javascript, typescript, go, rust, c, cpp, java, ruby, and more. Returns stdout, stderr, and exit code.
This tool was automatically discovered from the package exports. The author did not explicitly register it in their package.json. Schema and description were auto-extracted.
Test @thomasdavis/unsandbox (executeCode) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @thomasdavis/unsandboxpnpm add @thomasdavis/unsandboxyarn add @thomasdavis/unsandboxbun add @thomasdavis/unsandboxdeno add npm:@thomasdavis/unsandboximport { executeCode } from '@thomasdavis/unsandbox';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { executeCode } from '@thomasdavis/unsandbox';
const result = await generateText({
model: openai('gpt-4o'),
tools: { executeCode },
prompt: 'Your prompt here...',
});
console.log(result.text);(code: string, language: string, ttl?: 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. Supported: 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. Aliases: node/js -> javascript, ts -> typescript, lisp -> commonlisp.
codestringThe source code to execute.
input_filesarrayOptional array of input files to make available in /tmp/input/. Each file needs filename and base64-encoded content.
network_modestringNetwork isolation mode. "zerotrust" (default) blocks all network access. "semitrusted" allows outbound connections.
ttlnumberExecution timeout in seconds (1-900). Default: 60.
return_artifactbooleanFor compiled languages, return the compiled binary as base64.
return_wasm_artifactbooleanCompile to WebAssembly and return as base64. Supported for C, C++, Rust, Zig, Go.
Schema extracted: 3/1/2026, 4:29:44 AM
AI SDK tools for unsandbox
pnpm add @thomasdavis/unsandbox
This package provides 2 tools for the AI SDK:
import { exampleTool } from '@thomasdavis/unsandbox'; import { generateText } from 'ai'; import { openai } from '@ai-sdk/openai'; const result = await generateText({ model: openai('gpt-4'), prompt: 'Process this text for me', tools: { exampleTool, }, }); console.log(result.text);
# Install dependencies pnpm install # Build the package pnpm build # Type-check pnpm type-check # Watch mode pnpm dev
package.jsonpnpm buildpnpm publish --access publicMIT
Downloads/month
471
GitHub Stars
0
Quality Score