Everything the platform starts on your remote is confined by the operating system to the folder rules you set for that remote: commands, terminals, agent harness sessions (Claude Code, Codex, …) and the remote file tools. Linux enforces the rules with Landlock, and with a private mount view where the machine allows it. macOS enforces them with Seatbelt. The kernel checks every file the program and its child processes open, so a rule holds even when nothing on the command line names the file.
Windows has no OS sandbox in belt. Everything on a Windows remote runs unconfined, as it did before.
Why a second layer
Workspace rules are first applied by the policy engine when a command is dispatched. The engine reads the command line: the paths in its arguments, redirects, cd, and the commands nested in sh -c, find -exec and similar. It cannot see what a program opens on its own:
- a script that reads
~/.ssh/id_ed25519 - a path built at run time (
cat "$DIR/key",$(ls ~/.aws)) - a tool that reads its own config files or credentials
- a symlink created by the command itself
The kernel sees all of these. The OS sandbox enforces the same Workspace rules again, at the point where a file is opened.
| Layer | Where | What it judges | Decisions |
|---|---|---|---|
| Policy engine | inference.sh API, before dispatch | The command line and the paths it names | allow, ask, deny |
| OS sandbox | Your machine, in the kernel | Every file the command and its children open | allow, deny |
What is enforced
Everything the API asks the daemon to start carries the Workspace rules in force for that remote: file_rules on the remote_exec_start, remote_terminal_open and remote_session_open frames. The daemon confines what it starts to them:
| What | How it is confined |
|---|---|
Commands (remote_exec) | The command and everything it starts |
| Terminals | The shell and everything typed into it |
| Agent harness sessions | The harness and every tool it runs. Its own folders (~/.claude, ~/.claude.json, ~/.codex, …) stay writable when folders are listed. A session keeps the rules it opened with; new rules apply to the next session. |
Remote file tools (remote_read, remote_write, remote_edit, remote_glob, remote_grep) | Each operation runs in a confined process of its own, so the file tools reach no more than a command |
The rules:
| Rules on the remote | Reads | Writes |
|---|---|---|
| No Workspace rules | open | open (the command is not sandboxed) |
deny Workspace(…) only | everywhere except denied paths | everywhere except denied paths |
allow Workspace(…) folders listed | everywhere except denied paths | only inside the listed folders, the temporary folders ($TMPDIR, /tmp, /var/tmp) and /dev |
- Denied paths are neither readable nor writable, through any path that leads to them, symlinks included.
- The daemon's own files are always denied to what it runs confined: its machine key (
remote_ed25519) and its saved permissions (remote_permissions.json) in the belt config folder. A program run for the platform can neither read the key nor turn on--execor--agentsfor the next start. Yourbelt loginstays readable, sobeltworks inside commands. - System folders stay readable. Commands need
/usr,/etc,/optand their toolchains. A listing confines writes only. The policy engine still refuses a command that names a path outside the listed folders. - Ask rules are not enforced by the kernel. The kernel cannot ask a person. An
ask Workspace(…)rule is decided by the policy engine at dispatch. - Network is not restricted. Remote rules have no network part, so the sandbox leaves network access alone.
- Layers combine as they do in the policy engine. A team rule that allows a folder its org denies lets the command use it; an enforced org deny stands. The API sends the result of that combination, not individual rules.
Patterns follow the Workspace rule syntax:
| Pattern | Matches |
|---|---|
~/.ssh/**, ~/.ssh | the folder and everything in it, under the daemon's home |
//etc/**, /etc/** | an absolute folder |
**/.env, .env | that name at any depth |
*.pem | any file or folder whose name matches, at any depth |
Platforms
Linux: Landlock and a private mount view
Requires Linux 5.13 or later with Landlock enabled (landlock in the kernel's lsm= list; on by default in recent Ubuntu, Debian, Fedora and Arch kernels). No root and no setuid helper.
- The daemon itself is never restricted. Each program starts as a short-lived belt process that applies the rules and then execs the program. The restriction is inherited by everything the program starts and cannot be removed.
- belt uses the highest Landlock ABI the kernel offers and reports it (
abi 6). - A sandboxed program runs with
no_new_privs:sudoand other setuid programs do not gain privileges inside it.
Landlock grants access to whole folders and has no exceptions. belt handles a denied path inside an allowed folder in one of two ways.
With a private mount view (the default where unprivileged user namespaces are allowed): the program gets a view of the file system of its own, like Claude Code's bubblewrap sandbox. In it, each denied file is covered by an empty file nobody may read, and each denied folder by an empty read-only folder nobody may list. Landlock then grants the allowed folders whole. A denied .env at the project root cannot be read, written, moved or removed, and the root still takes new files (npm install can write its lockfile). The program runs as your user and cannot remove the covers. Landlock also keeps it from reaching another process's view of the files (/proc/<pid>/root). Your own view of the files, and the daemon's, are unchanged.
With Landlock alone (where user namespaces are blocked, as on Ubuntu 24.04 by default): a denied path inside an allowed folder is enforced by granting each of the folder's other entries instead. Consequence: a folder that directly holds a denied path accepts no new files or folders during the command. Its existing files and subfolders stay usable. With deny Workspace(**/.env) and a .env at the project root, echo x > notes.txt at the root fails with Permission denied; echo x > src/notes.txt works. Keep secrets in a subfolder of their own (deny Workspace(~/proj/secrets/**)), or allow user namespaces for belt (see Troubleshooting). The names of a denied folder's entries can still be listed; their contents cannot be read.
Where user namespaces are allowed but the private mount view misbehaves on your host, start the daemon with INFSH_SANDBOX_NO_MOUNT_VIEW set (any non-empty value). belt then uses Landlock alone even though a mount view would normally be available. belt remote start reports without a private mount view (turned off by INFSH_SANDBOX_NO_MOUNT_VIEW) and system_info.sandbox.mount_ns is false. For a service installed with belt remote enable, set the variable in the systemd unit or LaunchAgent environment, then run belt remote enable again so the unit picks it up.
In both cases patterns are resolved when the program starts. Patterns that match at any depth (**/.env, *.pem) are looked up in the working folder and the listed folders, up to 50,000 entries. A matching file created later, or one elsewhere on disk, is not covered on Linux.
macOS: Seatbelt
The daemon runs each program through /usr/bin/sandbox-exec with a profile generated from the rules. The profile allows everything else, so Mach services, toolchains and system calls behave as they do outside the sandbox. Patterns become regular expressions, which cover files created after the command starts and match any letter case (macOS file systems ignore case by default).
sandbox-exec cannot nest: if belt itself runs inside a Seatbelt sandbox, the OS sandbox is unavailable.
Windows
Not supported. Everything runs unconfined. Use a separate Windows account or a VM to bound what a remote can reach.
Turning it on
There is nothing to install. With a supported OS, the daemon confines everything that has Workspace rules:
- Add Workspace rules on the remote's Rules tab, or on your team or org policy. For example
deny Workspace(~/.ssh/**),deny Workspace(~/.aws/**),allow Workspace(~/projects/**). - Start (or restart) the remote:
belt remote start.
belt remote start prints what the machine can enforce:
1sandbox landlock (abi 6) with a private mount view — commands, terminals, agent sessions and file tools are confined to their file rules (--require-sandbox to refuse any that cannot be)Without the mount view the line says why, for example landlock (abi 6) without a private mount view (unprivileged user namespaces are blocked here: …).
belt remote status shows sandbox and require sandbox. The remote's system info in the API (system_info.sandbox) carries mechanism, version, available, reason, required, mount_ns and no_mount_ns.
Best effort, or required
When the sandbox is unavailable (an old kernel, Landlock disabled, a container that blocks the Landlock system calls, a nested Seatbelt), commands run unconfined and the daemon reports why. Only the policy engine applies.
To refuse instead, start the remote with --require-sandbox:
1belt remote start --require-sandboxThe choice is saved like --exec and --agents. Anything with Workspace rules that the machine cannot confine is then refused: a command ends without starting (not run: this remote requires the OS sandbox for what has file rules, and …), a terminal does not open, and an agent session closes with the same reason. On Linux, if applying the rules fails in the child, the program exits 126 with the reason on stderr. Nothing without Workspace rules is affected. belt remote start --require-sandbox=false turns it off.
Inside inference.sh sandboxes
Managed sandboxes run belt remote inside a Firecracker microVM. That VM is the outer sandbox: it protects inference.sh infrastructure and other tenants from whatever runs in the box. The OS sandbox is the inner layer: it enforces your own file rules on the commands an agent runs inside the box. The two answer different questions, and neither replaces the other.
The microVM guest kernel does not include Landlock, so the daemon in a managed sandbox reports unavailable: the kernel has no Landlock … and runs programs under the outer sandbox and the policy engine only. Starting such a remote with --require-sandbox would refuse everything that has Workspace rules.
On your own Linux machine inside Docker, Landlock works when the host kernel supports it: Docker's default seccomp profile allows the Landlock system calls. gVisor and other user-space kernels may not implement Landlock; the daemon then reports it as unavailable.
What is not sandboxed
- Anything on a remote with no Workspace rules. It runs as it did before, unconfined, with
sudoworking. - Rules added during an agent session. The harness keeps the rules it opened with; the policy engine applies new rules to each call at once.
- Windows remotes.
Troubleshooting
| Symptom | Cause |
|---|---|
unavailable: the kernel has no Landlock | Kernel older than 5.13 or built without CONFIG_SECURITY_LANDLOCK. Upgrade the kernel, or accept unconfined runs. |
unavailable: Landlock is built into the kernel but not enabled | Add landlock to the lsm= boot parameter (for example lsm=landlock,lockdown,yama,apparmor,bpf) and reboot. |
unavailable: the Landlock system calls are blocked | A seccomp profile denies them, as some container runtimes do. Use Docker's default profile or allow landlock_create_ruleset, landlock_add_rule and landlock_restrict_self. |
unavailable: sandbox-exec cannot apply a profile here | belt is already running inside a macOS sandbox. Start the remote from a normal Terminal session. |
without a private mount view (unprivileged user namespaces are blocked here: …) | The machine blocks unprivileged user namespaces, so Landlock alone applies. On Ubuntu 23.10 and later, AppArmor blocks them unless a profile allows them for the program. Allow them for belt with a profile such as /etc/apparmor.d/belt containing abi <abi/4.0>, include <tunables/global> profile belt /home/you/.local/bin/belt flags=(unconfined) { userns, } (use belt's real path), then sudo apparmor_parser -r /etc/apparmor.d/belt and restart the remote. Elsewhere, check user.max_user_namespaces and kernel.unprivileged_userns_clone. |
Permission denied creating a file in a project folder | On Linux without a private mount view, the folder directly holds a denied path (see Linux). Write into a subfolder, move the denied file into a folder of its own, or allow user namespaces for belt. |
| An agent harness fails to save its settings or login | Folders are listed and the harness writes outside its own folder. Add that folder with allow Workspace(…). |
Permission denied writing to a cache such as ~/.cache or ~/.npm | Folders are listed, so writes are confined. Add the cache with allow Workspace(~/.cache/**). |
belt: running without the OS sandbox: … on stderr | Applying the rules failed in the child on Linux; the command ran unconfined because --require-sandbox is off. |
| Writes fail only at the project root but work in subfolders; mount view is on | Landlock-only semantics (see Linux): a listed folder that directly holds a denied path accepts no new entries. Prefer subfolders for new files, move secrets into their own folder, allow user namespaces, or set INFSH_SANDBOX_NO_MOUNT_VIEW if the mount view itself is at fault. |
| Need Landlock alone despite user namespaces being allowed | Set INFSH_SANDBOX_NO_MOUNT_VIEW in the environment before belt remote start (or in the service unit after belt remote enable). Restart the daemon so the probe runs again. |