Repository navigation
feat(sandbox): bubblewrap host confinement for criteria execution (#592) - #632
Merged
dan-petty merged 2 commits intoSep 27, 2026
Conversation
dan-petty
marked this pull request as draft
September 27, 2026 04:39
dan-petty
marked this pull request as ready for review
September 27, 2026 04:56
dan-petty
deleted the
feat/592-bubblewrap-host-sandbox-criteria-confinement
branch
September 27, 2026 04:56
This was referenced Nov 28, 2026
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
Resolves #592 (Part 1 of 2: bubblewrap host confinement for criteria execution).
This PR introduces robust Linux container-free sandbox confinement via
bubblewrap(bwrap) behind a narrowHostSandboxseam, routing executable criterion verification through strictly isolated namespaces.Key Changes
HostSandbox): Implemented insrc/devops_cli/sandbox/host.pywith zero boilerplate and bounded cyclomatic complexity (McCabe complexity <= 4, depth <= 2).bubblewrap(bwrap) with:--unshare-all,--new-session,--die-with-parent--clearenv+ explicit sanitized minimal environment (CONST_HOST_SANDBOX_DEFAULT_ENV:PATH,TERM,LANG,TMPDIR)--dev /dev,--proc /proc,--tmpfs /tmp--ro-bindfor system directories and resolved symlinks (/usr,/bin,/lib,/lib64,/sbin)--ro-bindfor target repository workspace$HOME,$XDG_RUNTIME_DIR,$DBUS_SESSION_BUS_ADDRESS,$GITHUB_TOKEN, LLM API keys, and keyring paths.HostSandboxResult(exit_code=-1, error=...)ifbwrapis missing or namespaces are refused, never allowing unconfined execution.execute_criterion_commandinsrc/devops_cli/ai/review/review_environment.pythroughHostSandbox.CONST_FORBIDDEN_SANDBOX_ENV_KEYS,CONST_HOST_SANDBOX_DEFAULT_ENV,CONST_HOST_SANDBOX_SYSTEM_SYMLINKS,CONST_HOST_SANDBOX_SYSTEM_DIRS, and defaultDEFAULT_HOST_SANDBOX_BINARYinsrc/devops_cli/config/.bubblewrapto.devcontainer/Dockerfile, updatedSECURITY.mdanddocs/DEVCONTAINER_USAGE.md.tests/test_host_sandbox.pyverifying repo read access, home directory isolation, write denial, network isolation, credential stripping, and fail-closed handling.Verification
tests/test_host_sandbox.pywith structural tuple equality assertions.uv run devops ci).