This comparison is based on Anthropic’s sandboxing and permissions docs as of December 2026.
What Claude Code’s sandbox does
Claude Code ships with an OS-level sandbox for shell commands, using Seatbelt on macOS and bubblewrap on Linux and WSL2. It’s off by default; you turn it on with /sandbox or in your settings.
When it’s on, writes are limited to the working directory and folders you add, shell network traffic goes through a local proxy with a host allow list, and credentials in environment variables can be removed, or experimentally masked, for sandboxed commands. Permission rules such as Read(./.env) and mcp__server__tool control Claude Code’s own tools.
It’s a real improvement over running with nothing. But it’s built to contain commands, and the docs are clear about what it leaves to you:
- File tools, MCP servers and hooks run outside the sandbox.
- Claude can step outside it. A command that fails in the sandbox can be retried unsandboxed unless you set
allowUnsandboxedCommandsto false. - Network rules are per host. Once
api.stripe.comis allowed, every method and path is: a key allowed to look up customers can also issue refunds. - MCP tools are on or off by name, and the servers run with your full access.
- Nothing checks what the agent ships, like a hard-coded key in its commits.
What Stashbase adds
You write an agent profile once, and every run is held to it. Swap claude for codex and the same profile applies:
stashbase agent run --profile local -- claude
Credentials the agent never sees
The agent holds a placeholder. The Stashbase Agent Proxy adds the real credential only when a request matches a rule on host, method, path and values in the JSON body:
[[secrets.STRIPE_API_KEY.rules]]
effect = "allow"
hosts = ["api.stripe.com"]
methods = ["GET"]
paths = ["/v1/customers/*"]
GET /v1/customers/cus_123 goes through with the real key. POST /v1/refunds is blocked, and the placeholder is useless anywhere else.
MCP rules down to the arguments
For HTTP and stdio MCP servers, the agent sees only the tools you allow, and a tool can be allowed only with specific arguments:
[[mcp_servers.linear.tool_rules]]
effect = "allow"
tools = ["save_issue"]
arguments = { team = ["Engineering"], id = { absent = true } }
allow_fields = ["title", "description", "priority"]
The agent can create Linear issues in the Engineering team with a title, description and priority. It can’t edit existing issues, post to other teams or set any other field.
Every agent commit scanned for secrets
With allow_hooks = ["secret_scan"] in the profile, every commit the agent makes is scanned with AI-based secret detection and blocked if it contains a key. Package installs through npm, Bun, pnpm and Yarn can be checked for vulnerable packages the same way.
Run it anywhere, keys off the machine
The same profile runs on your laptop, your own server over SSH, or a VM for agents: a managed machine with Claude Code and Codex preinstalled that keeps working after you disconnect. With the remote proxy, real keys are added on Stashbase servers and never reach the machine the agent runs on.
Enforced on every run
Every run is sandboxed, natively or in Docker. The agent can’t go around the proxy, can’t read files the profile denies, and can’t switch the sandbox off. If no sandbox is available, Stashbase refuses to start. Metadata-only audit logs record every allowed and blocked request.
For everything else, including per-secret history, personal credentials and repository scans, see how Stashbase works or read why coding agents need access control.