Skip to content
Kward Search API index

Module: Kward::Workers::ToolPolicy

Defined in:
lib/kward/workers/tool_policy.rb

Overview

Tool allowlists for worker roles.

Constant Summary collapse

READ_ONLY_TOOLS =
%w[list_directory read_file code_search summarize_file_structure retrieve_tool_output web_search fetch_content fetch_raw read_skill].freeze

Class Method Summary collapse

Class Method Details

.allowed_tool_names(role) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/kward/workers/tool_policy.rb', line 9

def allowed_tool_names(role)
  case role.to_s
  when "request", "read_only"
    READ_ONLY_TOOLS
  else
    nil
  end
end

.write_capable?(role) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/kward/workers/tool_policy.rb', line 18

def write_capable?(role)
  allowed_tool_names(role).nil?
end