Code Execution
Configure execution environments for LLM tool calls
Code execution for my-ai-agent project
Stateful Code Execution for AI Agents
Configure execution templates that your LLM uses via the code_exec tool. Sessions persist state between calls - your LLM can resume execution with the same sandbox ID, saving tokens and enabling parallel tool calls.
55.4K
Total Executions
2
Active Sessions
How it works
{
"tool": "code_exec",
"code": "x = 1 + 1\nprint(x)"
}{
"output": "2",
"sandbox_id": "sb-exec-a8f3k2"
}{
"tool": "code_exec",
"sandbox_id": "sb-exec-a8f3k2",
"code": "print(x * 10)" // x still = 2
}Configure Docker-based environments for code execution. Set one as default for your code_exec tool.
TypeScript (Bun)
DEFAULTLightning-fast Bun runtime with native TypeScript support
oven/bun:latestPackages
256MB
Memory
0.5 CPU
CPU
30s
Timeout
TypeScript (Node)
Node.js 20 with tsx for native TypeScript execution
node:20-alpinePackages
256MB
Memory
0.5 CPU
CPU
30s
Timeout
Node.js
Node.js 20 LTS with common utility packages
node:20-alpinePackages
256MB
Memory
0.5 CPU
CPU
30s
Timeout
Python
Python 3.12 with requests, BeautifulSoup, and common utilities
python:3.12-slimPackages
256MB
Memory
0.5 CPU
CPU
30s
Timeout
Deno
Secure Deno runtime with built-in TypeScript and web APIs
denoland/deno:latestPackages
256MB
Memory
0.5 CPU
CPU
30s
Timeout
Go
Go 1.22 for fast compiled execution
golang:1.22-alpinePackages
256MB
Memory
0.5 CPU
CPU
30s
Timeout