Skip to content

Tools

Each agent has access to a set of tools that the LLM can invoke during its agentic loop. Tools are defined as OpenAI-compatible function calling schemas and executed server-side on the agent VM.

The list below documents the tools exposed by the current first-wave agent backend. Some clients may reserve names for upcoming compatibility tools, but if a tool is not listed here it is not available from this backend yet.

Execute a shell command and return stdout, stderr, and exit code.

ParameterTypeRequiredDescription
commandstringyesThe bash command to execute
timeoutintegernoTimeout in seconds (default 60, max 300)

Output is limited to 30,000 characters in chat. When a workspace is configured, oversized output is saved under workspace/tool-results/ and the tool returns a preview plus the saved path. Without a workspace, output falls back to in-band truncation. Commands that exceed the timeout are killed and return a timeout message.

Safety guards: Before execution, every command is checked against a set of deny patterns. Blocked commands return an error without being executed. See Security model below.

Read a file and return its contents with line numbers.

ParameterTypeRequiredDescription
pathstringyesAbsolute or workspace-relative path
offsetintegernoLine number to start from (1-based)
limitintegernoMaximum number of lines to read

Output format is <line_number>\t<content> per line, matching common editor conventions. Output is truncated at 30,000 characters.

Images (png, jpg, gif, webp, bmp) are returned visually to the model. PDFs should be read with read_pdf. Other binary files return metadata and inspection hints instead of raw binary content.

Read a PDF as extracted text or rendered page images.

ParameterTypeRequiredDescription
pathstringyesAbsolute or workspace-relative path
pagesstringnoPage selector such as "1", "1-3", or "2,5,8" (default "1")
modestringno"text" (default) or "image"

Text mode reads up to 20 selected pages. Image mode renders up to 3 selected pages for visual analysis of layout, diagrams, or tables.

Read up to 20 text files in one call.

ParameterTypeRequiredDescription
pathsarrayyesFile paths to read
offsetintegernoLine number to start from for every file
limitintegernoMaximum lines per file

This uses the same workspace boundary and read-hash tracking as read_file, so files read here can be safely edited later in the same turn.

Write content to a file, creating parent directories as needed.

ParameterTypeRequiredDescription
pathstringyesAbsolute or workspace-relative path
contentstringyesThe content to write

Find and replace an exact string in a text file.

ParameterTypeRequiredDescription
pathstringyesAbsolute or workspace-relative path
old_stringstringyesThe exact string to find
new_stringstringyesThe replacement string
replace_allbooleannoIf true, replace every occurrence. Defaults to false
expected_hashstringnoOptional SHA-256 hash the file must match before editing

Returns an error if old_string is not found in the file. By default the old string must appear exactly once; if it appears multiple times, pass replace_all: true to replace all occurrences. Binary files are rejected. If expected_hash is provided, the edit is refused unless the current file content matches that hash. Without expected_hash, the agent must have read the file earlier in the same turn and the file must still match the recorded read hash.

Apply multiple edit_file operations in order.

ParameterTypeRequiredDescription
editsarrayyesOrdered edits with path, old_string, new_string, optional replace_all, and optional expected_hash

Execution stops after the first failed edit. Each edit follows the same read-before-edit and stale-file guards as edit_file.

Apply a unified diff patch to files in the workspace.

ParameterTypeRequiredDescription
patchstringyesUnified diff text accepted by git apply

The patch is validated with git apply --check before it is applied. The tool is hidden when git is not installed.

Find files by filename pattern inside the workspace.

ParameterTypeRequiredDescription
patternstringyesGlob pattern such as "*.py" or "**/*.md"
pathstringnoDirectory to search within (defaults to workspace root)
limitintegernoMaximum results to return (default 100, max 500)

