Skip to content
docs

Permissions

The permission mode decides which actions the agent takes right away and which it asks you to approve. Read and search tools (Read, Grep, Glob, WebSearch, WebFetch) and read-only commands (ls, cat, grep, git status, kill -0 <pid> to check whether a process is alive) need no approval. File access restrictions and dangerous commands are checked separately.

In the default and acceptEdits modes, commands that write need approval unless an allow rule permits them. Even redirecting output to a file counts as writing, and so does the file script records a session to. Printing a secret token and running a program through find -exec also need approval.

Bash runs shell commands, and REPL runs code in a persistent Python, Node, or bash session. The protected paths and high-risk commands mentioned in the table are described right below it.

ModeFile editsCommands (Bash, REPL)
defaultasksasks, except read-only ones
acceptEditsdoesn’t ask, except for protected pathsasks, except read-only ones and mkdir, touch, mv, cp inside the project and outside protected paths
trustdoesn’t ask, except for protected pathsdoesn’t ask, except for high-risk commands
bypassPermissionsdoesn’t askdoesn’t ask

Further restrictions:

  • Destructive commands are always rejected. rm -rf / and the directories right under the root (/usr, /etc), the home folder however it is written, including its full path, the working folder and its parents (rm -rf ., .., *), find / -delete, running downloaded code (curl ... | sh, curl ... | python3, eval "$(curl ...)", source <(curl ...)), a fork bomb, and stopping the Waibee Code process itself by its PID or by the waibee name, or the terminal that runs it by its PID (kill, pkill, killall, taskkill, taskkill /T, Stop-Process, also inside powershell -Command and cmd /C): the agent won’t run these in any mode, and no allow list changes that. The agent knows its own PID, and commands get it in the WAIBEE_PID variable.

  • Deleting through a variable asks in every mode. Only the shell knows what rm -rf "$OUT" will delete, so it asks even in bypassPermissions, and neither an allow rule nor a hook can answer for you. Headless mode rejects it. "${OUT:?}" fails if the variable is empty and counts as a regular delete.

  • Writing outside the project and to protected paths asks. Editing or creating a file outside the working folder (temporary folders don’t count), or in a file that later runs code or configures the agent (.git/, .claude/, .waibee/, .mcp.json, .vscode/, .husky/, shell startup files), requires approval in default, acceptEdits, and trust, even if an allow rule permits the edit. The path is checked both as written and by where it leads through symbolic links, and names are compared case-insensitively. The same goes for commands that write there: output redirection, tee, cp, mv, install, ln. In bypassPermissions this goes through without asking.

  • Working folder of commands. cd and environment variables in Bash and REPL persist between calls. In Bash and a bash REPL session, leaving the project returns the working folder to the session folder, with a message in the result; environment variables persist. In Python and Node, the folder is not returned automatically.

  • High-risk commands ask. sudo, curl and wget that send a file or a request body (curl -d @file), ssh-keygen, feeding a file to the shell without downloading (base64 -d | sh), writing to shell startup files, a command whose program name comes from an unknown variable: in default, acceptEdits, and trust these ask, even if the mode promises not to. The same applies to systemd-run, even with a read-only command: the service manager runs it outside the calling process’s sandbox. git -c options that run a program, awk calling system, sed with the e command or flag, and alias definitions ask too. An explicit allow rule skips the question, and it has to cover every part of the line: with the rule Bash(curl:*), the command cat ~/.ssh/id_rsa | curl --data-binary @- … still asks. In bypassPermissions they run without asking.

  • Secrets in bypassPermissions. In this mode the agent can read the project’s secret files, such as .env and keys: the built-in path exclusions for secrets do not apply in it, while the rules in your .waibeeignore do. The agent’s own API key, its settings, and the credentials of other agents (Claude Code, Codex, .mcp.json) stay closed in every mode.

Deleting a specific path (rm -rf /tmp/build) and a regular download with curl or wget are not high-risk: in default and acceptEdits they ask, and in trust they run without asking.

How MCP tools ask depends on their server’s permission level; see MCP.

In the TUI, Shift+Tab cycles through the modes: default → acceptEdits → trust → bypassPermissions. The current mode shows in the status bar and as a glyph in the input line.

