agnt-tools
Built-in sandboxed tools for the agnt agent runtime.
Ships seven default tools that implement agnt_core::Tool, plus one
opt-in CVE-class tool behind a cargo feature flag.
[]
= "0.2"
# Opt in to the Shell tool (default off for security reasons):
# agnt-tools = { version = "0.2", features = ["shell"] }
When to depend on this
Most users should cargo add agnt — the flagship crate re-exports this
one under the tools feature.
Depend directly on agnt-tools when you want the built-in tools without
pulling in the full Agent loop — for example, when embedding the tools
into a larger agent framework of your own.
What it provides
Default tools
ReadFile— read a UTF-8 file with optionalFilesystemRootsandboxWriteFile— write a file, sandboxedEditFile— atomic edit via sidecar lockfile + temp-renameListDir— directory listing, sandboxedGlob— shell-style glob patterns, sandboxedGrep— ripgrep-style regex search viawalkdir, sandboxedFetch— HTTP GET with SSRF guard, host allowlist, byte capFilesystemRoot— the sandbox type all filesystem tools accept
Opt-in (CVE-class)
Shell(shellfeature) — arbitrary command execution with an explicit argv allowlist, token-level metacharacter rejection, directCommand::new(argv[0])spawn (neversh -c). Default-off. Requires an explicitShell::new_sandboxed(allowed_argv0, cwd)constructor call.
Security
The entire security story of agnt-tools lives in the
threat model.
Summary:
- Filesystem tools use
FilesystemRootfor symlink-aware containment checks. Without a sandbox the tool is explicitly documented as full-host. Fetchblocks loopback / private / link-local / AWS IMDS / GCP metadata (IPv4 and IPv6) atomically with DNS resolution via the customssrf::SsrfResolverinstalled on a per-instanceureq::Agent. v0.3.1 closed the two-phase TOCTOU that v0.2/v0.3 had — ureq no longer performs a second DNS lookup after validation. Redirects are disabled.EditFileis race-free via an exclusive sidecar lockfile.Shellhas no unsafe constructor — the caller must explicitly opt in to both the cargo feature AND provide an argv allowlist. On Linux thebwrap-shellfeature adds a bubblewrap namespace wrapper on top.
License
Dual-licensed under MIT OR Apache-2.0.