In short.
This E2B documentation page shows developers how to run Pi, a terminal coding agent, inside an isolated E2B sandbox. Its main catch is that it gives no pricing, licence or Pi version details, and it warns that sandboxes can reach the open internet by default. The page describes a pre-built E2B template named pi and an interactive route (e2b sbx create pi, then pi). It also covers a headless print mode (pi -p) driven from the E2B JavaScript/TypeScript or Python SDK, a worked example that clones a Git repository and reads the resulting git diff, and a way to build a custom template on top of the pi template. Nothing was executed for this report, so every behaviour described below is what the page says, not something confirmed by running it.
Researched and written by an AI model and checked by a second AI model. How it works
The scope is the complete selected documentation page at [https://docs.e2b.dev/agents/pi.md], captured as selected-page.txt. The pages it links to were not captured or read, so their content is not covered. These are the E2B CLI, network rules, sandbox persistence and SSH access pages, plus the documentation index at [https://docs.e2b.dev/llms.txt]. The Pi site at [https://pi.dev] was not captured either. No licence file or notice was captured, so rights are unknown and no distribution files are offered. Nothing was executed: the CLI commands, SDK examples, template build and Pi's behaviour are untested. The report gives no cost, version or performance figure that the page does not state.
The overview
What this resource is
The resource is a single documentation page titled Pi on the E2B docs site at [https://docs.e2b.dev/agents/pi.md]. Its one-line description is: Run Pi in a secure E2B sandbox with full filesystem, terminal, and git access.
The page describes Pi ([https://pi.dev]) as a minimal terminal coding agent that can be extended with TypeScript extensions, skills, prompt templates and themes. It says E2B provides a pre-built template called pi with Pi already installed. The page is a how-to guide for using the two together. It is not the Pi agent itself and not the E2B platform itself.
Overall assessment
For a developer who already wants to run an AI coding agent somewhere other than their own machine, this page is a short, practical starting point. It gives copy-ready code in both TypeScript and Python, and it says plainly that the sandbox can still reach the internet and how to restrict that.
The page is short and covers one integration. It does not describe Pi's own features in depth. It does not state costs, licensing, resource limits or Pi's version, and it does not explain what happens when a run fails. Treat it as a quick-start, not a full reference. None of the examples were run for this report.
Who it is for
The page is aimed at developers who write scripts or services that call the E2B SDK (JavaScript/TypeScript or Python) and want to hand coding tasks to an AI agent without giving it access to their own computer. The cloned-repository example suggests teams that automate changes, such as adding error handling to API endpoints, and then review a diff.
It may also suit someone who prefers the command line. The page shows a CLI route that uses the E2B CLI, with Pi authenticated through /login or an API key in an environment variable. The page does not say what E2B access or authentication the CLI route needs, so those prerequisites are unknown. A complete beginner to sandboxes, API keys and Git will need background from elsewhere. The page assumes that knowledge and links out for the E2B CLI, network rules, persistence and SSH access.
What it lets you do
According to the page, you can do four things. First, create a sandbox from the pre-built pi template with the E2B CLI and start Pi interactively inside it. Second, run Pi non-interactively in -p print mode from the E2B SDK and read its output from result.stdout. Third, clone a repository into the sandbox, run Pi against it, stream Pi's output with an onStdout or on_stdout callback, and read git diff afterwards. Fourth, build your own template on top of pi with a chosen CPU count and memory size (the example uses 2 CPUs and 2048 MB).
The page says the sandbox gives Pi full filesystem, terminal and git access while keeping it away from the host machine's files and credentials. It also says Pi can be extended with TypeScript extensions, skills, prompt templates and themes, but it does not show how to do that.
Using it
What you need
The examples use the E2B CLI or the e2b SDK package for JavaScript/TypeScript or Python. They also use a model provider credential for Pi, given either through the /login command with a supported subscription provider or through an environment variable (the examples use ANTHROPIC_API_KEY). The repository example uses a GITHUB_TOKEN with access to your repository. The build step runs with npx tsx build.ts or python build.py, so it needs Node.js with tsx or a Python environment.
The page does not state what E2B access or authentication you need for the CLI or the SDK. Whether you need an account, an API key or a particular plan is therefore unknown from this evidence. The page also does not say which Node.js or Python versions are supported, or which model providers and subscription providers Pi supports beyond saying it supports multiple providers. Those details are unknown too.
How it works
The mechanism is a pre-built E2B template named pi. Creating a sandbox from it (CLI: e2b sbx create pi; SDK: Sandbox.create with the template name pi) gives you an isolated environment with Pi installed. Inside it, Pi is an ordinary command-line program. In headless mode the SDK calls sandbox.commands.run with a string such as pi -p followed by a prompt, and the output comes back in stdout.
The page says Pi shows no permission prompts for its built-in tools, so no auto-approval flag is needed. That means Pi can read and modify files and run shell commands without asking, and the sandbox itself is the safety boundary. The page states that Pi cannot access host files or credentials but can make outbound network requests. Hostname-based network rules apply only to HTTP(S) traffic; for other protocols the page says to use CIDR rules.
Custom templates start from the pi template (Template().fromTemplate('pi') in TypeScript, Template().from_template('pi') in Python). They are built with Template.build, which takes a template object, a name such as my-pi, CPU and memory settings, and a build log handler. The page does not cover how E2B implements sandboxes internally.
Setup steps
Interactive route: create a sandbox with the E2B CLI using e2b sbx create pi, then run pi inside it. Authenticate with /login for a supported subscription provider, or supply an API key through an environment variable.
Scripted route: install the e2b SDK and call Sandbox.create with the pi template, passing the model key through the envs option (the page reads ANTHROPIC_API_KEY from the local environment). Run pi -p with a prompt through sandbox.commands.run, print stdout, and call kill when finished. For the repository workflow, configure a 10-minute sandbox timeout (600,000 ms in TypeScript or 600 seconds in Python). Then clone the repository into /home/user/repo, run Pi from that directory, and run git diff.
Custom template route: write a template file that starts from pi, write a build file that calls Template.build with a template name and CPU and memory values, then run it. The page does not say how E2B authentication is configured for these scripts, so check E2B's own documentation for that.
Worked example from the page
The page's repository example creates a sandbox from pi with ANTHROPIC_API_KEY passed into the sandbox environment and a 10-minute timeout. It makes a shallow clone (--depth 1) of your repository using a URL that embeds GITHUB_TOKEN. The token is passed as an environment variable on the clone command only, not when the sandbox is created. The example then runs: cd /home/user/repo && pi -p "Add error handling to all API endpoints". It streams Pi's output to the local console, runs git diff in the sandbox, prints the diff and kills the sandbox. A Python version follows the same steps.
The page does not say whether the GitHub token, or the clone URL that contains it, can still be read inside the sandbox after the clone command finishes. Whether the token persists is therefore unknown. Because the page says sandboxes have open internet access by default, readers working with private repositories may want a narrowly scoped, short-lived token and outbound network rules. The example prints the diff but does not commit or push it, so reviewing the diff before applying it elsewhere is a natural step.
Assessment & evidence
Limitations and risks
The page itself warns that sandboxes can reach the open internet by default, so an agent running inside one can still make outbound requests. In the examples, ANTHROPIC_API_KEY is passed into the sandbox environment for Pi to use. GITHUB_TOKEN is supplied only to the clone command, and the page does not say whether it stays accessible afterwards. The page says the sandbox keeps Pi away from host files and credentials. It also says Pi can make outbound requests unless you restrict them with network rules, and hostname rules cover only HTTP(S) traffic.
Pi shows no permission prompts for its built-in tools, so there is no approval step before it edits files or runs commands in the sandbox. The page does not assess output quality, the correctness of changes or the reliability of print mode, and nothing was executed for this report.
The page does not give Pi's version or the version installed in the template. It also omits sandbox resource limits, the default timeout, the list of supported model providers, how long sandboxes persist and how the pi template is kept current. The related guides on persistence and SSH access are only linked and were not read.
Why these conclusions
The conclusions come only from the one captured page. Statements about what Pi, the template and the SDK do are reported as the page's claims. Where the page is silent (pricing, licence, versions, limits, provider list), this report marks the point unknown rather than filling the gap.
On credentials, the report keeps to what the examples show. The model key is passed into the sandbox environment, and the GitHub token is passed only to the clone command. The page does not say whether the GitHub token can still be reached inside the sandbox after the clone, so that is treated as unknown.
Alternatives to consider
The page does not compare itself with anything, so no alternatives were assessed from the evidence. Running Pi directly on your own machine, or inside another container or sandbox setup you already operate, are unverified possibilities. This page does not establish their setup or suitability, and this report does not evaluate them.
If you only want to customise the environment, the page offers its own option: build a custom template on top of pi. The page header also links a documentation index at [https://docs.e2b.dev/llms.txt] as a general way to discover other pages. That index was not captured, so it does not establish what other agents or options are available.
Evidence base
The evidence is one captured file, selected-page.txt (5,399 bytes), taken from [https://docs.e2b.dev/agents/pi.md]. It contains the page description, the CLI steps, the headless examples in TypeScript and Python, the cloned-repository example, the custom template instructions, a note about outbound network access and two related-guide links. The capture covers the complete selected page.
No code was run, no sandbox was created and no model provider was called. Claims about behaviour are the documentation's own statements and have not been independently confirmed.
Access & freshness
Costs
The page states no prices. E2B charges, model-provider billing arrangements and total costs are unknown from this page. Any free tier or plan limits, and the cost of building and storing custom templates, are also unknown from this evidence.
The repository examples configure a 10-minute sandbox timeout; actual duration and model usage are not established. Check E2B's current pricing and your model provider's pricing before running anything at scale.
Rights and licence
The captured page does not state a licence for the documentation, the code samples, Pi or the pi template, so reuse rights are unknown from this evidence. The code snippets are presented as usage examples for E2B's own SDK, but the page does not say on what terms you may copy them.
Pi is hosted at [https://pi.dev], and its licence was not captured. Check that site and E2B's terms of service before relying on either in a product. Because no licence evidence was captured, no files from this source are offered for redistribution.
Freshness
The page was captured on 15 November 2026. The captured text shows no publication date, last-updated date or version number for the page, Pi or the pi template, so the evidence does not show how current the instructions are. Command names, SDK options and template names can change, so compare the examples against E2B's current documentation before relying on them.
Suggested next steps
Before using it, check E2B's current pricing, sandbox limits and access requirements. Check Pi's licence and current release at [https://pi.dev], and confirm which model providers your Pi version supports.
When trying it, start with the interactive route or a throwaway repository. Use a model API key and GitHub token with the narrowest scope and shortest life you can. Apply outbound network rules (CIDR rules for non-HTTP traffic) before giving the agent anything sensitive, and review the git diff output before merging any change. Build a custom template only once the basic flow works for you.
