Repository navigation
fix(agent-isolation): source the clean-env wrapper only from the user-scope copy - #2387
Merged
Merged
Conversation
…-scope copy The harness pages told the operator to source agent-iso.sh from <framework>/tools/agent-isolation/ or a framework checkout. Their shell rc file runs it outside every sandbox at each login, and every one of those trees can be written by the agents they run there: a framework checkout, a pinned snapshot inside the tracker repo, and ~/.cache/apache-magpie/framework/ on a marketplace install (where it is not even present for Claude Code or Codex). - Every harness page now sources ~/.claude/agent-isolation/agent-iso.sh, the global install, copied once from a checkout checked against upstream. - secure-agent-setup.md makes the global install the one for the secure setup and says why; the per-repo example stays, marked as not for it. - Edit(~/.claude/agent-isolation/**) joins the user-scope deny list, in the docs, the framework's own .claude/settings.json and the sandbox-lint baseline, so Claude Code's file tools cannot rewrite the copy. The doc says what holds it for the other harnesses, which ignore that rule: their workspace sandboxes (Codex, Goose, Antigravity, OpenCode, Kiro), Pi's ask on writes outside the working folder, and the per-write prompt in Cursor, Copilot and Aider. Generated-by: Claude Opus 5
potiuk
enabled auto-merge (squash)
November 26, 2026 22:48
8 tasks done
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
The harness pages (Aider, Antigravity, Codex, Copilot, Cursor, Goose, local LLM, Pi, Kiro, OpenCode, and the add-a-harness guide) told the operator to put
source <framework>/tools/agent-isolation/agent-iso.sh(or/path/to/magpie/...) in their shell. The rc file runs that script outside every sandbox at each login, and every tree it named can be written by the agents the operator runs there:<framework>is~/.cache/apache-magpie/framework/, which sandboxed commands can write (and which the Claude Code and Codex plugins do not even shiptools/agent-isolation/into).An agent that edited that file would get its code run in the operator's next shell. This is the same gap #2383 closed for the gatherer agent.
~/.claude/agent-isolation/agent-iso.sh, with a comment pointing at how it is installed.docs/setup/secure-agent-setup.mdmakes the global install the one for the secure setup and says why; it is copied once from a checkout whoseagent-iso.shmatches upstream. The per-repo example stays, marked as not for the secure setup.Edit(~/.claude/agent-isolation/**)joins the user-scope deny list (in the docs, the framework's own.claude/settings.jsonand thesandbox-lintbaseline), so Claude Code's file tools cannot rewrite the copy; its sandboxed commands already cannot write~/.claude/.workspace-write), Goose (the whole process in sandbox-runtime), Antigravity (allowNonWorkspaceAccess: false), OpenCode and Kiro (OS sandbox) keep writes inside the workspace; Pi asks before a native write outside the working folder; Cursor, Copilot and Aider have only their per-write approval prompt, so the doc tells the operator never to approve a write to that folder there.Type of change
docs/adapters/,docs/setup/secure-agent-setup.md).claude/settings.jsondeny rule,tools/sandbox-lint/expected.json; the secure-setup fingerprint is regenerated)Test plan
prek run --all-files --skip workspace-pytestandprek run workspace-pytest --from-ref origin/main --to-ref HEAD, including the sandbox-lint baseline tests and the lychee link checkRFC-AI-0004 compliance
🤖 Generated with Claude Code