Processes sandboxing

Foolproof Boundaries vs Unbounded Foolishness

bubblewrap

bubblewrap works by creating a new, completely empty, mount namespace where the root is on a tmpfs that is invisible from the host, and will be automatically cleaned up when the last process exits. You can then use commandline options to construct the root filesystem and process environment and command to run in the namespace.

The level of protection between the sandboxed processes and the host system is entirely determined by the arguments passed to bubblewrap. Some aspects that require special care are noted here.

Example (packaging bubblewrap):

$ sandbox-run npx @anthropic-ai/claude-code

sandbox-run runs npx (…) transparently inside a Bubblewrap sandbox, exposing only the $PWD. Contrary to many other solutions, it is a few lines of pure POSIX shell.

see also

Written on August 16, 2025, Last update on October 23, 2025
process cgroup sandbox c++