[security] Add path sandboxing to read_file/write_file tools #892

Closed
sleepy wants to merge 0 commits from fix/file-tool-sandboxing-676 into dev
Owner
No description provided.
- Add validate_file_path() to src/tool_security.py
- Resolve paths to absolute (collapses .., follows symlinks)
- Block sensitive system dirs: /etc, /root, /proc, /sys, /dev
- Require resolved path within TOOL_SANDBOX_DIRS (defaults to cwd)
- TOOL_SANDBOX_DISABLE=1 bypasses checks for dev/test
- Wire validation into read_file and write_file in tool_execution.py
- 23 new tests covering blocked paths, traversal, sandbox config
sleepy closed this pull request 2026-06-04 02:17:12 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.