fix(sandbox): extract common process execution boundary - #6120
Open
RaresKeY wants to merge 1 commit into
Open
Conversation
|
Changed-file classification: backend/runtime. Author-reported runtime / visual state
Checkboxes are author attestations. GitHub Actions results remain the execution evidence for CI; this check does not prove that a local command ran. This comment updates automatically when the description or changed files change. |
This was referenced Aug 19, 2026
Open
Open
RaresKeY
marked this pull request as ready for review
August 19, 2026 10:14
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
This draft extracts the common process-execution boundary from #5818 into a reviewable core slice. It routes foreground Bash/Python, interactive tmux, and detached jobs through one server-owned sandbox boundary, protects SQLite/data/credential paths, propagates explicit network profiles, and keeps Sandbox as the default fail-closed mode. The branch deliberately leaves the low-level seccomp and egress implementations, container-host integration, and user-facing authority selection/API/UI to their linked slices.
Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Fixes #6116
Part of #6091
Part of #5815
Depends on PR #6119 and PR #6118 for the low-level substrates.
Requires PR #6121 for shipped Docker/runtime integration.
Supersedes the corresponding core/wiring slice of #5818.
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
All commands below ran in a network-isolated, credential-free validation runner.
python3 -m py_compile src/execution_sandbox.py src/process_execution.py src/sqlite_paths.py src/agent_tools/subprocess_tools.py src/bg_jobs.py src/bg_monitor.py src/tool_execution.py src/agent_loop.py src/teacher_escalation.py routes/chat_routes.py core/database.py tests/test_agent_bash_windows.py tests/test_app_db_permissions.py tests/test_bg_job_launch_cleanup.py tests/test_execution_sandbox.py tests/test_foreground_model_routing.py tests/test_process_execution_mode.py tests/test_process_sandbox_dispatch.py tests/test_sandbox_network_policy.py tests/test_workspace_confine.py.python3 -m pytest -q tests/test_execution_sandbox.py tests/test_process_execution_mode.py tests/test_process_sandbox_dispatch.py tests/test_sandbox_network_policy.py tests/test_bg_job_launch_cleanup.py tests/test_app_db_permissions.py tests/test_agent_bash_windows.py tests/test_foreground_model_routing.py tests/test_workspace_confine.py.Result: 219 tests passed and 31 were skipped, with one existing SQLAlchemy deprecation warning. The application, Docker/Compose, AppArmor, host-level Bubblewrap boot, seccomp-launcher, and egress-broker runtime checks were not run; those checks are intentionally deferred to #6117, #6119, and #6118 and are not claimed here.
This slice retains the seven post-87b93e65 hardening fixes from #5818: native process-tool routing, rejection of workspaces containing live SQLite databases, tmux rotation when policy changes, failed sandbox-launch artifact cleanup, the corrected procfs boundary documentation, capability-gated process modes, and aligned process failure contracts.
The reduced boundary is intentional: this PR keeps the internal capability/profile contract required by process callers and later authority work, while Sandbox remains the default and any unavailable process boundary blocks execution. User-facing authority selection, exact approvals, and authority API/UI remain owned by #6092 and #5819.
At the time of drafting, #6119 and #6118 are open draft dependency PRs and PR #6121 is the open container-host integration draft; this PR does not assume any of them is merged. Shipped Docker/runtime readiness is owned by PR #6121 and is not claimed by this core slice.
Visual / UI changes — REQUIRED if you touched anything that renders
Anything that changes what the UI looks like — buttons, icons, padding, colors, fonts, spacing, layout, CSS, HTML, SVG, or any
static/js/module that draws to the DOM — needs all of the following. PRs that change rendering without these WILL be closed.--red,--fg,--bg,--card,--border, etc.) — do not introduce new color values, font sizes, or spacing units.static/index.html) or plain text.Fira Code) for primary UI text. Don't override.Screenshots / clips
Not applicable: this PR changes no UI-sensitive files.