Agentic.Protocol.ACP.Permission (agentic v0.2.2)

Copy Markdown

Bridges ACP permission requests to Agentic tool permission system.

When an ACP agent sends a session/request_permission request, this module translates between ACP's permission option model and Agentic's tool_permissions map.

Permission Policies

  • :ask -- Delegate to the host application via callback
  • :allow_all -- Always approve (auto-approve all tool calls)
  • :deny_all -- Always reject

Summary

Functions

Build an allow-once outcome.

Build a deny-once outcome.

Delegate permission decision to a callback.

Handle an incoming permission request from the agent.

Functions

auto_allow(options, tool_call_id)

@spec auto_allow([Agentic.Protocol.ACP.Types.permission_option()] | nil, String.t()) ::
  map()

Build an allow-once outcome.

auto_deny(options, tool_call_id)

@spec auto_deny([Agentic.Protocol.ACP.Types.permission_option()] | nil, String.t()) ::
  map()

Build a deny-once outcome.

delegate_to_callback(options, tool_call_id, callbacks)

@spec delegate_to_callback(
  [Agentic.Protocol.ACP.Types.permission_option()] | nil,
  String.t(),
  map() | nil
) :: map()

Delegate permission decision to a callback.

handle_request(request, options, policy, callbacks)

@spec handle_request(
  map(),
  Agentic.Protocol.ACP.Types.permission_option() | nil,
  atom(),
  map() | nil
) :: map()

Handle an incoming permission request from the agent.

Returns the ACP response map to send back to the agent.