Repository navigation
feat(codexcli): opt-in canonical_matching on bash deny and ask rules - #3817
Merged
Merged
Conversation
Add a codexcli.bash_canonical_matching permissions override that writes canonical_matching = True on the forbidden and prompt prefix rules in .codex/rules/rulesync.rules (Codex 0.167.0+). Off by default because an older Codex rejects the unknown keyword and fails to load the rules file. Allow rules stay exact so the option never widens auto-approval. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
…dex-canonical-matching # 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
Codex rust-v0.167.0 (openai/codex#59535) added a
canonical_matchingkeyword toprefix_rule(). Withcanonical_matching = True, pattern tokens are compared after Unicode canonical case-insensitive folding, so aforbiddenrule forrmalso matchesRMor other look-alike spellings. On a case-insensitive filesystem those spellings still run the same binary. Rulesync never wrote the keyword.This PR adds an opt-in boolean,
codexcli.bash_canonical_matching, to the existing Codex CLI tool-scoped permissions override. It does not add a canonical schema field. The option is off by default because theprefix_rulebuiltin at rust-v0.166.0 has no such parameter: Starlark rejects the unknown keyword, and an older Codex would fail to load the whole rules file.Changes
src/types/permissions.ts: addbash_canonical_matching: z.optional(z.boolean())toCodexcliPermissionsOverrideSchemaand document it.src/features/permissions/codexcli-permissions.ts:true,buildCodexBashRulesContentwritescanonical_matching = Trueon theforbidden(deny) andprompt(ask) rules in.codex/rules/rulesync.rules.allowrules stay exact, so the option never widens what Codex auto-approves.git_write_rules, the key is read by the generator and is not written toconfig.toml.computeCodexcliOverridePatchskips it without the "not managed" warning.docs/reference/file-formats.md: document the key, the Codex 0.167.0+ requirement, and that it does not round-trip through import.src/generated/docs-content.tsis regenerated from the docs.false.true, only the deny and ask rules carry the keyword.config.tomland does not trigger a warning.Default output is unchanged, so no e2e expectations change.
Verification
prefix_ruleincodex-rs/execpolicy/src/parser.rstakescanonical_matching: Option<bool>at rust-v0.167.0 but not at rust-v0.166.0.pnpm cicheckpasses (614 test files, 16829 tests; content checks green).Refs #2496
🤖 Generated with Claude Code
https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7