Home/Tools/@thomasdavis/unsandbox

executeCodeAsync

@thomasdavis/unsandbox

Execute code asynchronously in a secure sandbox. Returns a job_id immediately. Use getJob to check status and retrieve results. Supports 42+ languages.

Official
ai-ml
v0.0.3
MIT
Auto-discovered
🔍

Auto-discovered tool

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.

Interactive Playground

Test @thomasdavis/unsandbox (executeCodeAsync) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @thomasdavis/unsandbox
pnpm add @thomasdavis/unsandbox
yarn add @thomasdavis/unsandbox
bun add @thomasdavis/unsandbox
deno add npm:@thomasdavis/unsandbox

2. Import the tool

import { executeCodeAsync } from '@thomasdavis/unsandbox';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { executeCodeAsync } from '@thomasdavis/unsandbox';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { executeCodeAsync },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(code: string, language: string, ttl?: number, input_files?: { content: string; filename: string }[], network_mode?: string, return_artifact?: boolean, return_wasm_artifact?: boolean) => Promise<unknown>

Tags

ai-ml
ai-sdk
async
asynchronously
check
code
code-execution
execute
getjob
immediately
job_id
sandbox
secure
status
tpmjs-tool
unsandbox

Parameters

Available configuration options

Auto-extracted
language
Required
Type: string

Programming 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.

code
Required
Type: string

The source code to execute.

input_files
Optional
Type: array

Optional array of input files to make available in /tmp/input/.

network_mode
Optional
Type: string

Network isolation mode. "zerotrust" (default) blocks all network. "semitrusted" allows outbound.

ttl
Optional
Type: number

Execution timeout in seconds (1-900). Default: 60.

return_artifact
Optional
Type: boolean

For compiled languages, return the compiled binary.

return_wasm_artifact
Optional
Type: boolean

Compile to WebAssembly. Supported for C, C++, Rust, Zig, Go.

Schema extracted: 3/1/2026, 4:29:28 AM

README

@thomasdavis/unsandbox

AI SDK tools for unsandbox

Installation

pnpm add @thomasdavis/unsandbox

Tools

This package provides 2 tools for the AI SDK:

  • exampleTool: An example tool - customize this for your use case
  • anotherTool: Another example tool - add your implementation here

Usage

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);

Development

# Install dependencies
pnpm install

# Build the package
pnpm build

# Type-check
pnpm type-check

# Watch mode
pnpm dev

Publishing

  1. Update the version in package.json
  2. Build the package: pnpm build
  3. Publish to npm: pnpm publish --access public
  4. Your tools will appear on tpmjs.com within 2-15 minutes

License

MIT

Statistics

Downloads/month

471

GitHub Stars

0

Quality Score

0%

Bundle Size

NPM Keywords

tpmjs-tool
ai-sdk
ai-ml
code-execution
sandbox
unsandbox

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)