The interface marks bypassPermissions as the riskiest mode. The first time a session enters bypassPermissions, a single line explains what it means. Every mode change is written to the audit log along with the surface it was made from.

Your choice of mode takes effect immediately in the current chat, whether in the terminal, the browser, or an IDE, and is remembered in the global settings as permissions.last_picked; bypassPermissions is not remembered. A new session in the terminal, the browser, or an IDE starts with the first of these that is set:

  1. The --mode flag of this launch in the terminal.
  2. permissions.mode from the project settings or the managed file. In an untrusted folder, the project’s mode applies only if it is no broader than permissions.mode from the global settings (default if that is not set).
  3. The remembered choice, permissions.last_picked.
  4. permissions.mode from the global settings.
  5. default.

A mode set in /settings or in the browser settings is written to permissions.mode in the global settings and resets the remembered choice. How waibee run picks a mode is described in Headless. Set the default mode in settings.json (or through /settings):

{
"permissions": {
"mode": "default"
}
}

The valid values are the same in the settings, the --mode flag, IDEs, the browser, and the audit log: "default", "acceptEdits", "trust", "bypassPermissions". The Claude Code spelling "dontAsk" in a settings file is read as trust, and an IDE that sends dontAsk is refused. For how this mode differs in Claude Code, see Claude Code compatibility.

A reopened session keeps the mode it was left in, but no broader than the currently selected mode. An explicit --mode overrides it; for waibee run the cap works differently; see Headless.

A subagent runs in the stricter of two modes: the session’s current mode and the mode from its definition. If you switch the session’s mode while a subagent is working, its next action is checked against the new mode. permissionMode: plan in an agent definition makes the agent read-only: it may only read and run commands that change nothing. permissionMode: dontAsk means the same as in Claude Code: such a subagent asks nothing, and anything that would need approval is rejected with a reason.

Fine-grained rules are regular expressions:

{
"permissions": {
"mode": "default",
"allow": ["^git ", "^cargo "],
"deny": ["rm -rf", "sudo"]
}
}
  • deny blocks matching commands during the permission check. No mode, including bypassPermissions, turns these rules off. The check covers every command the line runs: each part of a compound command, inside $(...), subshells, loops, and if, after sudo, timeout, and variable assignments, and inside sh -c. So neither git status && sudo rm x nor echo $(sudo rm x) slips through.
  • allow automatically approves matching edits and commands where there would otherwise be a question, including high-risk commands. Approval does not apply if the command contains substitutions ($(...)) or other suspicious constructs, or if the shell cannot parse the line. In a compound command, every part that changes something must match; read-only parts such as | tail -5 pass without a rule of their own. For a high-risk command, every part must match.

An allow rule for curl or wget does not cover the file the command sends: for allow to approve it, reading that file has to be allowed separately, and the checks on protected files apply independently.

If the program name comes from a variable set on the same line (S="git show"; $S HEAD), the check runs on the command itself, git show.

A PreToolUse hook’s response does not bypass the rules. An action in deny is forbidden whatever the hook answers. allow only removes the question the mode would ask: writing to a protected path still asks, and a subagent in plan mode changes nothing. See Hooks.

Bash(...) rules are read the same way Claude Code reads them, so rules from .claude/settings.json work without changes:

RuleMatchesDoes not match
Bash(npm run build)only npm run buildnpm run build --watch
Bash(npm run:*), Bash(npm run *)npm run build and npm run itselfnpm install
Bash(ls*)ls -la, lsof
Bash(git * main)git push origin maingit log
Bash(* --version)node --versionnode -v
Bash(*)any commandother tools, such as Read

* means any text and can appear anywhere in a rule. A space and * at the end of a rule also match the command with no arguments, if the rule has no other *. \* in a rule is a literal asterisk. A Bash(...) rule is matched only against the command text, never against the tool name.

An allow rule does not yet strip a leading timeout: timeout 30 npm test under the rule Bash(npm test *) asks for approval. Claude Code rules on parameters of the Bash tool, such as Bash(timeout:*) or Bash(run_in_background:true), have no effect: the check sees only the command.

Claude Code rules for other tools, such as Read(./.env) or WebFetch(domain:example.com), block nothing: paths and domains are not part of the check. Files are closed off by .waibeeignore, and domains by the domain filter.

A tool name with no pattern in permissions.deny removes the tool from the set the model sees when the session starts. mcp__github__* likewise removes every tool of the github server. For example:

