Bubblewrap (bwrap)
Hacker ApprovedThe most recommended of 10 sandboxing tools
A lightweight, flexible Linux sandbox for confining AI coding agents and untrusted programs to the files they need, though it shares the host kernel and complex setups get fiddly.
A lightweight, flexible Linux sandbox for confining AI coding agents and untrusted programs to the files they need, though it shares the host kernel and complex setups get fiddly.
141 people gave an opinion
- recommend it
- 109
- criticize it
- 32
- approval share
- 77%
Recommended in 12 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 109 people recommend itNeeds 10 or more, met.
- 3.4 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 12 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Sandboxes AI coding agents
“This is a lot less annoying than a container for stuff where I legitimately want to be able to point agents at random stuff”
Comment from 4 Jun 2026 in “The ways we contain Claude across products” “the pattern using bubblewrap in front of Claude can be exactly duplicated and applied to other coding agents”
Comment from 15 Jan 2026 in “Bubblewrap: A nimble way to prevent agents from accessing your .env files” “Typically I just want to isolate the agent disallowing it from accessing other parts of the filesystem.”
Comment from 9 Jul 2026 in “GPT-5.6” - Comment from 27 May 2026 in “Claude Code as a Daily Driver: Claude.md, Skills, Subagents, Plugins, and MCPs”
- Comment from 12 Jul 2026 in “What xAI's Grok Build CLI Actually Sends to xAI”
- Comment from 10 Aug 2026 in “Auto mode is now the default in Claude Code”
- Comment from 5 Oct 2026 in “Linux containers in 500 lines of code (2016)”
- Comment from 15 Oct 2026 in “OpenCode 2.0”
- Comment from 28 Jun 2026 in “A way to exclude sensitive files issue still open for OpenAI Codex”
Fine-grained, flexible filesystem control
“bubblewrap is a lot more flexible: You can freely piece together the sandboxed filesystem environment from existing directories, tmpfs, files or data provided via a file descriptor.”
Comment from 15 Jan 2026 in “Bubblewrap: A nimble way to prevent agents from accessing your .env files” “it's pretty great since you don't have to trust the harness and can quite easily customize the sandbox to your needs”
Comment from 12 Oct 2026 in “Codex CLI installs a persistent, self-updating background daemon by default” “unsharing everything and then adding back everything your agent needs saves the trouble of updating a docker image”
Comment from 13 Jul 2026 in “What xAI's Grok Build CLI Actually Sends to xAI” - Comment from 8 Apr 2026 in “Google Open Sources Experimental Agent Orchestration Testbed Scion”
- Comment from 1 Feb 2026 in “What I learned building an opinionated and minimal coding agent”
- Comment from 31 Mar 2026 in “Axios Compromised on NPM – Malicious Versions Drop Remote Access Trojan”
- Comment from 18 Apr 2026 in “Towards Trust in Emacs”
- Comment from 9 Nov 2025 in “Using bubblewrap to add sandboxing to NetBSD”
Lighter than containers or VMs
“This is a lot less annoying than a container for stuff where I legitimately want to be able to point agents at random stuff”
Comment from 4 Jun 2026 in “The ways we contain Claude across products” “bwrap is much more honest in that regard: it’s just a syscall with no background processes and zero required privileges”
Comment from 4 Feb 2026 in “Sandboxing AI Agents in Linux” “Bubblewrap is a good tech to check out and likely a better tool if you're looking for a simpler option”
Comment from 6 Oct 2026 in “Linux containers in 500 lines of code (2016)” - Comment from 3 Jul 2026 in “Jamesob's guide to running SOTA LLMs locally”
- Comment from 20 Jan 2026 in “Running Claude Code dangerously (safely)”
Isolates untrusted apps like Steam
“Let's me run harnesses and compilers and even headless Firefox in sandboxes without worrying about damage to random parts of my system.”
Comment from 20 Sep 2026 in “Software sandboxing: The basics (2025)” “for GUI apps such as Steam and games where running a separate graphical session isn't practical, you can use bubblewrap.”
Comment from 30 Aug 2026 in “Omarchy: Any User Process Can Escalate to Root” “I do this for things like Steam, games, or other "blackbox" closed source programs that cannot be reasonably trusted.”
Comment from 13 Jul 2026 in “Grok uploaded my user directory to xAI's servers” - Comment from 30 Aug 2026 in “Omarchy: Any User Process Can Escalate to Root”
What people warn about
Each mark is one comment
Shared kernel limits security
“You can use this to be (much) more secure than otherwise, but it's not a security-oriented design”
Comment from 16 Jan 2026 in “Chromium Has Merged JpegXL” “Sandboxes like firejail and bubblewrap share a kernel: attacker is one exploit away from root.”
Comment from 15 Aug 2026 in “Firefox is now the last major browser that still supports uBlock Origin” “I even compiled Bubblewrap too so I can jail some of these, and yet I don't trust them 100%”
Comment from 22 Oct 2026 in “Rust Style Guide” - Comment from 12 May 2026 in “TanStack NPM Packages Compromised”
- Comment from 15 Jan 2026 in “Bubblewrap: A nimble way to prevent agents from accessing your .env files”
- Comment from 1 Apr 2026 in “Show HN: Zerobox – Sandbox any command with file and network restrictions”
Cumbersome for complex setups
“bwrap needs additive mode; take everything (aside some basics like stdin/out/err acces) by default, then add permissions.”
Comment from 6 Oct 2026 in “Linux containers in 500 lines of code (2016)” “whereas with bubblewrap you have to manually bootstrap the availability of each individual dev tool”
Comment from 3 Jul 2026 in “Jamesob's guide to running SOTA LLMs locally” “your Go build fails because you haven't put the local cache dir in the "allowed directories"”
Comment from 10 Aug 2026 in “Docker Sandboxes – Disposable, isolated sandboxes for AI agents” - Comment from 9 Oct 2026 in “MXC - a sandboxed code execution system”
- Comment from 17 Feb 2026 in “Running NanoClaw in a Docker Shell Sandbox”
Linux-only, needs user namespaces
“it either requires root or it requires unprivileged user namespaces and it's not x-plat”
Comment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload” “I like the bubblewrap approach, it just happens to be Linux-only unfortunately.”
Comment from 20 Jan 2026 in “Running Claude Code dangerously (safely)” Problems alongside Docker
“This is what I currently do, but my software uses docker and docker mounts act as a bypass for the file system restrictions”
Comment from 10 Aug 2026 in “Docker Sandboxes – Disposable, isolated sandboxes for AI agents” “neither the bundled bubblewrap nor the Ubuntu 24.04 bubblewrap works properly under Docker with the default options”
Comment from 13 Aug 2026 in “ChatGPT Desktop (Codex Desktop) for Linux”
Other sandboxing tools people recommend
The four most recommended other sandboxing tools, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| Bubblewrap (bwrap)This page | 109 | 32 | 77% | 12 | — | Approved |
| Agent Safehouse | 43 | 2 | 96% | 7 | — | Approved |
| nono | 34 | 3 | 92% | 10 | — | Approved |
| Firejail | 30 | 6 | 83% | 12 | — | Approved |
| sandbox-exec | 25 | 7 | 78% | 11 | — | Approved |
What people said
40 of the 179 comments that mention it, newest first. Each links to the original comment.
“I even compiled Bubblewrap too so I can jail some of these, and yet I don't trust them 100%”
“a couple of extra injected bwrap args to make my SSH keys and LLM API credentials unreadable”
“it's pretty great since you don't have to trust the harness and can quite easily customize the sandbox to your needs”
“it becomes pretty unwieldy when you start trying to do anything moderately complex”
“bwrap needs additive mode; take everything (aside some basics like stdin/out/err acces) by default, then add permissions.”
“Bubblewrap is a good tech to check out and likely a better tool if you're looking for a simpler option”
“What I ended up with was less than 500 lines of code using Claude's suggestion of Bubblewrap”
“Let's me run harnesses and compilers and even headless Firefox in sandboxes without worrying about damage to random parts of my system.”
“an application isolated in this way will have a limited view of the system much less the ability to modify it”
“for GUI apps such as Steam and games where running a separate graphical session isn't practical, you can use bubblewrap.”
“it either requires root or it requires unprivileged user namespaces and it's not x-plat”
“Sandboxes like firejail and bubblewrap share a kernel: attacker is one exploit away from root.”
“neither the bundled bubblewrap nor the Ubuntu 24.04 bubblewrap works properly under Docker with the default options”
“your Go build fails because you haven't put the local cache dir in the "allowed directories"”
“This is what I currently do, but my software uses docker and docker mounts act as a bypass for the file system restrictions”
“I use bubblewrap, which I believe claude code also has internally but not for its Bash() tool.”
“I do this for things like Steam, games, or other "blackbox" closed source programs that cannot be reasonably trusted.”
“unsharing everything and then adding back everything your agent needs saves the trouble of updating a docker image”
“This makes me feel much more comfortable enabling "yolo" mode and letting the tools do everything.”
“Typically I just want to isolate the agent disallowing it from accessing other parts of the filesystem.”
“whereas with bubblewrap you have to manually bootstrap the availability of each individual dev tool”
“you can use something like bubblewrap[1] or a microVM like libkrun[2] if your goal is light-weight”
“wrapping codex in a launcher that uses bubblewrap to exclude certain files and directories”
“This is a lot less annoying than a container for stuff where I legitimately want to be able to point agents at random stuff”
“On my own machine I just give it a Linux User Namespace, i.e. soft virtualisation via "bubblewrap."”
“It cannot protect /proc and /sys filesystems. So it works only for simplest CLI programs.”
“sandboxing with Firejail and bwrap is quite easy to configure and allows fine-grained permissions”
“I like how these 2 sandboxes allow me to make all the file system r/o except the project folder which is r/w”
“bubblewrap stays lighter but it leak edges if you leave seccomp or fs mounts loose.”
“bwrap is as secure as you want it to be which I think is the primary advantage over anything else”
“bwrap / srt still feel somewhat cumbersome if you think about non tech roles”
“bwrap is much more honest in that regard: it’s just a syscall with no background processes and zero required privileges”
“A basic bubblewrap configuration can expose read-only system tools and have a read/write project directory”
“a simple bubblewrap (Linux) or sandbox-exec (macOS) is probably enough and also much less overhead”
“I like the bubblewrap approach, it just happens to be Linux-only unfortunately.”
“You can use this to be (much) more secure than otherwise, but it's not a security-oriented design”
“bubblewrap is a lot more flexible: You can freely piece together the sandboxed filesystem environment from existing directories, tmpfs, files or data provided via a file descriptor.”
“the pattern using bubblewrap in front of Claude can be exactly duplicated and applied to other coding agents”
“it will do a passable job in protecting you from an automated no-0day attack script”
“from there can take things away to expose as much or little of the host system as needed”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.