Skip to content

Conversation

@Sur3
Copy link

@Sur3 Sur3 commented Jan 31, 2026

Summary

  • Replace dangerous 'always' permission with scoped alternatives
  • Add file_always, folder_always, folder_recursive, project_recursive options
  • Implement smart UI that shows relevant options based on tool type and context
  • Add comprehensive tests for new permission types
  • Improve security by allowing precise scope control for read/edit operations

Changes Made

Enhanced Permission Types

  • file_always: Always allow this specific file
  • folder_always: Always allow this specific folder (non-recursive)
  • folder_recursive: Always allow this folder and all subfolders
  • project_recursive: Always allow entire project folder recursively
  • Removed: dangerous "always" option that could allow anything

Smart UI Adaptation

  • File-based tools (read, edit) show all scoped options
  • Non-file tools (bash, etc.) show limited relevant options
  • Options dynamically adapt based on file context availability

Backend Changes

  • Updated PermissionNext.Reply enum with new options
  • Added pattern generation logic for different scopes
  • Enhanced reply handling to process new permission types

Testing

  • Added comprehensive test coverage for all new permission types
  • Verified pattern generation for files, folders, and project scopes
  • Tested both file-based and non-file tool scenarios

This improves security by providing precise control over what can be accessed, replacing previous all-or-nothing approach.

Sur3 added 2 commits January 31, 2026 23:44
- Replace dangerous 'always' permission with scoped alternatives
- Add file_always, folder_always, folder_recursive, project_recursive options
- Implement smart UI that shows relevant options based on tool type and context
- Add comprehensive tests for new permission types
- Improve security by allowing precise scope control for read/edit operations
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Sur3 added 4 commits February 1, 2026 00:28
- Add selectedOption to store state to track user's choice
- Fix confirmation dialog to use the originally selected option instead of defaulting to project_recursive
- This ensures file_always, folder_always, and folder_recursive work correctly
- Add filepath to metadata in read tool's permission request
- Remove debug console logging
- This enables fine-grained permission options for read operations
- Update web GUI to use permission.reply endpoint instead of deprecated permission.respond
- Add fine-grained permission options for file operations (read/edit/write)
- Show context-aware permission options based on tool type and file path
- Add translation strings for new permission options
- Update API schema to include fine-grained permission enum values
- Match TUI behavior for permission dialog options

Fixes issue where web GUI only showed "Deny", "Allow Always", and "Allow Once"
instead of the full fine-grained options implemented in the last 5 commits.
@Sur3 Sur3 requested a review from adamdotdevin as a code owner February 1, 2026 00:44
@Sur3 Sur3 marked this pull request as draft February 1, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant