Learning resourcesReviewed · E2B

Running Factory Droid in an E2B sandbox

This guide shows developers how to run Factory's Droid coding agent in an E2B sandbox, but automated use requires a Factory API key and costs are unspecified. It covers interactive sessions, headless execution through JavaScript/TypeScript or Python, repository editing and custom sandbox templates.

Researched 14 Nov 2026

In short.

This E2B guide helps developers run Factory's Droid coding agent in a sandbox, but service setup and running costs need separate investigation. It uses a prebuilt droid template for interactive and automated coding tasks, then shows repository cloning, diff inspection and custom-template building. Its examples provide concrete integration steps, but no commands were executed and task quality, security enforcement and reliability were not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete page at [https://docs.e2b.dev/agents/droid.md]: its documentation-index notice, interactive CLI instructions, headless SDK examples, repository workflow, custom-template builds and related-guide links. Linked destinations, including the documentation index, Factory product and settings pages, E2B CLI documentation, persistence guide and SSH guide, are excluded. No commands, SDK calls, builds or agent tasks were executed. Runtime behavior, task quality, compatibility, security enforcement and costs were not assessed.

The overview

What this guide covers

The resource is E2B's Droid documentation at [https://docs.e2b.dev/agents/droid.md]. Droid is Factory's coding agent and CLI; E2B supplies a prebuilt sandbox template named droid with the agent already installed.

The guide explains how to combine these products. It describes filesystem, terminal and git access inside the sandbox.

Practical fit

The guide is useful as a starting recipe for developers building automated coding jobs in E2B. Parallel JavaScript/TypeScript and Python examples make the integration steps concrete.

It does not establish how reliably Droid completes coding tasks or whether this setup meets production requirements. Account setup, failure recovery and validation of generated changes need further work.

Who it helps

The strongest fit is developers who want to launch a coding agent programmatically, let it work on files or a repository, and inspect its output. Developers needing preinstalled dependencies or configuration can also use the custom-template example.

Beginners can follow the overall sequence, but the page assumes familiarity with terminal commands, environment variables, SDK imports and git. It does not teach those foundations.

Documented capabilities

The page documents interactive Droid sessions and non-interactive tasks through droid exec. SDK examples create a sandbox, pass credentials, execute commands, read standard output and explicitly terminate the sandbox.

The repository examples add a shallow GitHub clone, streamed output and git diff inspection. Custom-template examples inherit from droid and build a template named my-droid with two CPUs and 2,048 MB of memory; these are example build settings, not stated minimum requirements.

Using it

What you need

Following the examples requires access to E2B and either its CLI or the e2b SDK for JavaScript/TypeScript or Python. The page does not provide E2B installation or authentication instructions.

Headless Droid execution authenticates through FACTORY_API_KEY, obtained from [https://app.factory.ai/settings/api-keys]. The repository example also expects GITHUB_TOKEN to authenticate access to the chosen GitHub repository. Required token permissions and service entitlements are unspecified.

How the integration works

E2B creates an environment from the droid template, and the caller starts Droid inside it. For automation, the SDK passes FACTORY_API_KEY into the sandbox and runs a natural-language task through droid exec --auto low.

The documentation describes --auto low as allowing safe file edits and non-destructive commands. Its enforcement details are not explained. The repository workflow runs Droid in the cloned working directory, retrieves a diff and then calls sandbox.kill().

Setup paths

For interactive use, the page gives e2b sbx create droid, followed by droid inside the sandbox. For automated use, it shows Sandbox.create with the droid template and an environment mapping for the Factory API key.

For customization, the examples inherit through fromTemplate('droid') in TypeScript or from_template('droid') in Python, then use Template.build. The build scripts run through npx tsx build.ts or python build.py. Actual dependency installation and configuration changes are not demonstrated.

Example tasks

The simplest example asks Droid to create a basic HTTP server in Go, prints standard output and terminates the sandbox. No resulting server code or execution result is supplied.

The repository example clones a placeholder GitHub repository, requests error handling across API endpoints, streams output and prints git diff. Its timeout is 600,000 milliseconds in JavaScript/TypeScript and 600 seconds in Python, both ten minutes. The example contains no endpoint tests or evidence that the requested changes were completed.

Assessment & evidence

Limits and unanswered questions

The page calls the sandbox secure but does not describe isolation architecture, network restrictions, secret handling or data retention. Neither that description nor the --auto low setting establishes a verified security guarantee.

The examples show termination after successful execution but no exception handling, retries or cleanup after failures. They also do not implement artifact persistence. Persistence and SSH access appear only as links to separate guides.

Tradeoffs

The create, run, inspect and terminate sequence suggests a useful pattern for short-lived coding jobs. The prebuilt template avoids installing Droid within each example, while a derived template offers a place for environment customization.

That pattern also makes output collection and lifecycle handling important. The examples retrieve standard output or a diff before termination, but leave preservation of working files and recovery from interrupted jobs unspecified.

Choices described by the guide

The page offers interactive CLI use for hands-on sessions and SDK-driven headless execution for automation. It also offers a derived template when the environment needs customization.

It provides no comparison with other coding agents or sandbox services. Relative quality, speed, cost and isolation are unknown.

Source evidence

The source is the complete E2B documentation page at [https://docs.e2b.dev/agents/droid.md], captured at 2026-11-14T20:22:49.584Z. The source snapshot has SHA-256 4a7469eff9a51ee8f261c79e1a040ec458ef6fe3246dd6e3b2e4214d9be2e7f2.

The page supplies instructions and code snippets. It contains no task outputs, execution logs, benchmarks or independent security findings.

Access & freshness

Costs

Prices, free allowances, billing units and usage limits for E2B and Factory are not supplied. Custom-template build costs are also unknown.

The timeout, CPU count and memory allocation are example configuration values. They do not establish the cost of a task or a monthly deployment.

Licensing and usage rights

The page states no licence for its text or code snippets and supplies no service terms for E2B or Droid. Redistribution permission, generated-code ownership and data-use terms are unknown from this page.

The repository example demonstrates authenticated access, but it establishes no rights to modify or redistribute any particular repository.

Dates and versions

The capture date establishes when this text was obtained, not when its instructions were last updated. The page supplies no publication date, update date, Droid version, SDK version or immutable revision of the droid template.

Compatibility with a particular installed release cannot be established from these examples alone.

Before using it

Confirm E2B access, Factory authentication, current SDK compatibility and both services' pricing and terms. Start with a disposable repository, inspect the resulting diff and run relevant project tests before accepting changes.

Review credential handling because the clone example embeds GITHUB_TOKEN in its HTTPS URL. Decide how to retain output and files, and ensure cleanup still occurs if a command fails. These are recommended follow-up steps; none were performed.

Evidence for this report

selected-page.txtselected · checked 2026-11-14