Sandbox
bash commands run in the operating system's sandbox: Seatbelt (sandbox-exec) on macOS, and bubblewrap (bwrap) on Linux when installed.
On Windows, install Bash (for example, Git Bash) to use the bash tool. Larik has no Windows sandbox, so shell commands ask for approval.
Larik checks at startup that the sandbox actually starts. If it can't, Larik runs without it, so commands ask for approval, and says why and how to fix it at startup and in /sandbox. This happens most often inside a Docker container: bubblewrap there needs --security-opt seccomp=unconfined --security-opt systempaths=unconfined. Alternatively, turn the sandbox off and let the container be the boundary. See Running Larik in a container for the trade-off.
Use /sandbox-config or Bash sandbox in /config to manage the enabled/default state, full network access, extra writable paths, and allowed domains. Changes that widen access are highlighted; save them for all projects or only the current project's private settings. /sandbox continues to show the active sandbox status.
Inside the sandbox, a command:
- Can read everything.
- Can write only to the project (the git root), its own private temp directory, and common build caches (Go, npm, Cargo,
~/.cache, on macOS also~/Library/Cachesand the per-user temp root). The literal/tmp, shared by every program on the machine, is never writable. - Can't write to
.git/hooks,.git/config, the other git files that point git at a config or hooks elsewhere (commondir,config.worktree,info/,modules/,worktrees/),.larik/,.claude/or.mcp.json, even inside the project, and can't move or replace.gititself, because any of these would let a later command or hook escape the sandbox. Commits still work. - Can't see credentials. Provider keys in the environment (every built-in provider's key variable, each provider's
api_key_env, and any variable ending in_API_KEY,_AUTH_TOKENor_ACCESS_TOKEN) are removed from the command's environment, and Larik's own sign-in files (chatgpt-auth.json,mcp-auth/) are unreadable. A command that needs one can be run unsandboxed, which asks first, or the variable can be listed undersandbox.env_passthroughin a personal file. - Has no network access except localhost, so tests that start local servers still work, unless you allow some domains (below).
- Can't reach other apps on macOS: LaunchServices and Apple Events are blocked, so
openandosascriptcan't be used to escape.
How it changes permissions:
- In
defaultandaccept-editsmode, sandboxed commands run without asking. - If a command needs more (installing packages, network access, writing elsewhere), the model re-runs it with
"sandbox": false. That asks you first, and the prompt says it runs outside the sandbox. - Deny rules still apply, and plan mode still blocks
bash. - Without a sandbox (for example on Linux without
bwrap), every command asks as before, and Larik says so at startup.
{ "sandbox": { "network": true, "writable": ["~/datasets"] } } // personal config only
{ "sandbox": { "enabled": false } } // turn it off
{ "sandbox": { "env_passthrough": ["GITHUB_TOKEN"] } } // let commands see this variable (personal config only)
Allowing only some domains. Between no network and all of it, list the domains sandboxed commands may reach:
{ "sandbox": { "allowed_domains": ["golang.org", "npmjs.org", "pypi.org", "files.pythonhosted.org", "github.com"] } }
- Each entry allows that domain and its subdomains (
golang.orgcoversproxy.golang.org); an IP address must be listed as is. - Larik runs a small proxy on localhost and sets
HTTP_PROXY,HTTPS_PROXYandALL_PROXY(andNODE_USE_ENV_PROXY=1) for sandboxed commands.go,gitover https,curl,npm,pipandcargouse it. HTTPS is tunneled end to end; the proxy only sees the host name. - Everything else is refused, including direct connections and tools that ignore the proxy variables (
gitover SSH, for example). When the proxy refuses a host, the command's result says which, so the model can ask you to add it or re-run the command outside the sandbox. - The proxy still refuses link-local and cloud-metadata addresses, whatever an allowed name resolves to.
- It applies only while
networkis off. On Linux a helper (larik __sandbox-bridge) carries the connection into bubblewrap's network namespace.
Loosening the sandbox (enabling network, allowing domains, adding writable paths, disabling it) is honored only from personal files: ~/.config/larik/config.json and private project settings under ~/.config/larik/projects/. A shared .larik/settings.json can only switch the sandbox on. /sandbox shows the current settings.