|
| 1 | +--- |
| 2 | +title: Factory |
| 3 | +weight: 35 |
| 4 | +description: | |
| 5 | + Use Factory (droid) in Docker Sandboxes with API key or OAuth authentication. |
| 6 | +--- |
| 7 | + |
| 8 | +{{< summary-bar feature_name="Docker Sandboxes sbx" >}} |
| 9 | + |
| 10 | +This guide covers authentication, configuration, and usage of Factory in a |
| 11 | +sandboxed environment. Factory runs using the `droid` CLI. |
| 12 | + |
| 13 | +Official documentation: [Factory](https://docs.factory.ai/) |
| 14 | + |
| 15 | +## Quick start |
| 16 | + |
| 17 | +Create a sandbox and run Factory for a project directory: |
| 18 | + |
| 19 | +```console |
| 20 | +$ sbx run factory-ai ~/my-project |
| 21 | +``` |
| 22 | + |
| 23 | +The workspace parameter is optional and defaults to the current directory: |
| 24 | + |
| 25 | +```console |
| 26 | +$ cd ~/my-project |
| 27 | +$ sbx run factory-ai |
| 28 | +``` |
| 29 | + |
| 30 | +## Authentication |
| 31 | + |
| 32 | +Factory supports two authentication methods: an API key or OAuth. |
| 33 | + |
| 34 | +**API key**: Store your Factory API key using |
| 35 | +[stored secrets](../security/credentials.md#stored-secrets): |
| 36 | + |
| 37 | +```console |
| 38 | +$ sbx secret set -g factory |
| 39 | +``` |
| 40 | + |
| 41 | +Alternatively, export the `FACTORY_API_KEY` environment variable in your shell |
| 42 | +before running the sandbox. See |
| 43 | +[Credentials](../security/credentials.md) for details on both methods. |
| 44 | + |
| 45 | +**OAuth**: If no API key is set, Factory prompts you to authenticate |
| 46 | +interactively on first run. The proxy handles the OAuth flow, so credentials |
| 47 | +aren't stored inside the sandbox. |
| 48 | + |
| 49 | +## Configuration |
| 50 | + |
| 51 | +Sandboxes don't pick up user-level configuration from your host. Only |
| 52 | +project-level configuration in the working directory is available inside the |
| 53 | +sandbox. See |
| 54 | +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) |
| 55 | +for workarounds. |
| 56 | + |
| 57 | +The sandbox runs Factory without approval prompts by default. Pass additional |
| 58 | +`droid` CLI options after `--`: |
| 59 | + |
| 60 | +```console |
| 61 | +$ sbx run factory-ai --name <sandbox-name> -- <droid-options> |
| 62 | +``` |
| 63 | + |
| 64 | +## Base image |
| 65 | + |
| 66 | +Template: `docker/sandbox-templates:factory-ai-docker` |
| 67 | + |
| 68 | +Preconfigured to run without approval prompts. Authentication state is |
| 69 | +persisted across sandbox restarts. |
| 70 | + |
| 71 | +See [Custom environments](custom-environments.md) to pre-install tools or |
| 72 | +customize this environment. |
0 commit comments