Refactor execpolicy fallback evaluation

This commit is contained in:
kevin zhao
2025-12-03 23:33:04 +00:00
parent 31c5e1116b
commit f8ccfa0f2c
10 changed files with 365 additions and 176 deletions
+24
View File
@@ -33,6 +33,30 @@ codex execpolicy check --policy ~/.codex/policy/default.codexpolicy git push ori
Pass multiple `--policy` flags to test how several files combine, and use `--pretty` for formatted JSON output. See the [`codex-rs/execpolicy` README](../codex-rs/execpolicy/README.md) for a more detailed walkthrough of the available syntax.
Example output when a rule matches:
```json
{
"matchedRules": [
{
"prefixRuleMatch": {
"matchedPrefix": ["git", "push"],
"decision": "prompt"
}
}
],
"decision": "prompt"
}
```
When no rules match, `matchedRules` is an empty array and `decision` is omitted.
```json
{
"matchedRules": [],
}
## Status
`execpolicy` commands are still in preview. The API may have breaking changes in the future.
```