Skip to content

fix(agent-isolation): stop the status line reading ~/.claude/settings.local.json - #1971

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/status-line-ignore-home-settings-local
Nov 3, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/status-line-ignore-home-settings-local

Conversation

@potiuk

@potiuk potiuk commented Nov 3, 2026

Copy link
Copy Markdown
Member

Summary

  • sandbox-status-line.sh walked ~/.claude/settings.local.json before ~/.claude/settings.json and stopped at the first file that sets sandbox.enabled. Claude Code does not load a settings.local.json from the home directory (the guide already says so for the container-gateway hooks, see fix(agent-isolation): wire the container-gateway hooks where Claude Code loads them #1921), so a stale enabled: true there made the footer show [sandbox] / [sandbox-auto] for a session with no sandbox.
  • The file is dropped from the walk; the script header, the section-5 comment and the precedence list in docs/setup/secure-agent-setup.md say why.
  • Seen on a real machine: a synced ~/.claude/settings.json lost sandbox.enabled, the only remaining enabled: true sat in ~/.claude/settings.local.json, and the footer showed [sandbox-auto] while a sandboxed touch ~/x succeeded and ~/.aws/credentials was readable. Both were denied once /sandbox wrote the project file.

Type of change

  • Python package (tools/*/ with pyproject.toml) — tools/agent-isolation script and tests
  • Documentation (docs/, README.md, CONTRIBUTING.md)

Test plan

  • Two new tests in TestSandboxTag: test_home_settings_local_is_not_read (only the home settings.local.json enables the sandbox) and test_home_settings_local_does_not_shadow_settings_json (it says true, ~/.claude/settings.json says false). Both fail on main and pass with the fix.
  • uv run --project tools/agent-isolation pytest tools/agent-isolation/tests/test_sandbox_status_line.py: 17 passed
  • prek run --files <changed files>: every hook passes except workspace-pytest, which fails only on three test_gpg_touch_overlay.py tests (test_wrapped_signer_record_is_cleaned_up[group-signal|dead-owner-sweep], test_failed_signer_publication_preserves_input_status_and_reminder). They fail the same way on unmodified main on this machine (macOS), so they are unrelated to this change.
  • The isolated-setup-fingerprint hook regenerated FRAMEWORK_FINGERPRINT, since tools/agent-isolation/ changed.

RFC-AI-0004 compliance

  • Sandbox — no new host access; the status line reads one file fewer, and can no longer report a sandbox that is not there

Linked issues

Refs #1921 (its reviewer notes list this script as a follow-up), Refs #1763

Notes for reviewers (optional)

🤖 Generated with Claude Code

….local.json

Claude Code loads a settings.local.json only from a project's .claude/,
never from the home directory. sandbox-status-line.sh still walked
~/.claude/settings.local.json ahead of ~/.claude/settings.json, so a
stale `sandbox.enabled: true` there made the footer render [sandbox] or
[sandbox-auto] over a session with no sandbox at all — the silent drift
the line exists to catch.

Drop that file from the walk, say why in the script header, and update
the precedence list in the secure-setup guide. Two regression tests
cover the home settings.local.json being ignored on its own and not
shadowing a `false` in ~/.claude/settings.json.

Generated-by: Claude Opus 5
@potiuk potiuk added family:setup setup-* skills capability:fix Implement code change to resolve an issue substrate:sandbox Tool substrate: agent isolation, egress control, settings audit labels Nov 3, 2026
@github-actions github-actions Bot added family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) labels Nov 3, 2026
@potiuk
potiuk merged commit 00a1a91 into apache:main Nov 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue capability:platform Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap) family:docs Docs, MISSION.md, READMEs family:setup setup-* skills family:tools tools/* 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