Overview
Permission requests are a critical security feature in ACP. Before executing potentially sensitive operations, the agent requests permission from the user through the client.When Permissions are Requested
The agent callsrequestPermission when:
- Writing files
- Executing terminal commands
- Reading sensitive files
- Making external API calls
- Any other operation requiring user approval
Request Flow
Request Structure
TherequestPermission method receives:
Response Structure
The client must respond with:If the client sends a
session/cancel notification while a permission request is pending, it MUST respond with { outcome: { outcome: "cancelled" } }.Permission Option Types
Allow
Allow the operation to proceed as requested.Deny
Reject the operation.Apply Patch
For file write operations, the agent may offer alternative patches.Modify Request
For commands, the agent may offer modified versions.Implementation Examples
Basic CLI Implementation
Here’s a simple command-line permission UI:src/examples/client.ts:11-43
GUI Implementation Pattern
For a graphical client:UI Design Patterns
Displaying Tool Call Information
Permission Option Buttons
Showing Alternative Patches
Forapply_patch options: