Sandbox
The sandbox
Limit what an agent can read, write and reach on the network, pane by pane.
Turn on the sandbox for a pane, and its shell and everything started in it can only reach the folders and network hosts you allow. It uses the sandbox built into macOS. When something is blocked, a banner says what it was, and one click allows it.
Turn it on
- For one pane: choose Sandboxed in the pane's … menu. The sandbox applies from the start of a shell, so the pane's shell restarts. If something is running, Nems asks first.
- For new panes in a workspace: open Workspace Settings… › Sandbox and set Sandbox new panes to On. A group has the same setting, and its workspaces inherit it.
A sandboxed pane shows a Sandboxed badge in its header. Hover it to see what the pane can read, write and reach, and to open Edit Sandbox Settings….
Warning
If the pane's folder is your home folder or above, the badge shows a warning: the sandbox then covers almost everything.
What a sandboxed pane can do
| Setting | Options |
|---|---|
| Can read | Any file (default) or Only files in its folder |
| Can write | Only files in its folder (default) or Any file |
| Network | Open (default), Only allowed hosts, or Off (localhost only) |
With Only allowed hosts, the badge says Allowed hosts. Agent APIs, GitHub and package registries are allowed already; add your own in Allowed hosts, one per line. Changes to hosts apply at once.
With Off, the badge says Offline and only localhost works.
These always work, so agents and tools keep running: temporary folders, the agents' own settings and caches (~/.claude, ~/.codex, ~/.gemini, ~/.cache, ~/.npm and others), shell history and the keychain. Nems' own data is always blocked.
When something is blocked
A banner appears above the pane:
- Sandbox blocked a connection to registry.npmjs.org — click Allow to add the host to the workspace's allowed hosts. It works at once.
- Sandbox blocked access to ~/Code/shared-ui — click Allow Reading or Allow Read & Write to add a rule for that folder to the workspace. Then click Restart Shell to use it.
Rules
Rules give a path its own access. Click Add Rule, enter a path, and choose Read & write, Read only or Blocked.
- Relative paths are inside the pane's folder. Paths starting with
~/or/can be anywhere. *matches within a name,**across folders:**/.envblocks every.envfile.- Patterns win over plain paths, and deeper paths win over shallower ones.
Rules apply to new shells. Choose Restart Shell in the pane's menu to use them right away.
Profiles
Settings › Sandbox keeps sandbox profiles you can share between workspaces, for example "Client work" or "Offline". In a workspace's Sandbox settings, set Settings from to a profile, or click Save as Profile… to make one from the workspace's settings. Edits are saved immediately.
Agents in the sandbox
Agents started in a sandboxed pane are sandboxed too, and so are the helper agents they start. A sandboxed agent can only see the helpers it started.
Something missing or unclear? Tell us