{
"permissions": {
"deny": ["WebFetch", "mcp__github__*"]
}
}

--disallowed-tools WebFetch sets the same denial for one run. The exclusions are chosen at startup and passed on to subagents.

Rules with parameters (Bash(git push *)) and regular expressions (^WebFetch$, ^mcp__github__) are checked at call time and do not remove the tool from the model’s list. A regular expression is matched against both the command and the tool name: without anchors, Write|Edit also matches NotebookEdit. An MCP tool name has the form mcp__<server>__<tool>, so ^mcp__github__ blocks calls to every tool of the github server.

Tool names that come from Claude Code or earlier versions of Waibee Code also match calls in permission rules; see Names from earlier versions.

You can also list an MCP tool in disabled_tools in the server’s entry, or turn the server off; see MCP. Calls to such a tool are forbidden immediately, but the tool set is fixed at the session’s first request: a description the model has already received stays with it until a new session. Choosing the built-in tools for one headless run is covered in Tool set.

In the terminal, the question appears right in the conversation, between the conversation and the input field, and the call it is about stays visible above it. A question has four answers, the same in the terminal, the browser, and an IDE over ACP:

  1. Allow once.
  2. Allow for the rest of this session. Covers this command and its subcommand, such as git commit or cargo test, and for edits, the tool itself.
  3. Allow in this project from now on. The same as for the session, but remembered for the current project in .waibee/settings.local.json.
  4. Deny.

Neither the second nor the third answer opens up a risky command such as git push --force, and writing to a protected path still asks. Risky commands get only one-time approval or denial.

Tab on any answer opens a line for an explanation: the agent gets the denial together with your note on what to do instead. A denial applies only to the current call. For a permanent ban, add a deny rule to your settings; see Allow and deny lists.

A prompt or question never takes a key you typed for a message. While the input field has text, the prompt waits behind it, and ↑ or ↓ opens it. Right after it appears, a prompt ignores Enter, digits, and the space bar, and a letter it does not use goes to the input field. The answer keys are listed in Keys.

If a session was waiting for an approval or an answer when it closed, it asks again after you reopen it and continues the turn with your answer. A command that had already started does not run again.

You can block requests to specific domains or allow only selected ones. Filtering is off by default. Turn on “filter domains” in the “security” section of /settings (/security goes straight there) and fill in “allowed domains” or “blocked domains”. The same lists are available in the web interface.

From the terminal, for example, you can block a domain:

Terminal window
waibee config netsec block example.com # add to the blocked list
waibee config netsec allow api.example.com # add to the allowed list
waibee config netsec enable # turn the filter on; disable turns it off
waibee config netsec status # whether the filter is on, and both lists

Give the domain name without https://, a port, or a path. The rules work like this:

  • A blocked domain is closed together with its subdomains. A block takes priority over an allow.
  • A non-empty allow list permits only the listed addresses. example.com means one domain; *.example.com also covers its subdomains.
  • An empty allow list leaves access to every address that is not blocked.

The restrictions are checked when WebFetch loads pages, including redirects, and when the agent connects to the address of an HTTP MCP server. In shell commands, the addresses that can be recognized in the command text are checked. This is not a firewall for the programs that run. Model requests and web search itself are not subject to these lists.

waibee config netsec remove example.com removes a domain from both lists. The settings are saved globally; a project can add its own rules on top. See the order in which settings apply.

A repository can carry hooks, MCP servers, and a plugin, and all of them run commands on your machine. Reading a repository is not the same as agreeing to run it, so in an unfamiliar folder these files wait for your answer first.

What waits for trust:

  • .claude/settings.json and .waibee/settings.json in this folder: their hooks and MCP servers;
  • .mcp.json in this folder;
  • a plugin that lives in the repository (*.claude-plugin/, .claude-plugin/): its hooks and servers;
  • hooks and mcpServers in a subagent file from this folder;
  • a language server the repository brings with it in node_modules/.bin, .venv/bin, or bin: in an untrusted folder, servers come only from $PATH;
  • anything in the folder’s settings that widens permissions or changes where requests go: permissions.allow, permissions.granted, env, netsec.allowed_domains, sandbox.network.allowed_domains, sandbox.network.allow_unix_sockets, network.proxy, api_key, and files.skip_integrity_check.

