Best sandboxes for code interpreters and data analysis
For code interpreters, our top picks are E2B, Azure Container Apps dynamic sessions and AWS Bedrock AgentCore. We weight fast startup, stateful Python execution, file handling, isolation and simple pricing.
What code interpreters need from a sandbox
A code interpreter lets a model run Python to analyse data, do maths, draw charts and convert files. Sessions are short and frequent, so the needs are:
- Fast startup — users wait while the sandbox boots.
- Stateful execution (Jupyter-style kernels) so variables persist across calls in a conversation.
- File upload/download and rich outputs such as charts.
- Strong isolation because every user’s code is untrusted, and ideally no network by default.
Best sandboxes for code interpreters and data analysis, ranked
E2B
Open-source cloud sandboxes for AI agents, each a Firecracker microVM, with pause/resume, snapshots and forking.
- Firecracker microVM
- Open source
- Self-hostable
- BYOC
- Pause/resume
Why it’s here: A dedicated Code Interpreter SDK with stateful Jupyter-style execution and chart output, on Firecracker microVMs, with pre-built templates and generous free credit.
Azure Container Apps dynamic sessions
Azure service that hands out Hyper-V-isolated sessions from prewarmed pools, either as a built-in code interpreter or running your own container image.
- Hyper-V VM
Why it’s here: Hyper-V-isolated Python and Node interpreters from prewarmed pools with egress disabled by default and first-party LangChain, LlamaIndex and Semantic Kernel tools. 220-second execution cap.
AWS Bedrock AgentCore
AWS’s managed agent platform: a Code Interpreter tool for running agent-generated code and a Runtime that hosts each agent session in its own microVM.
- MicroVM (Runtime)
Why it’s here: Managed Code Interpreter with sessions up to 8 hours, IAM/VPC integration and CPU billing that skips I/O wait.
OpenAI Code Interpreter & Hosted Shell
Hosted containers in the OpenAI Responses API that the model uses to run Python (Code Interpreter) or shell commands (Hosted Shell).
- VM (unspecified)
Why it’s here: Zero extra infrastructure if you are already on the OpenAI Responses API; tied to OpenAI models.
Google Agent Platform Code Execution
Google-managed sandbox API (formerly part of Vertex AI Agent Engine) that lets agents deployed anywhere run Python in stateful, network-isolated environments.
- gVisor
Why it’s here: gVisor-isolated, no-network Python with state retained up to 14 days; fixed library set.
Modal Sandboxes
Sandboxes on Modal’s serverless compute platform for running untrusted code at very high scale, with GPUs, snapshots and tunnels.
- gVisor or VM
- GPU
- Pause/resume
Why it’s here: Fast-starting gVisor sandboxes with GPUs for heavier analysis or ML inside the interpreter.
Side by side
| Sandbox | Isolation | Open source | Self-host / BYOC | Cold start (vendor) | Max session | Snapshots / pause | GPU | SDKs |
|---|---|---|---|---|---|---|---|---|
| E2B | Firecracker microVM | Yes | Yes / Yes | Not documented | 1 h / 24 h (Pro) | Yes / Yes | No | Python, JavaScript/TypeScript |
| Azure Container Apps dynamic sessions | Hyper-V VM | No | No / No | Sub-second (pooled) | 220 s / exec | No / No | No | REST API, Azure CLI, LangChain, LlamaIndex, Semantic Kernel |
| AWS Bedrock AgentCore | MicroVM (Runtime) | No | No / No | Not documented | Up to 8 h | Not documented / Not documented | No | Python (AgentCore SDK), AWS SDKs, AWS CLI |
| OpenAI Code Interpreter & Hosted Shell | VM (unspecified) | No | No / No | Not documented | 20 min idle | No / No | No | OpenAI Responses API, Containers API, OpenAI SDKs |
| Google Agent Platform Code Execution | gVisor | No | No / No | <1 s (warm) | 14-day state | No / Not documented | No | Python (Agent Platform SDK), REST API |
| Modal Sandboxes | gVisor or VM | No | No / Not documented | <1 s | Up to 24 h | Yes / Yes | Yes | Python, JavaScript/TypeScript, Go |
Frequently asked questions
What is the easiest way to add a code interpreter to my AI app?
Cite this page
Agent Sandboxes. (2026). Best sandboxes for code interpreters and data analysis. agentsandboxes.org. Last reviewed November 8, 2026. https://agentsandboxes.org/best/code-interpreter/
Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.