You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
permissions: add Ask list to force confirmation for read-only tools
Read-only tools (ReadOnlyHint: true) were always auto-approved with no
way to override that via permissions config. This adds an explicit Ask
field to PermissionsConfig that forces user confirmation even for
read-only tools.
- Add Ask []string to PermissionsConfig in config/latest, config/v4,
and session packages
- Add ForceAsk Decision constant to the permissions package, returned
when a tool explicitly matches an Ask pattern (distinct from the
default Ask fallback)
- Update Checker.CheckWithArgs to return ForceAsk for Ask pattern
matches, and update IsEmpty/AskPatterns accordingly
- Handle ForceAsk in executeWithApproval by bypassing ReadOnlyHint and
ToolsApproved auto-approval, jumping directly to user confirmation
- Extract confirmation dialog into askUserForConfirmation helper to
avoid duplication between session, team, and default flows
- Update cagent-schema.json with the new ask property
Example usage:
permissions:
ask:
- fetch # always ask before fetching URLs (read-only)
- mcp:github:get_*
Assisted-By: cagent
Copy file name to clipboardExpand all lines: cagent-schema.json
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -636,6 +636,21 @@
636
636
]
637
637
]
638
638
},
639
+
"ask": {
640
+
"type": "array",
641
+
"description": "Tool patterns that always require user confirmation, even for tools that are normally auto-approved (e.g. read-only tools). Supports the same pattern syntax as allow: tool names with globs and argument matching (e.g., 'fetch' to always ask before fetching URLs).",
642
+
"items": {
643
+
"type": "string"
644
+
},
645
+
"examples": [
646
+
[
647
+
"fetch"
648
+
],
649
+
[
650
+
"mcp:github:get_*"
651
+
]
652
+
]
653
+
},
639
654
"deny": {
640
655
"type": "array",
641
656
"description": "Tool patterns that are always rejected. Takes priority over allow patterns. Supports the same pattern syntax as allow: tool names with globs and argument matching (e.g., 'shell:cmd=rm -rf*' to block dangerous rm commands).",
0 commit comments