runtime.command (code runtime) or loop config (managed loop) run in E2B sandboxes. The platform automatically selects the right base image based on your agent’s entrypoint:
JavaScript agents get a dedicated Node.js sandbox template with both Node.js and Python pre-installed. Dependencies from
package.json are installed automatically via npm ci (when a lockfile is present) or npm install.
Custom environments let you add dependencies beyond the defaults.
Predefined Environments
Four ready-to-use environments are available to all users:Set as Workspace Default
All agents in your workspace can use a default environment: Via CLI:Custom Environments
Need specific packages? Include aDockerfile in your agent directory.
Quick Start
--docker flag:
You don’t need Docker installed locally. The platform handles all building.
Dockerfile Guidelines
Base image (required):Example: Video Processing Agent
CLI Commands
Environment Priority
When running an agent in a sandbox:- Agent-specific — Dockerfile in bundle creates dedicated environment
- Workspace default — Falls back to workspace’s default environment
- Base image — Uses E2B’s base
code-interpreterif neither set
Dynamic workspace defaults: Changing your workspace default immediately affects all agents that don’t have their own Dockerfile. Existing agents without agent-specific environments will use the new default on their next run.
Service Environments
Always-on services use a different runtime from on-demand runs:
Service dependencies are installed from your
requirements.txt or package.json during deployment. The service runner pre-installs common tools (pip, npm, git).
Custom Dockerfiles are not yet supported for services. If your service needs system packages beyond the defaults, use a
run_command in your manifest that installs them at startup.