Skip to contents

Agent

Core agent class for agentic AI workflows

Agent
Agent R6 Class
AgentResult
Agent Result R6 Class
AgentEvent()
Create an agent event
AgentUsage()
Create an agent usage record
UsageLimits()
Configure run-scoped usage limits

Tools

Built-in tools and tool bundles

tool_read_file()
Read file contents
tool_read_markdown()
Convert a file to markdown using MarkItDown
tool_write_file()
Write content to a file
tool_edit_file()
Edit file contents by replacing text
tool_multi_edit()
Apply multiple text edits to a file
tool_list_files()
List files in a directory
tool_glob_files()
Find files using a glob pattern
tool_grep_files()
Search file contents with grep-like matching
tool_run_r_code()
Execute R code
tool_run_bash()
Execute bash commands
tool_read_csv()
Read a CSV file
tool_web_fetch()
Fetch web page content
tool_web_search()
Search the web
tool_ask_user()
Ask user tool
tools_file()
File operation tools
tools_code()
Code execution tools
tools_data()
Data reading tools
tools_web()
Web tools
tools_all()
All built-in tools
tools_preset()
Get a tool preset by name
tools_interactive()
Tools for interactive workflows
tools_mcp()
Get tools from MCP servers
set_ask_user_callback()
Set callback for non-interactive user input

Permissions

Control what agents can do

Permissions
Permissions R6 Class
PermissionMode
Permission modes for agent tool access
PermissionResultAllow()
Create an allow permission result
PermissionResultDeny()
Create a deny permission result
permissions_standard()
Create a standard permission policy
permissions_readonly()
Create a read-only permission policy
permissions_plan()
Create a planning permission policy
permissions_full()
Create a full access permission policy

Hooks

Intercept and customize agent behavior

HookEvent
Hook events supported by deputy
HookMatcher
HookMatcher R6 Class
HookResultPreToolUse()
Create a PreToolUse hook result
HookResultPostToolUse()
Create a PostToolUse hook result
HookResultPreCompact()
Create a PreCompact hook result
hook_log_tools()
Create a hook that logs all tool calls
hook_block_dangerous_bash()
Create a hook that blocks dangerous bash commands
hook_limit_file_writes()
Create a hook that limits file writes to a directory

Skills

Extend agents with specialized capabilities

Skill
Skill R6 Class
skill_load()
Load a skill from a directory
skill_create()
Create a skill programmatically
skills_list()
List available skills in a directory

Multi-Agent

Coordinate multiple specialized agents

LeadAgent
LeadAgent R6 Class
agent_definition()
Create an Agent Definition

Errors

Identify structured Deputy conditions

deputy-errors DeputyError
Deputy Error Classes
is_deputy_error()
Check if an object is a deputy error