sandbox.allow_write is a separate case that has nothing to do with trust: this list is read only from your global settings. It never works in a repository’s settings, because the agent edits the project file itself, and a repository could grant itself write access anywhere.

While the folder is untrusted, its settings can only narrow things. deny is always read, a stricter permissions.mode always applies, and settings that have no effect on execution work as usual.

What always works: your own ~/.claude and ~/.waibee, plugins you installed, and the skills, commands, agent prompts, and tools lists from the repository. These are text, and the agent reads them.

The first interactive launch in such a folder asks once and lists what is held back. Answering y writes the path to trusted_folders in the global settings file, and from then on the folder and everything in it is trusted. Any other answer leaves everything off, and the question comes back next time.

From a script or in CI, the same is done with a command:

Terminal window
waibee config trust # the current folder
waibee config trust /path # a specific folder
waibee config trust --list # what is already trusted
waibee config trust --remove # revoke trust

A launch that cannot show the question or read the answer does not ask: stdin is not a terminal (ACP, a script, a pipe), or stderr is redirected. What was skipped is written to stderr. waibee doctor shows such files as untrusted and says what to do.

You can’t add a hook or an MCP server in an untrusted folder: the write is rejected on the spot, and the message names the command to run. That is better than silently writing a file that won’t run anyway.

A working copy that a subagent opens with isolation: worktree is a separate folder: trust in the repository does not carry over to it, and the trusted repository’s hooks don’t run inside it.

Built-in rules exclude secrets from reading and search: for example, .env, private keys, and the .ssh directory. A .waibeeignore file lets you add your own exclusions. The rules and their limits are covered in Excluding paths.

Permissions decide whether a command runs. The sandbox limits what a command can do once it is running. The limits apply to commands and their child processes.

ProfileWritesCommand network
off (default)No sandbox limitsNo sandbox limits
workspace-writeThe project, worktrees in the Waibee data directory, temporary folders, package manager caches, and allow_write, except the protected configuration belowNo sandbox limits
restrictedSame as workspace-writeThrough a proxy to allowed addresses, see below

read-only is not implemented yet: the agent won’t start with it.

/sandbox choose a profile
/sandbox workspace-write turn it on right away

The choice is saved to the global settings.json and applies to commands started from then on. /sandbox does not turn on or save a profile the machine cannot enforce; it names the reason instead. You can set the same by hand:

~/.waibee/settings.json
{
"sandbox": {
"profile": "workspace-write",
"allow_write": ["~/sdk-cache", "/opt/shared-cache"],
"require": false
}
}

allow_write adds directories where writing is allowed: if a build runs into an unfamiliar cache, the denial names the path. A leading ~ means your home folder, and a relative path is resolved from the project folder: "../shared" opens the shared folder next to the project the agent works in. Folders that code later runs from, such as ~/.cargo, ~/.gradle, or ~/.local/bin, are never opened as a whole: for build caches, their subfolders are open, and that is already done by default.

workspace-write uses Seatbelt on macOS and Landlock on Linux (kernel 5.13 or later with Landlock enabled). If the mechanism is unavailable, the agent warns and continues without restricting commands; require: true stops such a launch instead. Windows has no such mechanism; WSL2 has the same requirements as Linux.

With the sandbox on, Write, Edit, and NotebookEdit cannot change the configuration of Waibee Code, Claude Code, and git: settings, hooks, skills, agents, commands, .mcp.json, .git/config, and .git/hooks, even inside an allowed directory. On macOS, with Seatbelt in effect, commands can’t change them either. On Linux, commands can still change these files inside an allowed directory: Landlock cannot forbid writes to part of a directory that is open for writing. Make such changes by hand.

To pin the profile for one launch, use the --sandbox <profile> flag or the WAIBEE_SANDBOX variable; /sandbox then does not change it. Managed settings take precedence. /status and /doctor show the current state; before a launch, you can check it with waibee config check.

~/.waibee/settings.json
{
"sandbox": {
"profile": "restricted",
"network": {
"allowed_domains": ["example.com", "*.example.org"]
}
}
}

