Repository navigation
fix(scratchpad): keep cell code away from the agent's code and process (ENG-4191) - #808
Open
martyna-mindsdb wants to merge 2 commits into
Open
martyna-mindsdb wants to merge 2 commits into
martyna-mindsdb wants to merge 2 commits into
Conversation
…s (ENG-4191) - The image venv stays root-owned, and the build smoke fails if the runtime user can write anything the agent loads (venv, anton's source, stdlib). - PYTHONNOUSERSITE=1, so no startup file in the writable home is loaded. - The cloud turn closes /proc access to itself before reading its request, on every path, not only when the resident hands it the turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…v is for now (ENG-4191) - The read-only check covers /app, the turn's working directory that `python -m` puts first on sys.path, and /usr/local/bin. - The Dockerfile header and the runtime-uv check no longer say the cell loop installs missing packages; uv builds and fills each pad's venv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Cloud cells run as the same user as the agent process, which holds the turn's credentials. Two gaps let cell code reach that process: the agent's venv was writable by that user, and a turn exec'd directly could be read through
/proc. This closes both on anton's side. The companion scratchpad-controller PR kills processes left over from earlier turns.Linear: https://linear.app/mindsdb/issue/ENG-4191/notionhubspot-on-web-keep-scratchpad-cell-code-away-from-the-agent
Dockerfilechownto UID 1000 is gone), andPYTHONNOUSERSITE=1stops Python loading startup files from the writable home folder. The header no longer says the cell loop installs missing packages.docker/image_smoke.py/appwith anton's source and the turn's working directory, the standard library,/usr/local/bin), or if user site-packages are on. The runtime-uv check now says uv builds and fills each pad's venv.anton/cloud_turn/__main__.py/procaccess to itself (PR_SET_DUMPABLE=0) before it reads its request. Until now only the resident's forks had this, and exec resets it, so the controller's direct exec and the launcher's fallback ran without it.tests/test_cloud_turn_proc_access.pytests/test_image_smoke.pyWhy the venv can be read-only: pad packages install into each pad's own venv under the workspace (
uv pip install --python <pad venv>), and the cell loop no longer installs anything itself. Nothing at turn time writes to the image venv.Validation:
test_image_smoke.pyand the cloud-turn tests pass locally on macOS, where the Linux-only tests skip; CI runs them on Linux.DevOps review: this touches
Dockerfileanddocker/, so it needs a DevOps approval.🤖 Generated with Claude Code