Skip to main content

Module permission

Module permission 

Source
Expand description

ACP Sprint-1 permission bridge.

Defines PermissionOutcome, PermissionDecision, and a complete permission flow connecting the ACP session/request_permission notification/response protocol to the agent’s PermissionHook.

§Architecture

  1. When a tool call requires permission, AcpPermissionHook::check sends a session/request_permission JSON-RPC notification to the client with permission_id, tool_name, and argument details.
  2. The client receives the notification (as a session/update with sessionUpdate: "request_permission") and sends back a session/request_permission JSON-RPC request with the outcome.
  3. The ACP server’s dispatch loop routes this to handle_request_permission which resolves the pending oneshot channel.
  4. AcpPermissionHook::check receives the outcome and returns Allow or Deny.
  5. A 30-second timeout defaults to Deny.

Structs§

AcpPermissionHook
A PermissionHook that communicates permission requests to the ACP client.
PendingPermissionStore
Thread-safe store of pending permission requests, keyed by permission ID.

Enums§

PermissionOutcome
The outcome of a client permission decision.

Functions§

handle_request_permission
Handle a session/request_permission request from the client.
translate
Translate a PermissionOutcome to PermissionDecision.