fix(agent): whitelist read_file in background review fork - #46684
Closed
flooryyyy wants to merge 1 commit into
Closed
fix(agent): whitelist read_file in background review fork#46684flooryyyy wants to merge 1 commit into
flooryyyy wants to merge 1 commit into
Conversation
Background review whitelist only allows memory+skills toolsets. read_file is blocked despite being read-only and needed for the review fork to inspect source files when authoring skills. Without read_file the model fabricates content or hits skill_manage denials when referencing external files. 15 sessions failed silently between May 14-18 before local patch. Changes: - Add read_file to review_whitelist after toolset-derived build - Update deny message and review prompt to mention read_file - Update module docstring to reflect expanded whitelist - Add privacy guard: do not copy private local file contents into durable skills Tests: - New test_background_review_readfile_whitelist.py with 11 tests covering whitelist composition, deny message, and prompt content - Update existing test_background_review_toolset_restriction.py to assert read_file is allowed and file write tools are denied Supersedes original PR NousResearch#27422 which targeted run_agent.py (since refactored into agent/background_review.py).
Collaborator
|
Duplicate of #40007 — same fix (add Related: #27422 (your own earlier attempt, closed because it targeted the pre-refactor |
Contributor
Author
Contributor
Author
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.
Background
Background review whitelist only allows memory+skills toolsets.
read_fileis blocked despite being read-only and needed for the review fork to inspect source files when authoring skills.Without
read_filethe model fabricates content or hitsskill_managedenials when referencing external files. 15 sessions failed silently between May 14-18 before local patch.Supersedes stale #27422 which targeted the old
run_agent.pypath (since refactored intoagent/background_review.py).Changes
read_filetoreview_whitelistafter toolset-derived buildread_fileTests
test_background_review_readfile_whitelist.py(11 tests) covering whitelist composition, deny message, and prompt contenttest_background_review_toolset_restriction.pyto assertread_fileis allowed and file write tools are deniedWhy not the full file toolset?
Only
read_fileis added.write_file,patch, andsearch_filesremain denied - the review fork should read, not write, external files.Verification
Both #40060 and #40007 address the same issue - closing in favor of this one which has full test coverage.