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

# The shell and what it can reach

> When your organization allows it, agents can run commands on your Mac or Linux computer. You allow commands per chat, and every command runs in a sandbox that writes only to your read-and-write trusted folders and cannot read your keys, keychain or the rest of your home folder.

When your organization's [Desktop policy](https://docs.xpander.ai/desktop/admin.md#desktop-policy) allows the **Shell**, agents in app conversations can run commands on your Mac or Linux computer, for example tests or a build in a trusted project. The computer strip shows **Shell on**.

## Allow commands and file changes for a chat

The first command in a conversation asks **Run a command?** with the full command. The first file write asks **Write a file?** with the path. Moving an item to the Trash and running a script ask the same way.

| Choice | What it means |
| - | - |
| **Not now** | The agent continues without it. |
| **Allow for now** | Only this command or this file. |
| **Always in this chat** | Commands, or file writes, in this conversation without asking again. |
| **Always allow** | Commands, or file writes, in every conversation without asking again, also after the app restarts. |

![Run a command? dialog showing npm test -- --watch=false, with Not now, Always allow, Always in this chat and Allow for now](https://mintcdn.com/xpanderai-099931d1/PYMvUfGV1C-UG1K5/images/desktop/shell-run-command.png?fit=max\&auto=format\&n=PYMvUfGV1C-UG1K5\&q=85\&s=a23adcf9a7a43a6d24142f735d37490c)

The first command in a conversation asks first. Shown with sample data.

Stopping a conversation, or a policy change, makes every conversation ask again, except for what you chose **Always allow** for. **Always allow** is kept for your account on this computer only, and a policy that turns the ability off still wins. Settings > **Shell & files** lists each one, for example **Run commands: always allowed**, with **Ask each time** to take it back. Signing out, **Forget this Mac** or a new xpander address clears them all. **Always allow** is in Omni Desktop 0.1.0-internal.715 and later ([Settings](https://docs.xpander.ai/desktop/settings.md) > **About** shows yours). An earlier build, such as one an Air-Gapped install may still serve, offers the other three choices only.

## What a command can reach

Each command runs in its own sandbox, which xpander builds from your trusted folders for that one command. The sandbox uses the operating system's own isolation, so the shell needs no Docker and no virtual machine:

| System | Sandbox |
| - | - |
| macOS | The macOS sandbox (`sandbox-exec`), part of macOS |
| Linux | [bubblewrap](https://github.com/containers/bubblewrap) (`bwrap`). The `.deb` package lists bubblewrap as recommended, so apt installs it by default. With the AppImage, or on a system without it, run `sudo apt install bubblewrap` |

In both, a command can reach only this:

| | A command can | A command cannot |
| - | - | - |
| **Your trusted folders** | Read every trusted folder. Write in the folders you trusted **Read and write** | Write in a **Read only** folder |
| **The rest of your home folder** | Nothing | Read or write anything outside your trusted folders |
| **Secrets** | Nothing | Read SSH keys, cloud credentials, the keychain or app data, even inside a trusted folder. On Linux, also the GNOME keyring and the `pass` password store |
| **The system** | Read the system and installed developer software (for example Xcode and Homebrew on a Mac, packages you installed with apt on Linux, and Node, Python and Rust) | Change the system, control other apps, or start background services |
| **Temporary files** | Use its own temporary folder, removed when the command ends | Leave temporary files behind |
| **The network** | Download packages and call web services, when **Shell network** is on | Reach the network when **Shell network** is off |

**Shell network** is on by default. Your organization can turn it off for everyone (**Shell can reach the network** in the [Desktop policy](https://docs.xpander.ai/desktop/admin.md#desktop-policy)), and you can turn it off for this computer in [Settings](https://docs.xpander.ai/desktop/settings.md) > **Shell & files**. Commands then still run, without network access.

## When the shell does not run

* The policy turns the **Shell** off, or you turned **Shell commands** off in Settings.
* **Files** are off for this computer, in the policy or your Settings.
* No folder is trusted yet.
* The policy is read only, so the shell cannot write anywhere.
* The computer cannot run commands safely, for example a Linux computer without bubblewrap (`command -v bwrap` prints nothing). The strip reads **Shell unavailable** and agents work with your files directly. See [Where it runs](https://docs.xpander.ai/desktop.md#where-it-runs).

Each command is recorded with its outcome and duration, never the content of your files.


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