sandbox.network.allowed_domains sets the addresses commands can connect to through an HTTP proxy or a CONNECT tunnel. Give the domain without a scheme, port, or path. example.com allows only that domain; *.example.org also allows example.org itself and its subdomains; case does not matter. Every new address, including one reached through a redirect, is checked separately. An address that is not allowed gets HTTP 403 with the reason for the denial. HTTPS goes through CONNECT without TLS decryption.

If an allowed domain resolves to a private or reserved IP address, including the cloud metadata address, the connection to that IP is rejected unless the IP itself is listed in sandbox.network.allowed_domains. A domain pattern does not grant this.

Unix sockets are closed by default. On macOS, sandbox.network.allow_unix_sockets opens only the listed absolute socket paths, without access to the whole directory; ~ and relative paths are not accepted. On Linux, a non-empty list prevents restricted from starting: seccomp cannot filter Unix sockets by path. SSH_AUTH_SOCK is removed from a child command’s environment unless its socket path is in the list.

This list is required for command network access regardless of netsec.enabled. The rules for an empty list and for merging layers are described in Configuration files. The netsec filter works separately and does not add its allowances here.

SystemWhat enforces the restriction
macOS 11 or laterSeatbelt allows outgoing TCP only to the local proxy; other direct TCP connections, UDP, and raw sockets are closed, and binding a network socket is forbidden
Linux on x86_64 and aarch64Landlock ABI V4 (usually kernel 6.7 or later), seccomp, and separate user and network namespaces leave the command access to the proxy only. Direct connections, UDP, raw sockets, and binding a network socket are closed

Removing or replacing HTTP_PROXY, HTTPS_PROXY, and other proxy variables does not lift the kernel restrictions. The commands’ child processes inherit them.

restricted always stops the launch with exit code 2 if the restriction cannot be enforced, even with sandbox.require: false. On macOS, a working Seatbelt is required: a missing sandbox-exec or a failure to apply the policy, including inside a Seatbelt that is already in effect, prevents the launch. On Linux, Landlock with TCP rules, seccomp, and creating and entering both namespaces (unshare and setns) must all work. An old kernel, a disabled mechanism, an unsupported architecture, or a restriction imposed by a container stops the launch and names the reason. On Windows, this profile does not start. The agent starts the proxy for commands itself at launch; if the proxy fails to start, the launch stops too.

The sandbox restricts Bash and REPL commands, background commands, and hook commands. With a profile on, edits through Write, Edit, and NotebookEdit are checked separately against the allowed directories.

The sandbox does not restrict reading files: on its own, it does not close off .env or your home folder. Read tools follow the path exclusion rules.

With the sandbox in effect, Bash in an IDE runs locally in the same sandbox; without an active restriction, it may use the editor’s terminal. The agent’s own network traffic, model requests, tools inside the agent’s process, MCP servers, and language servers are outside the restricted network restriction. Opening files in an external program and worktree operations also run outside the sandbox. The full list of these exceptions is in waibee config check.

An allowed address can accept any data or forward it further. CONNECT does not restrict ports and does not inspect the tunnel’s contents or the server name inside TLS (SNI). Explicitly allowed Unix sockets and macOS system communication channels can give access to a local service that has its own network access. Connections that are already open or passed in are also outside this guarantee. The profile restricts new network connections from commands, not every way data can leave the machine. To run untrusted code, use a separate environment.

A new waibee run takes its mode from permissions.mode in settings.json, or trust if that is not set. With --resume and --continue, the mode the session was left in is restored, but no broader than this cap. An explicit --mode (--permission-mode) or --dangerously-skip-permissions (--yolo, which is bypassPermissions) flag overrides the mode. The mode remembered from the terminal, the browser, or an IDE does not set the cap for headless. The run names its mode at the start; see Permissions in headless mode.

If an action needs approval, headless rejects it: there is no interactive prompt and no waiting for an answer, and that includes the folder trust question. The agent gets the denial and work continues, and in JSON output the denials are listed in permission_denials. So an edit outside the project or in a protected path does not run in headless in any mode except bypassPermissions; the sandbox limits apply there too. If the call would pass in a broader mode no higher than trust, the denial names that mode; bypassPermissions is never suggested. Allow the commands you need with specific allow rules or with the --allowed-tools flag for one run, or repeat the task interactively. A CI step timeout limits the total time the agent works.

deny lists and the rejection of destructive commands apply here too. More on running from scripts: Headless mode.