Skip to content

feat: detect wildcard allowedTools as unrestricted#1

Merged
brandonwise merged 1 commit intomainfrom
auto/pm-presence-20260331
Apr 1, 2026
Merged

feat: detect wildcard allowedTools as unrestricted#1
brandonwise merged 1 commit intomainfrom
auto/pm-presence-20260331

Conversation

@brandonwise
Copy link
Copy Markdown
Owner

@brandonwise brandonwise commented Apr 1, 2026

Summary

Wildcard tool allowlists (allowedTools: ["*"], all, any) were being treated as safe restrictions.

This PR makes wildcard allowlists fail closed across scan + inspect so broad tool exposure is surfaced instead of silently passing.

Why now

Recent demand signals keep converging on the same failure mode: agentic permissions without real guardrails.

What changed

  • Added shared config helpers to classify allowedTools as:
    • effective (explicit least-privilege entries)
    • wildcard/unrestricted (*, all, any, etc.)
  • Updated AW-007 to flag wildcard allowlists as effectively unrestricted with clearer remediation text.
  • Updated AW-003 (shell) and AW-008 (write-capable tools) so wildcard allowlists no longer suppress findings.
  • Updated inspect output:
    • allowlist_present=false when wildcard allowlists are used
    • adds wildcard_allowlist risk tag
  • Added unit coverage for all new wildcard behaviors.

Validation (deep)

1) Full test suite (repo-level)

  • cargo test --quiet -- --test-threads=1
    ✅ PASS (202 unit tests + 34 integration tests)

2) Targeted tests for changed modules

  • cargo test wildcard_allowlist --quiet
    ✅ PASS (5 targeted tests)

3) Lint/type/build checks

  • cargo clippy --all-targets -- -D warnings
    ✅ PASS
  • cargo build --release
    ✅ PASS

4) Smoke/integration behavior check

Command run:

tmp=$(mktemp /tmp/agentwise-wildcard-XXXXXX) && cat > "$tmp" <<'JSON'
{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-fetch"],
      "allowedTools": ["*"]
    }
  }
}
JSON
cargo run --quiet -- scan "$tmp" --format json > /tmp/agentwise-wildcard-scan.json
python3 - <<'PY'
import json
obj=json.load(open('/tmp/agentwise-wildcard-scan.json'))
aw007=[f for f in obj['findings'] if f.get('rule_id')=='AW-007']
print('AW-007 findings:', len(aw007))
print('Top title:', aw007[0]['title'] if aw007 else 'none')
PY

✅ PASS

  • AW-007 findings: 1
  • Top title: Wildcard tool allowlist on high-risk server

Risk / rollout

Low-risk, scoped rule-hardening change. No unrelated refactors.

@brandonwise brandonwise merged commit fbc4953 into main Apr 1, 2026
8 checks passed
@brandonwise brandonwise deleted the auto/pm-presence-20260331 branch April 1, 2026 01:15
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