Skip to content

Permission Request: Deny all by default#36

Merged
kawax merged 1 commit intomainfrom
deny-default
Mar 9, 2026
Merged

Permission Request: Deny all by default#36
kawax merged 1 commit intomainfrom
deny-default

Conversation

@kawax
Copy link
Member

@kawax kawax commented Mar 9, 2026

This pull request updates how permission requests are handled in the Copilot integration, making the default behavior safer and providing more granular configuration options. The changes clarify documentation, update configuration defaults, and refactor handler injection logic to support multiple modes. Comprehensive tests are added to verify each mode.

Configuration and handler logic updates:

  • Updated config/copilot.php to change the default value of permission_approve from true (auto-approve) to "deny-all" (auto-deny), and clarified the configuration options and documentation comments to support four modes: "deny-all", "approve-safety", "approve-all", and false.
  • Refactored CopilotManager::ensurePermissionHandler to inject the correct handler based on the new permission_approve setting, supporting all four modes and ensuring legacy behavior is preserved for true.

Documentation updates:

  • Revised docs/jp/permission-request.md to reflect the new default ("deny-all"), explain the available configuration values, and add safety warnings for potentially dangerous settings.

Testing improvements:

  • Added a suite of tests in CopilotManagerTest.php to verify handler injection for each configuration mode, including legacy and custom handler scenarios.

Introduce configurable permission_approve modes and switch the default to a safer "deny-all". CopilotManager::ensurePermissionHandler was refactored to inject handlers for 'deny-all', 'approve-safety', 'approve-all' (and map legacy true to approveAll) or omit injection when false. Updated config default in config/copilot.php, translated and expanded Japanese docs to document the new options and cautions, and added comprehensive tests for ensurePermissionHandler behavior.
@kawax kawax merged commit 298a202 into main Mar 9, 2026
5 checks passed
@kawax kawax deleted the deny-default branch March 9, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant