Repository navigation
fix(setup): session-start hook runs a trusted, isolated interpreter - #1791
Merged
Merged
Conversation
The SessionStart hook runs outside the sandbox but took python3 from PATH, which project settings can set and which is often a uv-managed interpreter. It now uses only fixed system and Homebrew locations, then uv's managed CPython (read-only to the sandbox since apache#1785), first one 3.11 or newer, and runs it with -I and a one-line bootstrap instead of PYTHONPATH and -P, so no PYTHON* variable, user site-packages or the opened project reaches sys.path. Generated-by: Claude (Opus 5.5)
Review follow-up. Trusting uv-managed interpreters needs the gateway hook's full writable-root checks, and this hook only prints a notice, so it now takes only fixed system and Homebrew locations (which no sandbox grant may cover) and otherwise prints its own notice alone. It runs with -I -S: setup_preflight needs only the standard library. Generated-by: Claude (Opus 5.5)
potiuk
enabled auto-merge (squash)
October 24, 2026 22:11
This was referenced Oct 24, 2026
potiuk
added a commit
that referenced
this pull request
Oct 25, 2026
Ships the fixes merged since 0.9.0.dev202610241347 to marketplace installs: the container-gateway hook hardening (#1784, #1789, #1790, #1793, #1804), host-only uv state (#1785), session-start cleanup of the stale uv grant (#1788), the trusted session-start interpreter (#1791), the sandboxed prek home (#1792) and per-machine gateway hook registration (#1797). Generated-by: Claude (Opus 5.5)
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.
The magpie-setup SessionStart hook runs outside the sandbox but took
python3fromPATH, which project settings can set. It now uses only fixed system and Homebrew locations (Python 3.11+), which no sandbox grant may cover. It runs them with-I -Sand a one-line bootstrap instead ofPYTHONPATHand-P, so noPYTHON*variable, site-packages or the opened project reachessys.path. uv-managed interpreters are left out: trusting them needs the gateway hook's full writable-root checks, and this hook only prints a notice. Without a system Python it prints its own notice alone.🤖 Generated with Claude Code