> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a demo in a sandbox

> Create a disposable F[no] install with its own logins, wipe its state between runs, and leave your live fleet untouched.

> After this page, you can create a named sandbox and sign in once inside it. You can run a demo fleet there, wipe the state between runs, and delete the sandbox.

A sandbox is a named, disposable F\[no] install. Its root sits at `~/.fno/state/sandboxes/<name>/`, one folder per sandbox. It holds its own state root, its own mux directory, and its own Claude Code and Codex homes. You enter it with one command. You wipe it between demo runs. You delete it after the demo. Use it when you demo F\[no] or test a fresh install. The demo never sees your live fleet. Your live fleet never sees the demo.

Two neighbours do different jobs. [Sandbox a worker](/docs/guides/sandbox-a-worker.md) puts headless workers in a devcontainer. [Switch accounts](/docs/guides/switch-accounts.md) keeps a second login you use every day. A sandbox is for runs you throw away.

> **Warning:** A sandbox separates state, not power. The macOS Keychain container, the process table, TCP ports and the temp-folder daemon dirs stay shared with your machine. Do not run code you do not trust in a sandbox.

## Before you start

* Install F\[no] through the [quickstart](/docs/quickstart.md). It puts the `fno` CLI on your PATH.
* Run on a Mac. Create needs a Keychain folder at `$HOME/Library/Keychains`, and it refuses without one.
* Keep the harnesses you plan to demo on your PATH, such as `claude` and `codex`. A sandbox works for plain `fno` commands without them.

## Create a sandbox

1. Pick a name. The name takes lowercase letters, digits and dashes, at most 32 characters. This page uses `demo`.

2. Create it in your terminal:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno config project sandbox create demo
```

In an interactive terminal, create also starts each missing harness login inside the sandbox: `claude auth login` first, then `codex login`. Sign in once. The logins stay in the sandbox and survive resets. A run inside a script or a pipe skips the logins and prints the block right away:

![create output: the created line, the root path, the env command hint and the keychain item name](https://mintcdn.com/fno/G4UO39iV_rCAf-K6/images/sandbox-create.png?fit=max\&auto=format\&n=G4UO39iV_rCAf-K6\&q=85\&s=acc7e10e9177711ae03dbad3b52deacd)

> **Note:** The shots on this page ran with HOME pointed at a scratch folder, so their paths read `/private/tmp/...`. On your machine the root reads `~/.fno/state/sandboxes/demo`. The placement follows your HOME. A scratch HOME needs its own `Library/Keychains` folder inside it, or create refuses.

3. Check that the sandbox exists:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno config project sandbox list
```

The list shows one row per sandbox with its login flags, its live process count and its root:

