Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/manuals/ai/sandboxes/agents/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Docker Sandboxes runs the following agents out of the box:
- [Claude Code](claude-code/)
- [Codex](codex/)
- [Copilot](copilot/)
- [Factory](factory/)
- [Gemini](gemini/)
- [Kiro](kiro/)
- [OpenCode](opencode/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ CLI, and common development tools like Node.js, Python, Go, and Java.
| `codex` | [OpenAI Codex](https://github.com/openai/codex) |
| `copilot` | [GitHub Copilot](https://github.com/github/copilot-cli) |
| `docker-agent` | [Docker Agent](https://github.com/docker/docker-agent) |
| `factory-ai` | [Factory](https://www.factory.ai) |
| `gemini` | [Gemini CLI](https://github.com/google-gemini/gemini-cli) |
| `kiro` | [Kiro](https://kiro.dev) |
| `opencode` | [OpenCode](https://opencode.ai) |
Expand Down
75 changes: 75 additions & 0 deletions content/manuals/ai/sandboxes/agents/factory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Factory
weight: 35
description: |
Use Factory (droid) in Docker Sandboxes with API key or OAuth authentication.
---

{{< summary-bar feature_name="Docker Sandboxes sbx" >}}

This guide covers authentication, configuration, and usage of Factory in a
sandboxed environment. Factory runs using the `droid` CLI.

Official documentation: [Factory](https://docs.factory.ai/)

## Quick start

Create a sandbox and run Factory for a project directory:

```console
$ sbx run factory-ai ~/my-project
```

The workspace parameter is optional and defaults to the current directory:

```console
$ cd ~/my-project
$ sbx run factory-ai
```

## Authentication

Factory requires a [Factory account](https://factory.ai). Both authentication
methods authenticate you to Factory's service directly — unlike other agents
where you supply a model provider key, Factory manages model access through
your Factory account.

**API key**: Store your Factory API key using
[stored secrets](../security/credentials.md#stored-secrets):

```console
$ sbx secret set -g factory
```

Alternatively, export the `FACTORY_API_KEY` environment variable in your shell
before running the sandbox. See
[Credentials](../security/credentials.md) for details on both methods.

**OAuth**: If no API key is set, Factory prompts you to authenticate
interactively on first run. The proxy handles the OAuth flow, so credentials
aren't stored inside the sandbox.

## Configuration

Sandboxes don't pick up user-level configuration from your host. Only
project-level configuration in the working directory is available inside the
sandbox. See
[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration)
for workarounds.

The sandbox runs Factory without approval prompts by default. Pass additional
`droid` CLI options after `--`:

```console
$ sbx run factory-ai --name <sandbox-name> -- <droid-options>
```

## Base image

Template: `docker/sandbox-templates:factory-ai-docker`

Preconfigured to run without approval prompts. Authentication state is
persisted across sandbox restarts.

See [Custom environments](custom-environments.md) to pre-install tools or
customize this environment.
1 change: 1 addition & 0 deletions data/sbx_cli/sbx_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ see_also:
- sbx create codex - Create a sandbox for codex
- sbx create copilot - Create a sandbox for copilot
- sbx create docker-agent - Create a sandbox for docker-agent
- sbx create factory-ai - Create a sandbox for factory-ai
- sbx create gemini - Create a sandbox for gemini
- sbx create kiro - Create a sandbox for kiro
- sbx create opencode - Create a sandbox for opencode
Expand Down
53 changes: 53 additions & 0 deletions data/sbx_cli/sbx_create_factory-ai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: sbx create factory-ai
synopsis: Create a sandbox for factory-ai
description: |-
Create a sandbox with access to a host workspace for factory-ai.

The workspace path is required and will be mounted inside the sandbox at the
same path as on the host. Additional workspaces can be provided as extra
arguments. Append ":ro" to mount them read-only.

Use "sbx run SANDBOX" to attach to the agent after creation.
usage: sbx create factory-ai PATH [PATH...] [flags]
options:
- name: help
shorthand: h
default_value: "false"
usage: help for factory-ai
inherited_options:
- name: branch
usage: Create a Git worktree on the given branch
- name: cpus
default_value: "0"
usage: |
Number of CPUs to allocate to the sandbox (0 = auto: N-1 host CPUs, min 1)
- name: debug
shorthand: D
default_value: "false"
usage: Enable debug logging
- name: memory
shorthand: m
usage: |
Memory limit in binary units (e.g., 1024m, 8g). Default: 50% of host memory, max 32 GiB
- name: name
usage: |
Name for the sandbox (default: <agent>-<workdir>, letters, numbers, hyphens, periods, plus signs and minus signs only)
- name: quiet
shorthand: q
default_value: "false"
usage: Suppress verbose output
- name: template
shorthand: t
usage: |
Container image to use for the sandbox (default: agent-specific image)
example: |4-
# Create in the current directory
sbx create factory-ai .

# Create with a specific path
sbx create factory-ai /path/to/project

# Create with additional read-only workspaces
sbx create factory-ai . /path/to/docs:ro
see_also:
- sbx create - Create a sandbox for an agent
2 changes: 1 addition & 1 deletion data/sbx_cli/sbx_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |-

To create a sandbox without attaching, use "sbx create" instead.

Available agents: claude, codex, copilot, docker-agent, gemini, kiro, opencode, shell
Available agents: claude, codex, copilot, docker-agent, factory-ai, gemini, kiro, opencode, shell
usage: sbx run [flags] SANDBOX | AGENT [PATH...] [-- AGENT_ARGS...]
options:
- name: branch
Expand Down
2 changes: 1 addition & 1 deletion data/sbx_cli/sbx_secret_set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ synopsis: Create or update a secret
description: |-
Create or update a secret for a service.

Available services: anthropic, aws, github, google, groq, mistral, nebius, openai, xai
Available services: anthropic, aws, factory, github, google, groq, mistral, nebius, openai, xai

When no arguments are provided, an interactive prompt guides you through
scope and service selection.
Expand Down