docs: fix inconsistent commandRegex example in policy engine (#19027)

This commit is contained in:
N. Taylor Mullen
2026-02-13 12:02:07 -08:00
committed by GitHub
parent e844a57bfc
commit c2f62b2a2b
2 changed files with 22 additions and 2 deletions

View File

@@ -208,9 +208,11 @@ commandPrefix = "git "
# (Optional) A regex to match against the entire shell command.
# This is also syntactic sugar for `toolName = "run_shell_command"`.
# Note: This pattern is tested against the JSON representation of the arguments (e.g., `{"command":"<your_command>"}`), so anchors like `^` or `$` will apply to the full JSON string, not just the command text.
# Note: This pattern is tested against the JSON representation of the arguments (e.g., `{"command":"<your_command>"}`).
# Because it prepends `"command":"`, it effectively matches from the start of the command.
# Anchors like `^` or `$` apply to the full JSON string, so `^` should usually be avoided here.
# You cannot use commandPrefix and commandRegex in the same rule.
commandRegex = "^git (commit|push)"
commandRegex = "git (commit|push)"
# The decision to take. Must be "allow", "deny", or "ask_user".
decision = "ask_user"