-
-
Notifications
You must be signed in to change notification settings - Fork 22
Feature: Auto-approval for specific tools #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…for session and forever approval feat(tool_manager.py): load persistent auto-approved tools from config to maintain user preferences across sessions feat(config_management.py): add methods to manage auto-approval tools in global config for better user experience
…proved tools to clean up the codebase chore(config_management.py): remove commented-out code for ensuring auto_approval_tools key to enhance code clarity
…ainability chore(tool_manager.py): remove commented-out explanation to streamline code readability
…method to the end of the class for better readability and organization
AgentCrew/modules/chat/console_ui.py
Outdated
| self.console.print( | ||
| Text( | ||
| "\nAllow this tool to run? [y]es/[n]o/[all] future calls: ", | ||
| "\nAllow this tool to run? [y]es/[n]o/[a]lways in this session/[f]orever (this and future sessions): ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be [a]ll (in this session) instead of [a]lways in this session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
AgentCrew/modules/chat/console_ui.py
Outdated
| saved_text = Text( | ||
| "✓ Tool '", style=RICH_STYLE_YELLOW | ||
| ) | ||
| saved_text.append(tool_use["name"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge to 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…mprove clarity fix(console_ui.py): simplify approved text messages for better readability fix(config_management.py): return a default configuration structure with global settings when config file is missing or invalid
Add Persistent Tool Auto-Approval System
Summary
This PR introduces a persistent tool auto-approval system that allows users to permanently approve tools across sessions, in addition to the existing session-based approval.
Key Changes
🔧 Enhanced Tool Approval Options
[f]oreveroption alongside existing[y]es,[n]o, and[a]lwaysoptions[a]lways) and persistent ([f]orever) approvals🏗️ Core Implementation
ToolManager(tool_manager.py)_load_persistent_auto_approved_tools()method to load saved tools from configreset_approved_tools()to preserve persistent approvals while clearing session-based onesConfigManagement(config_management.py)get_auto_approval_tools()method to retrieve persistent auto-approved toolswrite_auto_approval_tools()method to add/remove tools from persistent listauto_approval_toolsarrayConsoleUI(console_ui.py)[f]oreveroption handler that saves tool to persistent config🔄 Behavioral Changes
Before:
[all]were only remembered for the current sessionAfter:
[a]lways- Session-based approval (existing behavior)[f]orever- Persistent approval across all sessions🛡️ Safety & Reliability
📋 User Experience
Technical Details
Config Structure
{ "api_keys": {}, "auto_approval_tools": ["tool1", "tool2", ...] }Flow changes