Skip to content

Standard toolkit

The built-in file tools let the model read, search, and change files under the workspace root. They belong to one toolkit pack and share path checks. Content search and filename search use one FileFinder index; reads, directory listings, and mutations use the host’s JavaScript path handling.

Shell, web, and MCP tools are registered separately. The distinction is about which host supplies the operation, not a way to bypass its permission checks. Composing tools shows how a program can combine these operations.


Tool Class Obligation
read_file read UTF-8 file under project root
list_dir read Directory listing under project root
grep read Indexed content search (plain / regex / fuzzy) under project root
glob read Exact glob enumeration under project root (same index as grep/fff_search)
fff_search read Fuzzy filename search under project root (same index)
write_file write Create, or replace contents in place (O_TRUNC, same inode). Existing path requires overwriteExisting; omit/false is a door that names the flag. Host stores prior UTF-8 text on FileMutateToolJob.priorContent (null if binary, too large, or missing) for the tape Diff. Tape/cover: create vs update from admit existed. existed / priorContent are host-injected, not model arguments
edit_file write Exact-string replace
plan_edits read Prepare an ordered list of exact-text edits into one version-1 file-edit plan. Does not write. Same-file edits compose in memory. A failed edit returns no plan
apply_edits write Apply one version-1 plan to existing regular UTF-8 files. Every target is licensed. Stale bases write nothing. Per-file atomic replacement, not a multi-file transaction. The receipt partitions committed and notWritten

Laws of the set

  • Paths resolve under the session workspace root (lexical + realpath containment). glob / fff_search take cwd. cwd is a directory under that root. The default is the project. An absolute path under the project is the project.
  • write / effect do not freestyle past approval. write_file / edit_file admit as FileMutateToolJob (is-a SystemToolJob). Other native mutators admit as SystemToolJob. ToolCallJob is-a ApprovableJob. Sole home: ../runtime/approval.md. Catalog class is read | write | effect | meta.
  • Denial is a sealed tool outcome the model can read. Denial is not a transport failure.
  • glob enumerates exact path patterns. fff_search is fuzzy name-search. grep’s glob argument only constrains which files content-search opens.
  • glob / fff_search / grep share one FileFinder per workspace root. They are not a second JS walker.
  • No shell / process spawn in this set. shell is a separately registered host tool (effect).

Explicit non-members

Surface Where it lives instead
Bash / run / process Host-registered shell — ordinary catalog row; permission is not workspace auto
Web search Host-registered web_search (effect) — intern PEW on a web-search connection; not FS
Web extract Host-registered web_extract (effect) — intern PEW on a web-extract connection; not FS. Pin KV web-extract-connection is independent of search.
Session-list label Host-registered update_metadata (meta) — side-channel; not FS, not approval, not ReACT-alone
Context expectation Host-registered context_need (meta) — side-channel; operands only; host owns compact
MCP / third-party tools Catalog expand(connection) and optional packs
Slash / internal commands Named actions via the action door — shell builtins, not model tools
Autonomous bot-call tools Pack JSON tools (memory providers and others); not Scheme symbols, not FS

plan_edits returns a file-edit plan. A structural producer such as sg_plan returns that same kind of value. The plan is version 1. It carries the workspace binding. Each file entry carries the path, the SHA-256 baseDigest, and afterText. The plan is not approval. It is not a stored handle. It is not a write. Scheme may inspect a plan. Scheme may union plans that do not share a path. Two plans that touch the same file do not merge.

