feat: flag wildcard-pattern tool allowlists in AW-007#2
Merged
brandonwise merged 1 commit intomainfrom Apr 8, 2026
Merged
Conversation
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
AW-007 now treats wildcard-pattern
allowedToolsentries (for examplegithub:*,mcp__github__*) as effectively unrestricted instead of safe allowlists.Why this change
Least-privilege pressure for MCP/agent tool access is climbing across sources, and teams are increasingly using broad wildcard patterns that still over-expose tool surfaces.
What changed
src/config.rshas_pattern_wildcard_allowed_tools.has_effective_allowed_toolsto reject wildcard-pattern allowlists (not just global*/all).src/rules/allowlist.rstests/integration_tests.rstest_detects_pattern_wildcard_allowlist.testdata/allowlist-pattern-wildcard.jsonValidation evidence
1) Repo-level/full test suite
cargo test206unit tests passed35integration tests passed2) Targeted tests for changed modules
cargo test pattern_wildcard4unit tests passed1integration test passed3) Lint/type/build checks
cargo clippy --all-targets -- -D warningscargo build --release4) Smoke/integration check for changed behavior
./target/release/agentwise scan testdata/allowlist-pattern-wildcard.json --format json | jq -r '.findings[] | select(.rule_id=="AW-007") | .title'Wildcard-pattern tool allowlist on high-risk serverRisk
Low. Scoped to AW-007 allowlist effectiveness logic and related tests/fixture only.