fix(skills): safely tokenize portable allowed-tools patterns - #4984
Draft
georgelichen wants to merge 3 commits into
Draft
fix(skills): safely tokenize portable allowed-tools patterns#4984georgelichen wants to merge 3 commits into
georgelichen wants to merge 3 commits into
Conversation
Portable Agent Skills declarations such as Bash(tvly *) contain spaces inside a command pattern. Keep those patterns as single literal entries while preserving exact names from the existing YAML-list form, so skill loading no longer fragments valid metadata or rewrites mixed-case MCP tools. Constraint: DeerFlow's current skill policy matches exact tool names and does not inspect Bash arguments Constraint: Agent Skills scalar syntax uses whitespace-separated entries with parenthesized command patterns Rejected: raw.split() | fragments Bash(tvly *) into unrelated tool names Rejected: normalize YAML-list entries | breaks case-sensitive MCP/runtime tool names Rejected: map Bash(...) to bash | broadens command-scoped declarations into unrestricted shell access Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep Bash(...) entries literal and inactive until DeerFlow has an explicit command-pattern authorization model Tested: 175 focused parser, validation, installer, review, loader, and tool-policy tests; Ruff check and format; compileall; git diff --check Not-tested: Full backend suite stopped at pre-existing Windows mode assertion test_runtime_config_store_file_is_owner_only Related: bytedance#4912
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.
Summary
Follow-up to #4912: #4912
This keeps portable
allowed-toolsparsing safe for Agent Skills declarations such as:Bash(...)stay in one entry.Bash(...)entries literal and inactive; this PR does not broaden them into unrestrictedbashaccess.Verification
uv run pytest tests/test_skills_parser.py tests/test_skills_validation.py tests/test_skills_installer.py tests/test_skill_review_core.py tests/test_skill_reviewer_public_skill.py tests/test_skill_tool_policy_middleware.py -q— 176 passedcompileallandgit diff --checkpassed.The full backend suite currently has an unrelated Windows permission-mode failure in
test_runtime_config_store_file_is_owner_only.