In Scheme, a successful plan producer exposes job_id for its existing tool job. The default reading shows the manifest and a bounded preview. It does not show the file body. Retrieve the complete value across evaluations with (tool/result "the-returned-job-id"). Inspect the plan with (dict-ref (tool/result "the-returned-job-id") 'plan). Pass that same plan to apply_edits. Lookup reads the session’s retained job outcome. It is not a second plan store. Lookup fails when the job is missing or unfinished. The ordinary version-1 plan reaches policy. The job id grants no approval.

The exact-text preview counts input operations separately from matched occurrences. Each displayed occurrence includes an operation number and a line in that operation’s input. Those numbers are not final-file diff coordinates. preview.truncated means snippets were clipped to 120 code points, or occurrences were omitted past the 20-entry bound. That flag says nothing about completeness of the retained plan.

Before approving a plan, inspect the complete files[*].afterText, or a diff against the verified original snapshot. The ask pin is bounded. Its displayed head and short fingerprint do not make hidden replacement text reviewable. Inspect the original plan value. Do not reconstruct a plan from a truncated preview.

apply_edits is the write leaf. Policy sees every target. BODY checks every base before the first replacement. A stale base, a blocked target, or a failure before publication leaves every target unchanged. A failure after the first replacement is partial. The receipt names what committed and what did not. Cancellation and I/O errors use that same partition.

An interrupted process with no sealed receipt is unknown. Recovery does not replay the apply. Recovery must not describe that absence as not_written. Locks cover cooperating toolkit writers only. Successive renames are visible to other readers. The apply is not a workspace transaction.

write_file stays an in-place overwrite with its explicit overwrite gate. edit_file stays the exact-match single-file verb, with its existing prior-content tape facts. Both already share cooperating path locks with apply_edits. Their publication semantics stay as they are. They are not converted to batch renames. A new structural mutation workflow uses sg_plan, then apply_edits. Legacy sg_rewrite apply is deprecated for new workflows. It remains available with its preview and expect_fingerprint contract during the compatibility transition. Its private publisher is not coordinated by the builtin-tools locks. No legacy tool invokes the public apply leaf in secret. No duplicate publisher is removed without a tested replacement.

Disconnect is not one behavior. Graceful SDK client disposal withdraws its seat. Losing the last seat parks a conversational session, so an in-flight apply can seal a known partial partition. A session with agent.spec.daemon stays eligible and can finish. A dead daemon with no sealed receipt recovers as unknown. The client-disposal tests do not establish behavior for every abrupt transport failure.

The model can call a tool directly or submit a program that combines several calls. Composing tools explains why this avoids unnecessary model round trips and how dependent results are evaluated.

The model-facing JSON tools[] list is a view of the catalog, not the catalog itself. It includes the direct write and shell verbs, scheme_repl, scheme_watch, metadata and context tools, and autonomous pack bot-call tools.

Scheme bindings expose file reads and searches, web search and extract, mcp/call, pack tool symbols, and agent communication. The scheme_repl description is generated from the live bound signatures and tool descriptions. Host memory tools such as tingle and offload remain autonomous JSON tools, not Scheme symbols or named-worker wrappers.

Admitting scheme_repl creates a bare ProgrammaticJob. CLI eval puts the same kind of bag directly on the turn queue. The bag organizes execution; it is neither PEW nor an approvable tool leaf. Its inner requests are ordinary ToolCallJobs with their own authorization.

agent/ask, agent/send, and their agent/one-shot/* forms admit an AgentCallJob. A named spec identifies a recipe, not a separate catalog tool. The kernel creates an inbound turn in the worker’s session and registers the response callback. Agents and delegation explains the separate histories, tool ceilings, and permission delegation.

Named asks and sends reuse their scoped worker. One-shot forms create an AskAgentSpec snapshot without adding the worker to the reusable roster. An omitted-spec ask also creates an anonymous one-shot worker; it does not inherit the caller’s full tools by default. One-shot lifetime is not a promise to delete the stored document.

An ask requires a response (voidLegal is false). A send waits for a response or completion without one (voidLegal is true). Workers respond through the agent__respond JSON tool, not a Scheme agent/respond call. agent/void permits a send to end without a response. agent/notify sends progress without completing the request, and agent/message delivers input without waiting for a reply. Response schemas apply to anonymous or named one-shot asks; reused named asks reject them.

A watch’s period is the same program bag’s clock, expressed as "N minutes", "N hours", or "N days". It re-evaluates expr; it does not create a sibling Job. The expression must reach (meta-reactivity/done-condition …). Idle time between ticks does not count against a tick’s timeout or inner-call ceiling.

background is a mint argument or a later Job write. It releases the parent turn’s join after orchestration, but does not remove the program or its inner calls from the work graph. It also does not stop the evaluator joining dependent results inside the bag.

self/notify sends an update without settling the request. In a background program, notification history belongs to its origin bag; in a worker request, it is attached to the enclosing Call.


Tool-calls are ToolCallJob (is-a ApprovableJob). Policy always runs. A human may write approved. The leaf execute runs BODY after an allow-side guard. The Actor does not consider UAC. Sole home: ../runtime/approval.md.


Doc Link
Grain grain.md
Crossings on PEW/Work proposals.md
Approval ../runtime/approval.md
Session product kinds packages/harness-model/src/session/
Toolkit packages/harness-builtin-tools/src/toolkit/

Based on docs/canon/standard-toolkit.md in the Harness repository. If this page and that file disagree about file-tool rules, the source file wins. The worker-response and schema distinctions follow the current Scheme bindings and worker-call implementation; agent/respond is not a callable Scheme binding.