scratchrun_exec
Execute Python, Node, or bash in a hardened MicroVM sandbox that is purged after each run. Capture charts, CSVs, or files as base64 output and inject secrets via environment variables.
Instructions
Execute code in an ephemeral, MicroVM-isolated sandbox. The VM is hard-purged after execution — no state, no files, nothing persists between calls. Full internet egress (RFC 1918 + cloud metadata always blocked). Use return_files to capture output artifacts (charts, CSVs, data files) as base64. Keep secrets out of code strings — pass them via env instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment variables injected into the sandbox. Use for secrets and config. | |
| code | Yes | Code to execute. | |
| files | No | Files to write before execution. Keys are absolute paths, values are file contents. | |
| runtime | Yes | Runtime. python3.12 includes numpy, pandas, matplotlib, requests, and more. | |
| memory_mb | No | Memory limit in MB. | |
| timeout_ms | No | Execution timeout in milliseconds. Exit code 124 signals timeout. | |
| return_files | No | File paths to capture after execution and return as base64. Use for charts, CSVs, or any output artifact. |