Repository navigation
feat(grokcli): map the all-tools * permission category onto Grok's bare * rule - #3473
Merged
Merged
Conversation
…re * rule
Grok documents a bare `*` rule that matches every tool: upstream
`parse_rule` lands it on `ToolFilter::Any`, which `tool_filter_matches`
treats as matching every access kind. rulesync already has a canonical
all-tools `*` category, but the grokcli adapter only folded it onto
`Bash`, so a `*` deny never reached Read/Edit/WebFetch/MCP for Grok, and
an imported `*` entry was kept as unmanaged.
- Generate: `"*": { "*": action }` becomes the bare `*` entry; a narrower
pattern under `*` has no Grok spelling and is skipped with a warning.
- Import: a compact bare `*` entry and a tool-wide verbose `any` rule
both come back as the all-tools `*` category.
Refs #2498
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
… rules Generate now owns Grok's bare `*` entry, so a hand-written `deny = ["*"]` or `ask = ["*"]` with no matching canonical `*` rule was silently removed, which lifted a lockdown over every tool. Warn whenever that happens. Also warn when a bare `*` ask/deny makes specific less strict entries ineffective, since Grok evaluates deny > ask > allow across all tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…okcli-toolset-domains
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…okcli-toolset-domains # Conflicts: # src/generated/docs-content.ts
…okcli-toolset-domains # Conflicts: # src/generated/docs-content.ts
…okcli-toolset-domains # Conflicts: # src/generated/docs-content.ts
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
Handles the "bare
*tool rule" item of the issue below.Grok documents a bare
*rule that matches every tool ("A bare*rule matches every tool. Globs are not supported in the tool-name position." — 22-permissions-and-safety.md). In the source,parse_rulefinds no tool name in*and lands it onToolFilter::Any, andtool_filter_matchesreturnstrueforAnyon every access kind (rules.rs, policy.rs).The issue recorded this as needing a canonical all-tools category. That category now exists (
*), and CodeBuddy / Qoder already map it onto their own standalone*rule. The grokcli adapter only folded it ontoBashthroughhonorAllToolsOnBash, so a*deny never reached Read, Edit, WebFetch or MCP for Grok, and an imported*entry was kept as unmanaged.Changes
"*": { "*": action }writes the bare*entry into the matching[permission]array, at both scopes. Grok has no*(...)spelling, so a narrower pattern under*is skipped with a warning, following CodeBuddy and Qoder. Its shell restrictions still reachBashwhen abashcategory exists.*entry, so a hand-writtendeny = ["*"]/ask = ["*"]with no matching canonical*rule is removed. It warns whenever that lifts a restriction.*ask/denyoverrides every less strict entry in Grok (deny > ask > allow), so generate warns and names the specific entries that will never take effect.docs/reference/file-formats.md.*entry, and a tool-wide verbose[[permission.rules]]rule withtool = "any"(nopattern, or*), both come back as the all-tools*category. A pattern-scopedanyrule is still skipped.any)" examples in comments, the adapter's class doc, anddocs/reference/file-formats.md, including the migration note: a hand-written bare*entry is now Rulesync-owned.*, compact and verbose import, and the round trip. The two existing verbose-anytests now use a pattern-scoped rule so they still check the skip path.Still open on #2498 (not in this PR)
.grok/personas/*.toml: needs a new subagent surface or adapter.[toolset.web_search]/[toolset.web_fetch]domain lists: needs design decisions. The allowlist and blocklist are mutually exclusive, the allowlist is capped at 5 entries, it is global only, and the user-authored[toolset.*]table needs gatewayownedKeys.Refs #2498
🤖 Generated with Claude Code
https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv