Repository navigation
Replies: 1 comment
|
There are two separate parts here: matching different arguments is supported; enforcing “only this repository” is not something a command-prefix rule provides. First inspect the saved rule in your active If you deliberately want these subcommands, with arbitrary following arguments, to run outside the sandbox without another prompt, the narrow subcommand prefixes are: prefix_rule(pattern=["git", "add"], decision="allow")
prefix_rule(pattern=["git", "commit"], decision="allow")Test a draft file before activating it: codex execpolicy check --pretty --rules ./git-draft.rules -- git add file1.cpp
codex execpolicy check --pretty --rules ./git-draft.rules -- git add file2.cpp
codex execpolicy check --pretty --rules ./git-draft.rules -- git commit -m "different message"In 0.157.1, this checker reads the named rules and outputs matches/decision; it does not execute those Git commands. You can repeat For configuration locality, the docs describe If the shorter patterns still prompt, the useful next evidence is the redacted saved rule and exact requested command/argv: for example, |
Uh oh!
There was an error while loading. Please reload this page.
Codex CLI version: 0.157.1
OS: Ubuntu
When Codex asks for approval to run
git addorgit commit, I choose option 2 to avoid approving the same kind of command repeatedly. However, the approval appears to apply to the entire command, including its arguments.For example:
git add file1.cpp. I choose option 2.git add file2.cppand asks for approval again.git commit -m "..."when the commit message changes.Option 2 therefore provides little benefit for these commands in a normal workflow, because the file paths and commit messages change each time.
Expected behavior: I would like a way to approve an appropriate command pattern, such as
git addandgit commitwithin the current repository, without approving every new set of arguments. If this is already supported, please let me know how to configure it.All reactions