feat(core): add support for custom deny messages in policy rules (#17427)

This commit is contained in:
Allen Hutchison
2026-01-28 10:52:48 -08:00
committed by GitHub
parent 9e09db1ddb
commit 3787c71d15
8 changed files with 118 additions and 20 deletions

View File

@@ -210,6 +210,10 @@ decision = "ask_user"
# The priority of the rule, from 0 to 999.
priority = 10
# (Optional) A custom message to display when a tool call is denied by this rule.
# This message is returned to the model and user, useful for explaining *why* it was denied.
deny_message = "Deletion is permanent"
# (Optional) An array of approval modes where this rule is active.
modes = ["autoEdit"]
```
@@ -282,6 +286,7 @@ only the `mcpName`.
mcpName = "untrusted-server"
decision = "deny"
priority = 500
deny_message = "This server is not trusted by the admin."
```
## Default policies