Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iii-hq/agentos/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Tools module provides core tool implementations for file operations, shell execution, web fetching, web search, and agent-to-agent communication. All tools include automatic metrics collection and security enforcement.File Operations
tool::file_read
Read file contents with path containment security checks.File path relative to WORKSPACE_ROOT
Optional maximum bytes to read (for limiting large files)
assertPathContained() to prevent directory traversal attacks.
tool::file_write
Write content to a file with path containment security.File path relative to WORKSPACE_ROOT
Content to write to the file
tool::file_list
List directory contents with file metadata.Directory path relative to WORKSPACE_ROOT
Whether to recursively list subdirectories (not fully implemented)
tool::apply_patch
Apply a unified diff patch to a file.File path to apply the patch to
Unified diff format patch content
Shell Execution
tool::shell_exec
Execute commands with sandboxing and allowlist enforcement. No shell interpretation - direct binary execution only.Command array [binary, …args] - first element must be in SHELL_COMMAND_ALLOWLIST
Working directory relative to WORKSPACE_ROOT
Execution timeout in milliseconds (default: 120000)
Allowed Commands
- Only allowlisted binaries can be executed
- No shell interpretation (prevents injection)
- Environment variables filtered through
TAINT_ENV_ALLOWLIST - Path containment enforced on working directory
- Output size limits prevent memory exhaustion
- Execution logged to security audit
Web Access
tool::web_fetch
SSRF-protected HTTP fetch with automatic HTML-to-text conversion.URL to fetch (validated against SSRF attacks)
Maximum response size in bytes (default: 500000)
assertNoSsrf() to prevent requests to internal IP ranges.
tool::web_search
Multi-provider web search supporting Tavily, Brave, and DuckDuckGo.Search query string
Search provider: “tavily”, “brave”, or fallback to “duckduckgo”
Maximum number of results (default: 5)
- Tavily: Requires
TAVILY_API_KEYenvironment variable - Brave: Requires
BRAVE_API_KEYenvironment variable - DuckDuckGo: No API key required (default fallback)
Agent Communication
tool::agent_spawn
Spawn a sub-agent with depth limits and resource quotas.Template identifier for the sub-agent type
Parent agent ID for tracking hierarchy
Initial message to send to the spawned agent
- MAX_AGENT_DEPTH: 5 - Maximum nesting depth
- DEFAULT_MAX_SUB_AGENTS: 20 - Default quota per parent
tool::agent_send
Send a message to another agent with spam prevention.Sending agent’s ID
Receiving agent’s ID
Message content (max 100KB)
- MESSAGE_MAX_BYTES: 100KB - Maximum message size
- MESSAGE_QUEUE_MAX: 1000 - Maximum queue depth per agent
- AGENT_PAIR_RATE_LIMIT: 10 messages per minute between any agent pair
Metrics Wrapper
All tools automatically use thewithToolMetrics() wrapper which records:
tool_execution_total- Execution count by status (success/failure)function_call_duration_ms- Execution duration histogram
tools.ts:27