Permission requests
Default behavior (deny-all)
When permission_approve in config/copilot.php is "deny-all" (the default), permission requests during Copilot::run() and Copilot::start() are automatically denied.
This is a safe default because text-generation use cases usually don’t require permissions.
Available values
PermissionHandler::approveAll()
PermissionHandler::approveAll() auto-approves every request.
PermissionHandler::approveSafety()
PermissionHandler::approveSafety() denies only the high-risk permissions (shell and write) and auto-approves everything else.
$request['kind'] to decide.
PermissionHandler::denyAll()
PermissionHandler::denyAll() denies everything.
Using the client directly
When usingCopilotClient directly, specifying onPermissionRequest is required, just like the official SDK.
Custom handler
To control approvals by request kind, pass a closure.$request and $invocation are arrays with roughly the following shape.
$request
Fields other than kind and toolCallId vary based on kind.
$invocation
Response
Return the permission decision as an array. Using thePermissionRequestResultKind class makes the intent easier to read.
Protocol details
In Protocol v3 (the current default), permission requests are delivered as session events (permission.requested) rather than JSON-RPC requests.
The SDK handles this internally and responds via the session.permissions.handlePendingPermissionRequest RPC.
The usage of SessionConfig does not change.
Pass a handler to onPermissionRequest and the SDK absorbs any protocol differences.
PermissionRequestResultKind
You can return['kind' => 'approve-once'] directly, but PermissionRequestResultKind makes it clearer.
Available methods
To use
Laravel\Prompts\select, retrieve the options via PermissionRequestResultKind::select().
no-result
If the handler cannot produce a result (for example, in a non-interactive environment), returnno-result.
Returning no-result skips the RPC call, and the Copilot CLI’s default deny applies.
For the latest updates, see the GitHub repository.