Repository navigation
feat(agent-tools): the built-in agent tools - files, the web and a clock (RFC-0013 step 1) - #63
Merged
Merged
Conversation
…e, the web inside an allowlist, a clock (RFC-0013 step 1) extensions/agent-tools/agent_tools.py serves seven composable functions an agent loop names in its tool catalog: file.read, file.write (write: true, create the default), file.list and file.search inside tools.file.root; web.fetch and web.crawl inside tools.web.allow, with private address ranges refused, the resolved address pinned, every redirect checked, the body and the text capped, HTML reduced to readable text or Markdown by a small in-house parser, a bounded same-host crawl honouring robots.txt; and time.now. A tool whose sandbox is not configured does not register; every refusal is a 400 naming the rule. Each tool ships its catalog row as a constant, as a file under catalog/ and through `describe`. tools.health reports the routes and the sandboxes. 98 tests on a temporary workspace and an in-process fixture site. Also: a direct `python mcp_binding.py` now attaches the binding's boot hook (it connected no server before). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Nov 17, 2026
… extension) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new pack extension,
extensions/agent-tools/, with the essential built-in tools an agent loop names in its tool catalog (RFC-0013 in mercury-composable, build plan step 1):tools.file.root):file.read,file.write(write: true,createthe default and refusing an existing file),file.list,file.search. Every path is relative to the root, resolved with symbolic links followed and refused outside it; hidden entries are invisible unlesstools.file.hidden=true.tools.web.allow):web.fetch(text, Markdown or raw) andweb.crawl(same host, breadth-first,robots.txt, bounded by pages, depth, an include prefix and a delay). https unless a host is listed withhttp://; the host is resolved and every address checked against the loopback, private, link-local and multicast ranges before the request goes to the checked address; every redirect is checked again; the body stops attools.web.max.bytes. HTML is reduced to readable text by a small in-house parser (no dependency).time.now, registered unlesstools.time=false.A tool whose sandbox is not configured does not register, so it is a 404 to the loop's pre-flight check; every refusal is a 400 naming the rule and the key, which the loop returns to the model as the call's error. Each tool ships its catalog row - the name, the description the model reads, the closed input schema, the route and the write mark - as a constant, as a file under
extensions/agent-tools/catalog/(to be shared byte for byte with the Node.js twin) and throughpython agent_tools.py describe, which also says what registers under the current configuration.tools.healthreports the routes, the workspace and the allowed sites. README,resources/application.yml, CHANGELOG, and 98 tests (tests/test_agent_tools.py: a temporary workspace with an escaping link, the allowlist and address rules without a network, a fixture site served in-process with redirects to private and foreign hosts, a slow page, a large body and two charsets, the boot,describeand the catalog files).Also fixed in passing: a direct
python extensions/mcp-binding/mcp_binding.pynever attached the binding's boot hook, so no server connected and every bound route was a 503; both entry points attach it now.Why
Every agent use case built so far needed tools that were not about the use case - read the file the person pointed at, write a note, fetch a page - and each graph repeated the same security decisions. RFC-0013 (settled by Eric's rulings R1-R16 on 2026-11-17) puts them in one pack extension beside the LLM helper, with the sandbox as deployment configuration certified with the deployment, never an argument of a call, and the rows published so an author copies one onto the graph. Python first; the knowledge-graph tools and
file.extractare step 2, the Node.js twin step 3, the Playground graphs and the recipes steps 4 and 5.Verification
uvx ruff check .,basedpyright: clean.pytest -q: 536 passed, 65 skipped (the live tests gated).mercury-serve: a read, a refusal, the clock, a disallowed site over the wire, and one real https fetch of a public documentation page through the pinned-address path (200, title extracted).🤖 Generated with Claude Code
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com