GLOSSARY

Agent sandbox

An agent sandbox is an OS-enforced boundary on which files and networks a coding agent can reach. Definition, example, Claude Code and Codex.

Short answer

An agent sandbox is a boundary enforced by the operating system that limits which files a coding agent's commands can write and which network hosts they can reach. On macOS, both Claude Code and Codex use Apple's Seatbelt framework; on Linux, they use bubblewrap. A sandbox contains mistakes regardless of what the model decided to run, which is why it can safely reduce permission prompts.

An agent sandbox is an operating-system-enforced boundary around the commands a coding agent runs, restricting which files they can read or write and which network hosts they can contact. Unlike a permission rule, which judges the command text, a sandbox constrains the running process, so it holds even if the model was tricked into running something unexpected.

How do Claude Code and Codex sandbox commands?

Claude Code has a Bash sandbox, off by default, that you turn on with /sandbox or sandbox.enabled in settings. By default sandboxed commands can write to the working directory and a temp directory, and network traffic goes through a local proxy that only allows domains you list (the list starts empty). On macOS it uses the built-in Seatbelt framework; on Linux and WSL2 it uses bubblewrap. It covers shell commands only: Claude's file tools, MCP servers and hooks run outside it.

Codex always runs with a sandbox mode: read-only, workspace-write or danger-full-access. In workspace-write, writes are limited to the workspace and network access is off unless you enable it. On macOS, Codex runs commands through sandbox-exec with a Seatbelt profile; on Linux it uses bwrap with seccomp.

Example

Turning on Claude Code's sandbox for every project, with no fallback to unsandboxed retries:

{
  "sandbox": {
    "enabled": true,
    "allowUnsandboxedCommands": false
  }
}

Starting Codex with a writable workspace and approvals on request (the Auto preset):

codex --sandbox workspace-write --ask-for-approval on-request

If the agent now runs curl to an unknown host or tries to write to ~/.ssh, the operating system blocks it, whatever the command looked like.

Sandbox vs permission prompts

The two work best together. In Claude Code's auto-allow mode, commands that run inside the sandbox are approved without a prompt, while commands that need to leave it still ask. That leaves fewer, more meaningful permission prompts. Allowbar, a Mac menu bar app, handles the prompts that remain; it does not replace or weaken the sandbox.

Why it matters

Sandboxes are the reason "skip all prompts" modes are only recommended in isolated environments. Claude Code's bypassPermissions mode and Codex's --dangerously-bypass-approvals-and-sandbox remove the guard rails, so the isolation has to come from a container or VM instead. See Allowbar vs skip permissions.

Sources

Frequently asked questions

Is Claude Code sandboxed by default?

No. Claude Code's Bash sandbox is off by default. Turn it on with /sandbox in a session or sandbox.enabled in ~/.claude/settings.json.

Does Codex have network access by default?

No. According to the Codex docs, the agent runs with network access off by default, and in workspace-write it stays off unless you set sandbox_workspace_write.network_access = true.

Does a sandbox protect against prompt injection?

It limits the damage. A sandbox cannot stop the model from following injected instructions, but it can stop the resulting command from reaching files or hosts outside the allowed set.

ALLOWBAR FOR MAC

Answer your agents from the menu bar.

Permission requests from Claude Code and Codex slide down from the top of your screen. Allow, Block or send back to the terminal. Allowbar never approves anything on its own.

Launch price $9.99 instead of $29.90, one-time purchase, lifetime license.