Key Features
- Python 3.11+ - Full Python stdlib
- JavaScript/Node.js - Modern ES6+ support
- Sandboxed - Isolated from system and other sessions
- 30-second timeout - Prevents runaway code
- No Network Access - Isolated from external services
- Input/Output Handling - Pass data to code and capture results
- No Dependencies - Core libraries only (upgrade to Sandbox for pip/npm)
How to Enable
For Agents
- Agents > Select Agent > Settings > Capabilities
- Attach Code Runner
For MCP Gateways
- Gateways > Select Gateway > Capabilities
- Attach Code Runner
Usage Examples
Python Calculation
JavaScript Data Processing
JSON Parsing
Input/Output
Pass Data to Code
Return Structured Data
Available Libraries
Python Standard Library
- json, csv, re, datetime, math, statistics
- collections, itertools, functools
- hashlib, urllib, base64
- logging, pprint, sys, os (limited)
JavaScript Standard Library
- All ES6+ features
- JSON, Math, Date, RegExp
- Array methods, String methods
- No external npm packages
Resource Limits
| Limit | Value | Notes |
|---|---|---|
| Timeout | 30 seconds | Maximum execution time |
| Memory | 128MB | Per execution (configurable up to 512MB) |
| CPU Time | ~100ms | Maximum CPU time |
| Code Size | 10KB | Maximum code length |
| Output Size | 1MB | Console output limit |
| Network | Disabled | No HTTP requests allowed |
| File I/O | Disabled | No file read/write |
Limitations
- No network access
- No file I/O (use Files capability instead)
- No package installation (use Sandbox for pip/npm)
- No background processes
- No system calls
Cost
For current pricing details, see Pricing. Monitor in Account > Usage dashboard.Common Recipes
Format Data
Calculate Statistics
Transform JSON
Troubleshooting
Timeout Error
Code ran longer than 30 seconds. Optimize for speed or use Sandbox for heavy computation.Memory Error
Exceeded 128MB memory limit. Reduce data size or process in chunks.Module Not Found
Only stdlib available. For third-party packages, use Sandbox instead.No Output Captured
Ensure you print() or return results. Code without output shows success but no data.When to Use
| Use Case | Capability |
|---|---|
| Quick calculations | Code Runner ✓ |
| Data transformation | Code Runner ✓ |
| JSON parsing | Code Runner ✓ |
| Heavy computation | Sandbox |
| External packages | Sandbox |
| File operations | Files |
| Web requests | HTTP Client |