From bf409a714da14fdfddfba85be1b5e6b0d62c7d02 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Fri, 17 Apr 2026 13:55:11 +0200 Subject: [PATCH] sbx: add factory-ai (droid) agent Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/manuals/ai/sandboxes/agents/_index.md | 1 + .../sandboxes/agents/custom-environments.md | 1 + .../manuals/ai/sandboxes/agents/factory.md | 75 +++++++++++++++++++ data/sbx_cli/sbx_create.yaml | 1 + data/sbx_cli/sbx_create_factory-ai.yaml | 53 +++++++++++++ data/sbx_cli/sbx_run.yaml | 2 +- data/sbx_cli/sbx_secret_set.yaml | 2 +- 7 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 content/manuals/ai/sandboxes/agents/factory.md create mode 100644 data/sbx_cli/sbx_create_factory-ai.yaml diff --git a/content/manuals/ai/sandboxes/agents/_index.md b/content/manuals/ai/sandboxes/agents/_index.md index de3428d47c6..900907dc96c 100644 --- a/content/manuals/ai/sandboxes/agents/_index.md +++ b/content/manuals/ai/sandboxes/agents/_index.md @@ -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/) diff --git a/content/manuals/ai/sandboxes/agents/custom-environments.md b/content/manuals/ai/sandboxes/agents/custom-environments.md index a45ae8abe48..a8c50c41443 100644 --- a/content/manuals/ai/sandboxes/agents/custom-environments.md +++ b/content/manuals/ai/sandboxes/agents/custom-environments.md @@ -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) | diff --git a/content/manuals/ai/sandboxes/agents/factory.md b/content/manuals/ai/sandboxes/agents/factory.md new file mode 100644 index 00000000000..c9d917027d4 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/factory.md @@ -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 -- +``` + +## 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. diff --git a/data/sbx_cli/sbx_create.yaml b/data/sbx_cli/sbx_create.yaml index 9c91093c9cf..eed1a79fdde 100644 --- a/data/sbx_cli/sbx_create.yaml +++ b/data/sbx_cli/sbx_create.yaml @@ -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 diff --git a/data/sbx_cli/sbx_create_factory-ai.yaml b/data/sbx_cli/sbx_create_factory-ai.yaml new file mode 100644 index 00000000000..6c02f60120f --- /dev/null +++ b/data/sbx_cli/sbx_create_factory-ai.yaml @@ -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: -, 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 diff --git a/data/sbx_cli/sbx_run.yaml b/data/sbx_cli/sbx_run.yaml index 8c2fbcca724..a820a1e10fd 100644 --- a/data/sbx_cli/sbx_run.yaml +++ b/data/sbx_cli/sbx_run.yaml @@ -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 diff --git a/data/sbx_cli/sbx_secret_set.yaml b/data/sbx_cli/sbx_secret_set.yaml index 2187c72ccbb..b2f250a1b1e 100644 --- a/data/sbx_cli/sbx_secret_set.yaml +++ b/data/sbx_cli/sbx_secret_set.yaml @@ -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.