Repository navigation
Conversation
Add package snapshots, private Winsock catalog initialization, bound native startup and Pillow activation support, plus selected-shell preparation and regression coverage. Keep Required execution unavailable until complete runtime qualification; retained IPC and Terminal compatibility remain unfinished.
|
Opened #10526, which takes this PR's Linux bubblewrap policy and its Seatbelt profile as the starting point and drops the Windows work. The argv shape, the parent-directory read grants, the synthesised The reason I did not simply advance this branch is size. 67,308 lines across 199 files, and 72 percent of it is Windows: 28,359 lines of LPAC and restricted-token policy plus 20,081 lines of Detours C shim and its tests. That is the highest-consequence, hardest-to-review code category there is, and it would become ours to maintain. Linux and macOS together are a few thousand lines, and the macOS backend here is 700 lines of which all 700 are a test file. So the split I would like is: Linux and macOS through #10526, and Windows through #10441's pinned upstream SRT once its Two things from here that #10526 does not carry, and I would take either as a follow-up if you think they matter: the editable-install path parsing, and the seccomp userns fallback for bwrap older than 0.8.0 is present but only lightly tested. |
Summary
Add capability-aware isolation for Studio's local Python and Terminal tools. OS isolation is the default, unavailable backends fail closed, and users can explicitly choose session-only Limited execution when a qualified launch path is unavailable. Full access remains a separate option with its own warning.
The implementation now includes Linux Bubblewrap, macOS Seatbelt Preview, Windows restricted-token Limited execution, and an experimental Windows LPAC Python runtime. Windows LPAC qualification is not complete, so its Required path remains blocked.
Motivation
Replace the approach from #7101 without treating software checks as an OS sandbox or making compatibility failures silently reduce protection. In particular, preserve private Unix sockets for Linux multiprocessing and resource sharing while keeping existing host sockets out of the sandbox.
Users should see the protection actually used by a tool launch, not a label inferred from model arguments or their currently selected settings.
Changes
Shared launch and permission handling
a
prepare_tool_launch()andspawn_prepared_launch()instudio/backend/core/inference/os_sandbox.pyandtools.py.Linux Bubblewrap
/proc,/tmp,/dev/shm, minimal devices, and seccomp restrictions./tmp.macOS Seatbelt Preview
sandbox-exec.setsid()/double-fork descendant cleanup remains unverified. Ordinary cleanup uses the existing process-group path.Windows compatibility and experimental LPAC
Network policy
How to test
From
studio/backend:Run native platform tests on the matching host. Skips do not qualify a backend:
The experimental Windows bootstrap build prerequisites and installed-runtime tests are documented in
studio/windows_sandbox_runtime/README.md.From
studio/frontend:npm run typecheck node --experimental-strip-types --test --test-concurrency=2 "tests/**/*.test.ts" npm run buildManually verify Required blocking, Limited consent and cancellation, grant loss on refresh, separate Full confirmation, and actual Python/Terminal output labels. A preparation failure must show no successful execution label.
Notes for reviewers
The trust boundary excludes hostile concurrent host mutation. A read-only runtime bind is not an immutable snapshot, and host-side changes can remain visible through it. Preparation revalidation does not eliminate that race.
This is not protection against kernel exploits, host administrators, malicious hypervisors, or every denial-of-service attack. Preview and Limited limitations are part of the product contract, not equivalent to Protected isolation.
MCP execution is outside the security claim. SRT, Microsandbox, microVMs, and a general broker/service architecture are not included. Future isolation backends can extend the existing backend probe/preparation interface without replacing the Python and Terminal call sites.
Related
Replaces the approach from #7101.