Expand description
§aidaemon-tools (experimental)
A small default tool set for aidaemon_core agents, built on lessons
from agent-computer interfaces (SWE-agent, Claude Code, Aider): few
non-overlapping tools, bounded output, actionable errors, and validation
before mutation.
| Tool | Name | Annotations |
|---|---|---|
ReadFile | read_file | read-only |
WriteFile | write_file | write (idempotent) |
EditFile | edit_file | write |
Glob | glob | read-only |
Grep | grep | read-only |
Shell | shell | destructive |
WebFetch | web_fetch | read-only |
Checklist | track_requirements | write (agent state only) |
Every file tool is confined to a Workspace. The shell runs through a
Sandbox; containment (sandboxing) lives there, while approval
stays a policy concern for aidaemon_core::Hooks. No tool contains
approval logic.
use aidaemon_tools::{default_tools, Checklist, Workspace};
let workspace = Workspace::new("./my-project")?;
let (checklist, gate) = Checklist::with_gate();
let mut builder = aidaemon_core::Agent::builder("coder").allow_unguarded()
.model("some-model")
.provider(provider)
.tool(checklist)
.hook(gate);
for tool in default_tools(workspace) {
builder = builder.tool_arc(tool);
}
let agent = builder.build()?;Re-exports§
pub use backend::BackendDirEntry;pub use backend::BackendFileType;pub use backend::BackendKind;pub use backend::BackendMetadata;pub use backend::BackendPath;pub use backend::CommandSpec;pub use backend::ExecutionBackend;pub use backend::ExecutionOutput;pub use backend::ExecutionRequest;pub use backend::LexicalPaths;pub use backend::ProcessHandle;pub use backend::SpawnedProcess;pub use backend::WriteMode;pub use backend::shell_quote;pub use outcome::CallValidator;pub use outcome::KernelAdapter;pub use outcome::NothingSentError;pub use outcome::OutcomeRunner;pub use outcome::OutcomeTool;pub use outcome::TargetNotFound;pub use outcome::ToolTimedOut;pub use outcome::failed_without_effect;pub use outcome::timed_out;pub use path_class::PathClassifier;pub use web::NetworkGuard;pub use web::WebFetch;
Modules§
- backend
- The workspace execution contract: one persistent agent-visible workspace
whose files and processes a tool reaches through an
ExecutionBackend. - background_
deliverable - Typed background artifact attribution.
- backoff
- Retry delays.
- check_
environment - cli_
agent_ flags - The terminal agents’ (codex, claude, gemini, opencode) launch flags: their
names, defaults kept in the settings store, and flags discovered from
--help. - command_
effects - Structural typing of a shell command’s effects for authority decisions.
- command_
risk - config_
file - The host’s config file, as the tools that edit it see it: where it is,
how a new text is checked before it is written, and the backups kept
beside it. The host owns what a valid config is (
ConfigCheck); the tools only read, change and save the TOML. - daemon_
guard - duration_
format - Compact durations for messages to the owner (
45s,3m 10s,2h). - execution
- Workspace-bound execution backends: where agent-visible files and
processes live. The local backend is
LocalBackend; this module adds the SSH backend and, behind thedockerfeature, a persistent Docker container, plus the[execution]settings that pick one. - file_
delivery - fs_
utils - http_
request - internal_
markers - The daemon’s own markers, rendered for the owner.
- local_
backend - The host’s own filesystem and processes as an
ExecutionBackend. - local_
sites - Sites on this computer that the owner’s own work brought up.
- outcome
- Tools that report a typed
ToolCallOutcome. - owner_
answers - Owner approvals the agent kernel delivered for exact call subjects.
- path_
class - Which paths hold secrets or must not be touched by the file tools.
- permission_
bypass - Launch arguments that switch a CLI coding agent (claude, codex, gemini, copilot, aider) into unattended auto-approve mode, and their removal. The single list for every place that launches an agent.
- platform_
shell - The shell a command line runs in:
sh -con Unix, Windows PowerShell on Windows (always present, unlikesh). The command-effect checks are written for POSIX shells and fail closed: a PowerShell line they cannot read as a known observation or local work is treated as unknown, so it asks first. - process_
control - result_
spill - Spill oversized tool results to disk so the model can recover the full data via read_file paging / terminal jq/grep, instead of losing the middle to in-context head+tail compression. The on-disk file is the full, untruncated result; the returned preview is a bounded head + structural summary + an anti-fabrication pointer to the file.
- sanitize
- Input sanitization for external content (tool outputs, web fetches).
- semantics
- The semantic half of a daemon tool: plain data that describes a call without executing it (capabilities, typed call semantics, access manifests, receipt metadata, execution facts) and the helpers that derive the conservative defaults.
- services
- Narrow store services that tools hold: settings, OAuth connections and
runtime-managed CLI agents,
plus the plain data those traits carry. The daemon’s SQLite store
implements them; a tool receives an
Arc<dyn ...>of the slice it needs through its constructor. Memory stores (facts, episodes, history, people) live inaidaemon-memory. - shown
- A tool call as the owner’s apps show it: its arguments and its result, secrets redacted and trimmed. One shape for a call seen live and the same call read back from history, so a step says as much either way.
- status
- Live progress of a turn: what tools and the agent loop report while they work, and the channel a tool call’s progress goes to.
- stt_
setup - Shared Whisper STT discovery and config helpers for wizard and manage_config.
- system
- text
- Text helpers shared by tools and event payloads.
- tls
- TLS for the sockets reqwest does not open (websockets, IMAP).
- web
web_fetch: GET a page and return its readable text.- web_
search
Structs§
- Bubblewrap
Sandbox - Linux sandbox using
bwrap: the host filesystem is mounted read-only, the workspace read-write,/tmpis a private tmpfs, PID and (unless allowed) network namespaces are unshared, and the sandbox dies with its parent. The credential locations inHOME_SECRET_PATHSare hidden by default. - Bubblewrap
Scope - What a task-scoped bubblewrap sandbox may touch: deny by default, unlike
BubblewrapSandbox::args(which mounts the whole host read-only). The command sees the base system directories (the dynamic loader,/usr,/bin,/lib), a private/dev,/procand/tmp, and exactly the listed paths:read_pathsread-only,write_pathsread-write. Withallow_networkit also sees the resolver and CA configuration it needs to use the network. Listed paths that do not exist are skipped. - Checklist
- The
track_requirementstool. Each call replaces the whole list, so the model always states the full current plan. - Checklist
Gate - Stop hook: while any item is pending or in progress, ask the model to
keep going, listing them. Once nothing is open it lets the run stop; if
any item is deferred (or superseded by one that is), it reports those as
unmet (
StopDecision::AcceptUnmet) so the run is not counted as a success. The agent’s turn limits still bound how long this can continue. - Checklist
Item - Checklist
State - Shared checklist state. Clone it to share between the tool, the gate and your own code. Use one per run or session.
- Command
Output - What a command did.
- Docker
Sandbox - Runs each command in a fresh container: the workspace is mounted at
/workspace,--network noneunless allowed, and the container is removed afterwards (and killed on timeout). No other host path is mounted, so host paths inSandboxCommand::deny_readare out of reach already; denied paths inside the workspace are covered by an empty mount. On Unix the container runs as the calling user so files it creates stay editable. - Edit
File - Glob
- Find files by glob pattern, respecting
.gitignore. - Grep
- Search file contents with a regular expression.
- Host
File Policy - The policy for file tools on the host’s own filesystem: secret and
sensitive paths (and the application’s own files) by
DaemonPaths, images as attachments, backups before an overwrite, a syntax check after a write, and the effects of a write (git configuration among them). - Host
File Policy Settings - What a
HostFilePolicysays and keeps, as the application words it. - Local
Sandbox - Runs commands directly on the host with
sh -c. - Protected
Path Guard - Refuses a call whose declared paths hold secrets or must not be changed.
- Read
File - Sandbox
Command - One command to run.
- Sandbox
Selection - The result of
select_sandbox. - Search
Files - Seatbelt
Sandbox - macOS sandbox using
sandbox-execwith a generated profile: everything is readable except the credential locations inHOME_SECRET_PATHS(by default) and each command’s deny list, writes are allowed only under the workspace (plus the/devnull/tty nodes), and the network is denied unless allowed. - Shell
- Run shell commands in the workspace.
- Tool
Text - A tool’s model-facing descriptions, for an application that words them for its own tool set.
- Workspace
- A root directory that confines every path argument a tool receives.
- Workspace
Backend - File access confined to a
Workspace. Every operation re-resolves its path, so a symlink cannot lead outside the root. It runs no processes; commands go throughcrate::Shelland its sandbox. - Workspace
File Policy - The policy for tools confined to a
Workspace. - Write
File
Enums§
- Exec
Error - The command could not be started (as opposed to starting and failing).
- Item
Status - Where an item stands. The model sets
pending,in_progress,done,deferredandsuperseded; only the application setswaived(ChecklistState::waive), because only the owner can drop scope. - Path
Error - Why a path argument was refused.
- Sandbox
Kind - The backends the default shell can choose between.
- Terminal
Confinement - Where
terminalcommands execute.
Constants§
- DEFAULT_
ENV_ ALLOWLIST - Host variables passed through by default.
- DEFAULT_
IGNORE_ DIRS - Directories to skip during recursive file walks.
- HOME_
SECRET_ PATHS - Credential locations under the home directory that the contained
backends (
BubblewrapSandbox,SeatbeltSandbox) keep commands from reading by default: SSH keys, cloud and cluster credentials, GnuPG, registry logins,.netrcand git’s stored credentials. Replace the list per backend withdefault_deny_read(..)(an empty list turns the defaults off). - MAX_
READ_ CHARS - Per-call cap on returned content (bytes of line text). Reads that would exceed it return the first lines that fit plus a continuation hint instead of an unbounded payload.
- SANDBOX_
ENV - Environment variable that overrides the default shell’s backend:
auto(or unset),bubblewrap,seatbelt, orlocal(no containment).
Traits§
- File
Policy - What an application decides about the file tools.
- Sandbox
- Where commands run.
Functions§
- best_
available_ sandbox - The default shell’s backend: the one named by
SANDBOX_ENV, else the most contained one available here (bubblewrap on Linux, seatbelt on macOS), elseLocalSandbox(uncontained) with a one-time warning. Docker is never picked automatically because it needs an image choice. - default_
deny_ read HOME_SECRET_PATHSunder$HOME(empty whenHOMEis unset): the contained backends’ default deny-read list.- default_
tools - The standard set:
read_file,write_file,edit_file,glob,grep,shell(withbest_available_sandbox: bubblewrap on Linux, seatbelt on macOS) andweb_fetch. - default_
tools_ with_ sandbox default_toolswith the shell on an explicit backend, for exampleSandboxKind::Local.backend()to run commands on the host on purpose.- format_
with_ line_ numbers - Format file content with line numbers.
- home_
secret_ paths HOME_SECRET_PATHSunderhome.- render_
read_ file_ output - render_
read_ file_ output_ within - Render a read result within a character budget, cutting on line boundaries and appending an explicit continuation hint when lines had to be dropped. Results that fit are rendered unchanged, so big-budget models see exactly what they do today.
- sandbox_
preference_ from_ env - Read
SANDBOX_ENV:Ok(None)for unset, empty orauto. - select_
sandbox - Pick a backend. An explicit
preferencealways wins (an unavailable one then fails each command withExecError::Unavailablerather than running uncontained). Otherwise the first available of bubblewrap and seatbelt, elseSandboxKind::Localwithfell_backset.availableis the probe, injectable for tests. - sniff_
image_ mime - The MIME type of an image, from its magic bytes.