Skip to content

Tools Overview

Rusty provides a set of built-in tools that the LLM can invoke during a conversation. Each tool has a defined permission level and purpose.

ToolPermissionDescription
file_readReadOnlyRead file contents with optional offset and limit
file_writeWriteCreate or overwrite files
file_editWriteExact string match-and-replace editing
apply_patchWriteApply unified diff patches
bashClassifiedExecute shell commands
grepReadOnlyRegex search across files
globReadOnlyFile pattern matching
web_fetchReadOnlyFetch content from URLs (with SSRF protection)
todowriteNoneStructured task list management
noteNoneSession-scoped scratchpad for recording observations
agentNoneSpawn sub-agents for complex tasks
memoryNonePer-project persistent memory (save, search, list, delete)

Tools operate under one of four permission levels:

  • None: No special permissions required. Always allowed.
  • ReadOnly: Can read data but cannot modify files or system state.
  • Write: Can create or modify files in the working directory.
  • Execute: Can run system commands. The bash tool is classified per-command.

All file tools enforce path sandboxing via resolve_path(). Paths are canonicalized (resolving symlinks and .. components) and validated to ensure they remain within the working directory. Attempts to access files outside the sandbox are rejected.

The sandbox is hardened against TOCTOU symlink races:

  • Pre-write verification via verify_not_escaping_symlink() checks before file creation.
  • Post-write re-verification via verify_no_symlink_escape() confirms after write.
  • Avoids path.exists() before canonicalize() to prevent race conditions.

The bash tool uses check_bash_paths() to validate path-like tokens and redirect targets in commands before execution.

Each tool exposes:

  • Name: Unique identifier
  • Description: What the tool does
  • Input schema: JSON Schema defining accepted parameters
  • Permission level: What permissions the tool requires

The LLM receives tool definitions at the start of a conversation and can invoke them by name with structured arguments.