All Documentation

Everywhere else

Documentation Settings: This Mac

Sandbox settings, part by part

Every switch on the Sandbox card, the network list, the Swift and Xcode exception, and what a team can lock.

The Sandbox card sits in Settings → Workspace → Privacy & Security. The master switch is in the card's heading and the parts sit under it. Nothing here syncs: it describes this Mac.

Sandbox

The master switch. On, every command a seat runs and every CLI seat process is held to the project by the kernel.

Where to find it. Mac only: Settings → Workspace → Privacy & Security → Sandbox. Default: on. Switching it off asks you to confirm.

When not to use it. Off, commands run with everything your account can reach. If one build tool needs one folder, grant that folder from its card instead.

What changes. Off: the parts disappear and In force now says nothing holds the run.

Settings → Workspace → Privacy & Security → Sandbox, with every part shown
Settings → Workspace → Privacy & Security → Sandbox, with every part shown

The parts

SettingDefaultWhat it doesChange it when
Keep writes inside the projectOnCommands write only to the project, temp folders and build caches. Off, anywhere in your home folder, and the home folder is no longer hidden either.Rarely. A single folder grant from the card is narrower.
Hide the rest of your home folderOnCommands cannot read your documents, desktop or other projects.A tool reads a config file in your home folder. Add Another Directory in the composer's + menu is narrower.
Close the networkOnOnly the hosts on the list are reachable; anything else raises a card.A trusted project keeps needing a host; prefer Always allow.
Hold Git's hooks and settingsOn.git/hooks, .git/config and .git itself are read-only to commands, because git runs what they name later, as you. Commits and pushes work; git config and hook installers ask to run outside.A seat's work is setting up the repository itself.
Keep the keychain from commandsOnCommands cannot open the macOS keychain, where other tools keep sign-ins. A CLI that signs in there keeps it. SSH pushes and the run's GitHub token still work; a credential helper or codesign asks to run outside.Your pushes rely on the keychain.
Close it for Codex and Gemini tooOnTheir CLIs reach only the listed hosts. Off, those two keep an open network.An older CLI ignores proxy settings and stops answering.
Hold MCP servers in the sandbox tooOffMCP servers get the same limits as commands, except the network, which stays open.None of your servers reads its own key files (an AWS server reading ~/.aws, say).
Close the network for MCP servers tooOffHeld MCP servers reach only the listed and allowed hosts. Shown while servers are held.You know your servers use proxy settings; one that ignores them stops working.
Remove secret-looking variablesOnVariables whose names contain TOKEN, SECRET, PASSWORD, API_KEY, PRIVATE_KEY, AUTH, CREDENTIAL, ACCESS_KEY or SESSION are taken out before a command runs.A build fails for want of one variable: name it in Variables to keep instead.
Variables to keepEmptyUp to 50 names the rule above would remove, such as NODE_AUTH_TOKEN. Your team's list still wins.A package registry token your build needs.
Your keys stay lockedAlways onThe credential stores listed on the sandbox page stay unreadable.Cannot be switched off.

The network list

Always reachable: the AI providers, the package registries (npm, PyPI, crates, Go, Maven, Gradle, RubyGems, CocoaPods, Homebrew, the main JavaScript CDNs), GitHub, GitLab, Bitbucket, this project's git remotes, and loopback for dev servers. Telemetry hosts are left off on purpose. A private network or cloud metadata address is refused even under a wildcard unless named exactly. Each run's receipt lists the hosts reached and refused.

Codex and Gemini CLI run closed like every other seat. A failed turn from either while the network is closed tells you once a session, with a link to the switch.

On Linux a firewall rule holds the closed network, and needs root once. A Cloud Computer sets it up on every start; on your own machine, run the command the Close the Network row shows. Until then a tool that ignores proxy settings is not stopped, and the row says so.

Swift and Xcode projects

A Swift build starts a sandbox of its own, and sandboxes cannot nest. So a project with Package.swift or an Xcode project at its root asks Run this Swift project outside the sandbox? with Keep the sandbox as the default. The app never decides this for you, since a repository could ship that file only to get out. A yes is listed under What you have allowed and can be taken back.

Any command the sandbox stops because it starts a sandbox of its own (a Swift package, an Xcode project in a subfolder, Bazel) asks you, as Claude Code and Codex do. A seat can also ask to run one command outside the sandbox: you see the exact command and allow it once or always, in every mode except Bypass. It runs with no GitHub token or keys. Ask Before a Command Runs Outside the Sandbox (Approvals & Safety Nets) is on by default; off, your permission mode decides, and you are told. The first one in a session links to it.

Team locks

A team owner or admin can lock any part on from Governance; a locked switch shows a lock, and locking the home folder also locks writes. A team can also require the sandbox, which keeps every part except MCP on and fails closed. An organisation can set the same in a managed policy file you cannot edit.

Further reading. App Sandbox — Apple.

See Also

Not what you were looking for? The help centre answers one question at a time, and the support page says how to reach a person.