Results are sorted by modification time, newest first. Paths that escape the workspace are rejected. Dotfiles and dot-directories (.git, .env, etc.) are not matched by * or **/*; match them explicitly with patterns like .* or **/.git/**.

Search text files with ripgrep inside the workspace.

ParameterTypeRequiredDescription
patternstringyesSearch pattern passed to ripgrep
pathstringnoFile or directory to search (defaults to workspace root)
output_modestringnocontent, files_with_matches, or count
type_filterstringnoOptional ripgrep type filter, such as py, ts, or md
case_sensitivebooleannoIf false, run case-insensitive search
limitintegernoMaximum output lines to return (default 200, max 1000)

The tool is hidden from the model when rg is not installed.

Return git status --short --branch for the workspace repository.

Return a git diff for workspace changes.

ParameterTypeRequiredDescription
pathstringnoOptional path to limit the diff
stagedbooleannoIf true, show staged diff

Show a git object or commit.

ParameterTypeRequiredDescription
revstringnoRevision or object to show, default HEAD
pathstringnoOptional path to limit output

Show git blame for a file.

ParameterTypeRequiredDescription
pathstringyesFile to blame
startintegernoOptional starting line
endintegernoOptional ending line

run_tests, run_lint, run_typecheck, run_format

Section titled “run_tests, run_lint, run_typecheck, run_format”

Run verification or formatting commands in the workspace and return stdout, stderr, and exit code.

ParameterTypeRequiredDescription
commandstringyesCommand to run
timeoutintegernoTimeout in seconds (default 120, max 600)

These tools share the same command safety checks as bash. run_format is classified as mutating; the other verification wrappers are read-only but are also treated as shell tools for ask-before-shell policy mode.

List contents of a directory with type prefixes.

ParameterTypeRequiredDescription
pathstringnoDirectory path (defaults to workspace root)

Output format uses [dir] and [file] prefixes, sorted with directories first.

Fetch a URL and return its text content.

ParameterTypeRequiredDescription
urlstringyesURL to fetch (http or https)

HTML content is automatically stripped of tags and decoded. JSON responses are pretty-printed. Output is truncated at 50,000 characters. Requests follow up to 5 redirects and time out after 30 seconds.

Search past conversation history using full-text search. Useful for recalling what was discussed about a topic, finding details from previous conversations, or checking if something was mentioned before.

ParameterTypeRequiredDescription
querystringyesSearch query. Supports FTS5 syntax: words, "exact phrases", OR, NOT, prefix*
chat_idstringnoLimit search to a specific conversation
limitintegernoMaximum results to return (default 20, max 50)

Results include the matched message snippet, timestamp, role, and chat ID. Output is truncated at 30,000 characters.

Set summarize to true to ask the model to synthesize an answer from the matched history instead of returning raw snippets.

Store a compact typed memory record.

ParameterTypeRequiredDescription
kindstringyesCategory such as user_fact, repo_convention, test_command, or decision
contentstringyesDeclarative memory text, max 2,000 characters
sourcestringnoSource label, default agent
metadataobjectnoOptional structured metadata

Use this for stable facts that should remain useful later. Do not use it for temporary task progress or stale-by-next-week information.

Search typed memory records.

ParameterTypeRequiredDescription
querystringnoText to search for; empty lists recent records
kindstringnoOptional memory category filter
limitintegernoMaximum records to return (default 20, max 100)
include_archivedbooleannoWhether archived records should be returned

Search the web using LibertAI Search. Returns titles, URLs, and snippets.

ParameterTypeRequiredDescription
querystringyesThe search query
countintegernoNumber of results, 1-10 (default 5)

Requires a valid LIBERTAI_API_KEY. The search aggregates results from multiple engines (Google, Bing, DuckDuckGo). Failed engines are noted in the output.

Generate an image from a text prompt using LibertAI’s image generation API.

ParameterTypeRequiredDescription
promptstringyesText description of the image
sizestringnoDimensions as "WxH" (default "1024x1024", max 1024 per side, multiples of 16)
stepsintegernoGeneration steps (default 8 for speed, use 14 for higher quality or text readability)

The generated image is saved to workspace/images/<uuid>.png and automatically sent to the user.

Manage a structured task list stored in the workspace.

ParameterTypeRequiredDescription
actionstringyesOne of add, list, update, complete, delete
titlestringfor addTask title
idintegerfor update, complete, deleteTask ID
statusstringnoNew status for update
prioritystringnolow, medium, or high
notesstringnoAdditional task notes

Execute a Python script that can call agent tools programmatically without adding each intermediate tool result to the conversation context.

ParameterTypeRequiredDescription
codestringyesPython code to execute
timeoutintegernoTimeout in seconds (default 120, max 300)

The script receives a call_tool(name, **kwargs) helper for invoking tools such as bash, read_file, write_file, edit_file, list_dir, web_fetch, and web_search. Printed stdout is returned and truncated at 30,000 characters.

Create, list, restore, or diff lightweight git checkpoints for the workspace.

ParameterTypeRequiredDescription
actionstringyesOne of create, list, restore, diff
messagestringfor createCheckpoint message
idstringfor restore, diffCheckpoint ID/SHA

Manage long-running background processes.

ParameterTypeRequiredDescription
actionstringyesOne of start, list, poll, kill
commandstringfor startShell command to start
idstringfor poll, killProcess ID

Process output is buffered and cleared after each poll. The buffer keeps the latest 10 KB of combined stdout/stderr.

Send a file from the workspace to the user.

ParameterTypeRequiredDescription
pathstringyesPath to the file (relative to workspace or absolute within workspace)
captionstringnoOptional caption

Files are validated against the workspace boundary and sensitive file list. Maximum file size is 50 MB.

Spawn a background subagent to work on a task asynchronously. Not available to subagents (prevents recursive spawning).

ParameterTypeRequiredDescription
taskstringyesTask description for the subagent
labelstringnoShort label for the task (defaults to first 50 chars of task)
rolestringnoTyped role: default, explorer, worker, reviewer, verifier, or researcher
personastringnoSystem prompt override for the subagent
timeoutintegernoWall-clock timeout in seconds (default 300, max 600)

Subagents run with a restricted tool set (no further spawning) and a maximum of 45 tool iterations. Results are delivered as pending messages. Up to 5 subagents can run concurrently per chat. The typed role adds built-in guidance for common delegation patterns; persona remains available for extra task-specific instructions.

All file operations (read_file, read_many_files, write_file, edit_file, multi_edit, apply_patch, list_dir, send_file) enforce a strict workspace boundary. Paths are resolved against the workspace root and checked after symlink resolution. Any path that escapes the workspace directory is rejected with a PathSecurityError.

Tool execution also separates read-only and mutating tools. Read-only calls from the same model response may run in parallel; mutating tools such as bash, apply_patch, write_file, edit_file, multi_edit, todo, checkpoint, process, run_format, and execute_code are serialized in model-specified order.

Relative paths are treated as relative to the workspace. Absolute paths must still fall within the workspace boundary.

Certain filenames are blocked from being read or served, even within the workspace:

  • .env — Contains secrets and API keys
  • agent.db, agent.db-shm, agent.db-wal — Internal SQLite database files

The bash tool checks every command against a set of regex deny patterns before execution. Matching commands are blocked immediately. The patterns prevent:

Destructive system commands:

  • rm -rf / or rm -rf ~ — Recursive deletion of root or home
  • mkfs, format, diskpart — Disk formatting
  • dd if= — Raw disk writes
  • > /dev/sd* — Writing to block devices
  • shutdown, reboot, poweroff, halt — System shutdown
  • Fork bombs (:(){ ... };:)
  • systemctl stop baal-agent — Stopping the agent service
  • kill -9 1 — Killing PID 1

Secret exfiltration:

  • env, printenv, set — Environment variable dumps
  • export -p, declare -x — Export listing
  • /proc/*/environ — Process environment files
  • Any .env file access
  • /run/secrets — Container secrets
  • Tool output: 30,000 characters in chat; oversized output is saved to tool-results/ when possible
  • Web content: 50,000 characters
  • File uploads/sends: 50 MB

Some tools are advertised only when their runtime dependencies are available. For example, web_search and generate_image require LIBERTAI_API_KEY, grep requires rg, and the git tools require git. The /info endpoint reports hidden tools and reasons in unavailable_tools.

Oversized tool output returns a saved path in-band, not a separate artifact event yet. Clients should render the preview text normally and may link the path through existing file download APIs.