Runtimes

Available sandbox runtimes, custom templates, and pre-installed packages for Python, Node.js, and Deno environments.

Available Runtimes

Each sandbox boots with a pre-configured runtime environment. Choose the runtime that matches your agent's needs.

Python 3.12

const sandbox = await tx.sandboxes.create({
  runtime: 'python-3.12',
});

Pre-installed packages:

  • pip (latest)
  • setuptools, wheel
  • requests
  • json, csv, re (standard library)

Package manager: pip install <package>

Node.js 20

const sandbox = await tx.sandboxes.create({
  runtime: 'node-20',
});

Pre-installed tools:

  • npm (latest)
  • yarn (v1)
  • npx

Package manager: npm install <package>

Deno

const sandbox = await tx.sandboxes.create({
  runtime: 'deno',
});

Features:

  • Secure by default (explicit permission flags)
  • Built-in TypeScript support
  • URL-based imports, no package manager needed

Run with permissions: deno run --allow-net --allow-read script.ts

Runtime Comparison

FeaturePython 3.12Node.js 20Deno
Package managerpipnpm/yarnURL imports
TypeScriptNo (use mypy)Via tsx/ts-nodeBuilt-in
Async modelasyncioEvent loopEvent loop
Best forData science, scriptingWeb APIs, toolingSecure scripting
Startup~150ms~120ms~130ms

Custom Templates

Create reusable sandbox templates with pre-installed packages and configuration. Templates snapshot a sandbox state so new instances boot with everything already installed.

Create a Template

// 1. Create a base sandbox
const sandbox = await tx.sandboxes.create({
  runtime: 'python-3.12',
});
 
// 2. Install your dependencies
await tx.sandboxes.run(sandbox.id, {
  command: 'pip',
  args: ['install', 'pandas', 'numpy', 'scikit-learn', 'matplotlib'],
});
 
// 3. Add configuration files
await tx.sandboxes.writeFile(sandbox.id, {
  path: '/home/user/.config/settings.json',
  content: JSON.stringify({ theme: 'dark', verbose: true }),
});
 
// 4. Save as template
const template = await tx.sandboxes.createTemplate(sandbox.id, {
  name: 'data-science',
  description: 'Python with pandas, numpy, scikit-learn, matplotlib',
});
 
// 5. Clean up the base sandbox
await tx.sandboxes.destroy(sandbox.id);

Use a Template

const sandbox = await tx.sandboxes.create({
  template: 'data-science',
});
 
// pandas, numpy, etc. are already installed
const result = await tx.sandboxes.run(sandbox.id, {
  command: 'python3',
  args: ['-c', 'import pandas; print(pandas.__version__)'],
});

List Templates

const templates = await tx.sandboxes.listTemplates();
 
for (const t of templates) {
  console.log(`${t.name} (${t.runtime}) - ${t.description}`);
}

Resource Configuration by Runtime

You can customize resource allocation per sandbox:

const sandbox = await tx.sandboxes.create({
  runtime: 'python-3.12',
  resources: {
    cpu: 2,        // vCPUs (1-4)
    memory: 1024,  // MB (256-4096)
    disk: 5120,    // MB (1024-10240)
  },
  timeout: 600,    // seconds (max 3600)
  network: true,   // enable outbound network access
});

Next Steps