permissions: add Ask list to force confirmation for tools#1785
Merged
dgageot merged 1 commit intodocker:mainfrom Feb 19, 2026
Merged
permissions: add Ask list to force confirmation for tools#1785dgageot merged 1 commit intodocker:mainfrom
dgageot merged 1 commit intodocker:mainfrom
Conversation
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
There was a problem hiding this comment.
✅ Review Complete - No Issues Found
I've reviewed all the changed code in this PR and found no bugs or issues.
The implementation correctly:
- Adds the
Askfield toPermissionsConfigacross all relevant config versions - Implements the
ForceAskdecision type in the permissions package with proper priority handling (Deny > Allow > ForceAsk > Ask) - Updates the permission checking logic to include Ask patterns
- Properly threads the Ask patterns through the app and runtime layers
- Includes comprehensive test coverage for the new functionality
- Updates the JSON schema with appropriate documentation
The changes follow existing patterns in the codebase and maintain consistency with how Allow/Deny patterns are handled. The priority ordering is correct, and the TUI updates properly display the new Ask patterns.
Great work on this feature! The implementation is clean and well-tested.
rumpl
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Example usage:
permissions: ask:
- fetch # always ask before fetching URLs (read-only)
- mcp:github:get_*
Assisted-By: cagent