![list output: one row for the demo sandbox showing its login flags, live count and root path](https://mintcdn.com/fno/G4UO39iV_rCAf-K6/images/sandbox-list.png?fit=max\&auto=format\&n=G4UO39iV_rCAf-K6\&q=85\&s=86b7f2c4999901f581eedc09a7edfcf0)

## Enter the sandbox

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno config project sandbox shell demo
```

The command replaces the `fno` process with a login shell inside the sandbox. Your directory does not change. Check where you are:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
echo $FNO_SANDBOX
```

It prints `demo`. Your backlog, claims, mail and sessions stay on the live side. `fno agents session list` prints an empty list here. Run `fno` and the mux opens on the sandbox's own mux dir. Type `exit` to return to your own shell.

## Wipe state between runs

Reset the sandbox between demo runs instead of reinstalling F\[no]:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno config project sandbox reset demo
```

Reset prints `sandbox demo: reset (harness homes untouched)`. It deletes the fno world under the root: the state root, the agents home and the claims. It stops the sandbox's claude supervisor and mux server first. Both harness homes stay, so both logins stay.

Some processes carry the sandbox root in their command line. If one of those still runs, reset refuses and names the process ids:

```text theme={"theme":{"light":"min-light","dark":"min-dark"}}
refusing: live sandbox process(es) 6126 6155 - stop them first
```

Exit the sandbox shell and stop the demo's agents, then run reset again.

## Check on a sandbox

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno config project sandbox status demo
```

Status takes a few seconds. It reads the login state per harness, the claude daemon dir, the mux sockets and the live processes:

![status output: the root, the per harness logins, the claude daemon dir with its live count, mux sockets and live processes](https://mintcdn.com/fno/G4UO39iV_rCAf-K6/images/sandbox-status.png?fit=max\&auto=format\&n=G4UO39iV_rCAf-K6\&q=85\&s=ea76fddab481da1ea65cbad7b0fa4ea2)

`claude` and `codex` show the login state inside the sandbox. A fresh sandbox reads `logged_out` for claude and `unknown` for codex. `codex` reads `unknown` when the probe cannot read its login state. The `claude daemon dir` line names a folder in the shared temp area, named for the sandbox's config dir. `live processes` counts the processes whose command line carries the sandbox root.

`status`, `list` and `env` also print JSON with `--json`.

## Delete the sandbox

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno config project sandbox rm demo
```

rm stops the sandbox's claude supervisor and mux server. It deletes the keychain item and the root. Your live fleet and your own logins stay untouched.

## How it works

One environment table drives `shell`, `env` and `status`, so a shell and its printed environment can never disagree. On entry the table points HOME at the sandbox home. It moves the state keys into the root: `FNO_CONFIG`, `FNO_MUX_DIR`, `FNO_AGENTS_HOME`, `FNO_CLAIMS_ROOT`, `FNO_SPACES_DIR`, plus `CLAUDE_CONFIG_DIR` and `CODEX_HOME`. Run `fno config project sandbox env demo` to print the table as export and unset lines.

The table strips what could stamp your session or identity into the demo. It unsets the session identity keys and every inherited `ANTHROPIC_*` key. The sweep is not defensive. It comes from measurements. An inherited auth token reads as logged in inside a scratch config dir. An inherited base URL sends the demo's traffic to your router. Your tools keep their roots. The table carries `GIT_CONFIG_GLOBAL`, `GH_CONFIG_DIR`, `CARGO_HOME` and `RUSTUP_HOME` when your HOME has the matching file or folder: `~/.gitconfig`, `~/.config/gh`, `~/.cargo` and `~/.rustup`. Git, gh, cargo and ssh answer as they do outside. The harness homes live at `<root>/home/.claude` and `<root>/home/.codex`.

Two links at create make the logins work. macOS resolves the default keychain through `$HOME/Library/Keychains`, so create links that folder into the sandbox home. Without the link, no login is reachable. Create links `~/.ssh` the same way when it exists. The claude login lands in a keychain item named for the sandbox config dir, such as `Claude Code-credentials-f07107d8` in the shots. The name is a hash of the config dir path, so a moved root reads logged out. Codex keeps its login in a file inside its sandbox home.

## Limitations

### Create needs macOS

Create refuses when the current HOME has no `~/Library/Keychains` folder. Sandboxes run on macOS only.

### The keychain container stays shared

A process in the sandbox can read keychain items by name, the way any process on your machine can. The sandbox login adds one item of its own. It hides nothing else.

### A claude session does not survive a reboot

The claude supervisor starts on demand and does not survive a reboot. Its sessions stop about a minute after the supervisor exits.

## Refusals and fixes

| What you see | What it means | What to do |
| - | - | - |
| `refusing: '<name>' is not a sandbox name (lowercase letters, digits and dashes, at most 32 chars)` | The name holds an uppercase letter, a dot or an underscore, or runs past 32 characters. | Pick a name that fits. |
| `refusing: <path> already holds a sandbox. rm it first or pick another name.` | A sandbox lives at that name. | Run `rm` on it, or pick another name. |
| `fno config project sandbox: no stored sandbox at <path> (create it first)` | No sandbox lives at that name. | Run `create` first. |
| `refusing: live sandbox process(es) <pids> - stop them first` | A process whose command line carries the sandbox root still runs. | Exit the sandbox shell, stop the demo's agents, and run the command again. |
| `refusing: <path>/Library/Keychains is missing. The sandbox login needs the real keychain dir.` | The current HOME has no Keychain folder. | Run create on a Mac with your normal HOME. If HOME points elsewhere, give that home a `Library/Keychains` folder. |
| `fno config project sandbox: unknown flag <flag>` | The command takes a name and, where offered, `--json`. | Drop the flag. |

## Next steps

* [Run a fleet](/docs/guides/run-a-fleet.md): spawn and watch workers in the demo fleet.
* [Sandbox a worker](/docs/guides/sandbox-a-worker.md): put headless workers in a devcontainer instead.
* [Switch accounts](/docs/guides/switch-accounts.md): keep a second login for daily use instead of a disposable one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.