Repository navigation
feat(sandbox): add Bubblewrap sandbox backend for unprivileged Linux execution - #1080
Closed
ramashishmaurya wants to merge 1 commit into
Closed
ramashishmaurya wants to merge 1 commit into
ramashishmaurya wants to merge 1 commit into
Conversation
…execution
Add BubblewrapBackend ('bubblewrap', aliased 'bwrap') for rootless, daemonless sandboxed execution on Linux using kernel user, mount, and network namespaces directly.
AmitoVrito
added a commit
that referenced
this pull request
Oct 17, 2026
feat(sandbox): Bubblewrap backend, hardened (supersedes #1080)
Collaborator
|
Merged into I rebased it onto current
Full rationale in #1084. Appreciate the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
BubblewrapBackend(registered asbubblewrap, aliasedbwrap) to provide a daemonless, rootless, and containerless sandbox backend for Linux. It leverages Linux kernel user, mount, and network namespaces (unshare) directly without requiring root permissions, sudo, or container daemons like Docker or Podman.Type of change
Changes
src/synapsekit/sandbox/backends/bwrap.py):BubblewrapBackend(SandboxBackend)for unprivileged Linux execution.--ro-bind / /).--dev /dev,--proc /proc).--tmpfs /tmp)./workspace(--dir /workspace,--bind {work_root} /workspace) with working directory set to/workspace.--unshare-user,--unshare-pid,--unshare-ipc,--unshare-uts).--unshare-netapplied underNetworkPolicy.NONE, omitted underNetworkPolicy.EGRESS_ONLYfor outbound access.--clearenv, sanitizedPATH,HOME,TMPDIR, and custom env variables).--die-with-parentand--new-session.bwrapexecutable is missing.src/synapsekit/sandbox/backends/base.py):bubblewrapandbwrapinbuild_backend().src/synapsekit/sandbox/backends/__init__.py.tests/sandbox/test_backends.py):build_backendresolution, platform probe gating, binary missing error reporting, available probe capabilities, restrictive start/exec flag verification, and egress policy behavior.MagicMock/AsyncMock, using hand-written fakes andmonkeypatch).docs/pc-sandbox.mddescribing the new backend.CHANGELOG.mdunder[Unreleased] -> Added.Testing
uv run pytest tests/sandbox/ -q) — 48/48 passedruff check&ruff format --check)mypy src/synapsekit/sandbox)Notes for reviewer
bwrapexecution is ephemeral and dies cleanly with the parent process (--die-with-parent), so no orphaned containers or cleanup background jobs are required.