Pi
Run the Pi coding agent in a sandbox from the prebuilt pi template. Pi reads, edits and runs commands without prompts, so the sandbox keeps all of it off your machine.
- E2B
- Prebuilt pi sandbox template
- e2b
- TypeScript, Python
Get started
Paste the prompt into your coding agent, or follow the steps yourself.
Paste this into your coding agent
Run Pi in an E2B sandbox from this project.
- 1.Install the e2b SDK using the project's package manager.
- 2.The SDK needs the E2B_API_KEY environment variable, and Pi needs a model provider key such as ANTHROPIC_API_KEY. If E2B_API_KEY isn't set, ask me for my API key from https://console.e2b.dev/?tab=keys. Never hardcode either key.
- 3.Follow the Pi guide at https://docs.e2b.dev/agents/pi: create a sandbox from the pi template, pass the provider key in envs, and run pi -p "<task>" in print mode. Kill the sandbox when it's done.
- 4.Run one task and show me the output that came from the sandbox.
Or set it up yourself
1. Install the E2B SDK
2. Set your API keys
3. Run Pi in print mode
What runs in the sandbox
Pi and every file edit and shell command it makes stay inside the sandbox.
- Pi in print mode. It shows no permission prompts for its built-in tools, so none need auto-approving.
- The repo you clone and every change Pi makes. Read the result back with git diff.
- Pi can't reach your host files or credentials. Only the provider key you pass in envs is there.
- Internet access is on by default. Limit it with outbound rules by CIDR or hostname.
More coding agents
Other coding agents that run in E2B sandboxes.
- OpenCodeRun OpenCode in a sandbox, or keep it local and point its workspaces at E2B with the @e2b/opencode plugin.
- Hermes AgentRun Hermes Agent in a sandbox template, or keep it local and execute its terminal tools on E2B.
- Claude CodeRun Claude Code in its own sandbox with a real filesystem, terminal, and git, so it can work unattended.
