Skip to content

fix(tools): keep read-only roots out of write paths - #4053

Closed
yu-xin-c wants to merge 1 commit into
HKUDS:mainfrom
yu-xin-c:codex/filesystem-readonly-allowed-dirs
Closed

fix(tools): keep read-only roots out of write paths#4053
yu-xin-c wants to merge 1 commit into
HKUDS:mainfrom
yu-xin-c:codex/filesystem-readonly-allowed-dirs

Conversation

@yu-xin-c

Copy link
Copy Markdown
Contributor

Summary

  • keep filesystem extra allowed roots read-only by applying them only to read/list tools
  • stop write/edit tools from inheriting media-dir access under workspace restriction
  • add regression coverage for extra allowed dirs and media dirs staying write-protected

Tests

  • uv run --extra dev pytest tests/tools/test_filesystem_tools.py::TestWorkspaceRestriction tests/security/test_workspace_policy.py tests/security/test_workspace_sandbox.py tests/tools/test_message_tool.py -q
  • uv run --extra dev pytest tests/tools/test_filesystem_tools.py tests/tools/test_sandbox.py tests/security/test_workspace_policy.py tests/security/test_workspace_sandbox.py -q
  • uv run --extra dev ruff check nanobot/agent/tools/path_utils.py nanobot/agent/tools/filesystem.py tests/tools/test_filesystem_tools.py --select F

@yu-xin-c
yu-xin-c force-pushed the codex/filesystem-readonly-allowed-dirs branch from a5b3e52 to 541c429 Compare June 4, 2026 16:02
@yu-xin-c
yu-xin-c force-pushed the codex/filesystem-readonly-allowed-dirs branch 2 times, most recently from f7e9a32 to 1c8d34d Compare June 8, 2026 16:14
@yu-xin-c
yu-xin-c force-pushed the codex/filesystem-readonly-allowed-dirs branch 3 times, most recently from 181c148 to c61156e Compare June 14, 2026 05:33
@yu-xin-c

Copy link
Copy Markdown
Contributor Author

Closing this as superseded by the current main branch. The behavior this PR was preserving is already present upstream now: read-only extra allowed roots do not widen write/edit paths, media-dir access stays read-only by default, and explicit extra_write_allowed_dirs / extra_write_allowed_files cover write opt-ins. Keeping this PR open would only leave a conflicting duplicate with no useful remaining diff to replay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant