sandbox
Reviewed
at commit 9a763c8
Refuse a sandbox bypass whose commands already escape through sandbox.excludedCommands, naming the form that escapes without the flag
0 upvotes
Log in to upvote or save- Made by
- Ben Drucker
- Pinned commit
-
9a763c857f6d9473cdcb45b1dba647f0b91bd515 - What we checked
-
When Claude runs a Bash command with the sandbox switched off, checks whether every command in it is already on your sandbox.excludedCommands list. If so, the call still runs, and a note tells Claude which form (without cd, export, 2>&1 or a trailing tail/grep) would have escaped the sandbox without the flag. It reads only your sandbox settings and session directory and sends nothing out.
Review details
Static review of the source at the pinned commit; not run. Hooks: session.start (emits a mod event) and tool.call for Bash. The tool.call handler returns immediately unless dangerouslyDisableSandbox is true and sandbox.enabled is true with a non-empty excludedCommands list, read with $.settings.read for the user, project, local, flag and policy sources (read only). It then parses the command with a small shell parser (scaffold.ts; anything with expansion, subshells, other redirects or background jobs is let through unjudged), calls $.session.cwd, always runs the call via next(e), and appends a context note to the result when the command would escape on its own; it never denies or rewrites the call, despite the plugin description saying refuse. Emits events through $.modEvents (declared dependency mod-events). Failures are caught and the call proceeds unchanged. No network, no files written, no programs run. No npm dependencies. The pre-scan hits for process were regex .exec calls, not process execution.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: yes
- Blocks or changes tool calls: no
- Reads or writes files: no
- Runs programs on your machine: no
- Calls the model (uses tokens): no
- Sends data over the network: no
- Stores data: no
- Shows something on screen: no
- Hooked events
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/sandbox/)