Skip to content

fix(sandbox-lint): refuse wholesale weakenings and keep the vetted-ops checkout read-only - #1693

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:fix/magpie-dir-not-writable
Oct 17, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:fix/magpie-dir-not-writable

Conversation

@potiuk

@potiuk potiuk commented Oct 17, 2026

Copy link
Copy Markdown
Member

Two commits. The first is the lint hardening that missed the #1684 merge; the second closes the gap its last review found.

1. Refuse settings that switch a control off wholesale. In any layer — committed floor, local template, or a contributor's own .claude/settings.local.json — sandbox-lint now fails on:

  • an excludedCommands entry or Bash(...) allow whose command runs anything:
    • *, or a shell or interpreter by name, path or version (bash, /bin/sh, python3.12, env, source, …);
    • a leading NAME=value;
    • a script in the checkout or under a writable directory;
    • a package runner not pinned to a read-only path (uv run without --project, every other uv subcommand, uvx without --from, npx, and npm/pnpm/yarn/pipx beyond their read-only forms);
  • a bare Bash allow;
  • defaultMode: bypassPermissions;
  • * in allowedDomains.

2. Keep the vetted-ops checkout out of the working directories. The sandbox makes every working directory (permissions.additionalDirectories, /add-dir) writable to sandboxed Bash, whatever allowWrite says. sandbox-add-project-root.sh listed ~/.claude/magpie there, and the vetted-ops exclusions run that checkout's code outside the sandbox. The entry was only there to stop Read prompts under blockReadsOutsideWorkingDirectories, which the vetted-ops commands need off anyway.

  • The script no longer adds it, and removes it where an earlier version did.
  • sandbox-lint counts working directories as writable, and fails on one covering the checkout.
  • Doctor probe 9 reports ✗ for one (the path, any parent, ~ spellings). Verify has a new check 16f, and update treats it as a must-fix.
  • Docs and specs are updated to match.

Migration: update ~/.claude/scripts/sandbox-add-project-root.sh, re-run it with --all-worktrees from each repo, and restart the agent session.

Residual risk (sandbox-lint README): the check recognises shapes, so a tool not on its lists that runs its arguments still passes (find -exec, git -c, make, …). An allowlist of command words for excludedCommands would close that and is a separate change. The environment uv builds from a pin lives in the writable uv cache or .venv.

🤖 Generated with Claude Code

A layer could still pass the lint while excluding every command from the
sandbox (a bare "*" or a shell or interpreter exclusion), approving every
shell command (Bash or Bash(*), which the mid-pattern "*" rule misses),
turning prompting off with defaultMode bypassPermissions, or allowing every
host. Each is now an invariant, so it fails in the committed file, the local
template, and a contributor's live .claude/settings.local.json alike.

Generated-by: Claude Opus 5
@github-actions github-actions Bot added family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:reassess Re-run historical issues against current code capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) substrate:sandbox Tool substrate: agent isolation, egress control, settings audit labels Oct 17, 2026
@potiuk
potiuk force-pushed the fix/magpie-dir-not-writable branch from f6088d4 to 3aa2d7c Compare October 17, 2026 21:47
… directories

A working directory is sandbox-writable whatever allowWrite says, and the
vetted-ops exclusions run that checkout's code outside the sandbox, so
listing ~/.claude/magpie in additionalDirectories let sandboxed code change
what runs unsandboxed. It was only there to stop Read prompts under the
read block, which the vetted-ops commands need off anyway.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the fix/magpie-dir-not-writable branch from 3aa2d7c to 4f9fa56 Compare October 17, 2026 21:57
@github-actions github-actions Bot added the substrate:framework-dev Tool substrate: build / validate / eval the framework itself label Oct 17, 2026
@potiuk
potiuk merged commit 1d773a8 into apache:main Oct 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) capability:reassess Re-run historical issues against current code family:docs Docs, MISSION.md, READMEs family:setup setup-* skills family:tools tools/* substrate:framework-dev Tool substrate: build / validate / eval the framework itself substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant