The Open Framework for Building Agents
Make glob and grep tools opt-in (#2186)
Casey Gowrie4c1bd808b19e
diff --git a/.changeset/tidy-tools-opt-in.md b/.changeset/tidy-tools-opt-in.mdnew file mode 100644index 000000000..fbe629ed6--- /dev/null+++ b/.changeset/tidy-tools-opt-in.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Remove `glob` and `grep` from the default agent tool set. Agents can opt into either sandbox search tool by exporting `defineGlobTool()` or `defineGrepTool()` from the corresponding tool file.diff --git a/apps/docs/lib/geistdocs/llms-index.ts b/apps/docs/lib/geistdocs/llms-index.tsindex 4a82cd53c..f0cfa1002 100644--- a/apps/docs/lib/geistdocs/llms-index.ts+++ b/apps/docs/lib/geistdocs/llms-index.ts@@ -18,7 +18,8 @@ Documentation links below point directly to Markdown. Remove the \`.md\` suffix- [Execution Model and Durability](${EVE_ORIGIN}/docs/concepts/execution-model-and-durability.md): Understand sessions, checkpointed steps, and parked work.- [Sessions, Runs, and Streaming](${EVE_ORIGIN}/docs/concepts/sessions-runs-and-streaming.md): Understand session IDs, NDJSON events, controls, and reconnecting.-- [Default Harness](${EVE_ORIGIN}/docs/concepts/default-harness.md): Understand the built-in loop, tools, workspace, and context assembly.+- [Default Harness](${EVE_ORIGIN}/docs/concepts/default-harness.md): Understand model context and compaction in the built-in loop.+- [Built-in Tools](${EVE_ORIGIN}/docs/concepts/built-in-tools.md): Review default tools and add opt-in tools such as Workflow, glob, grep, and sleep.- [Context Control](${EVE_ORIGIN}/docs/concepts/context-control.md): Choose what the model sees and when.- [Security Model](${EVE_ORIGIN}/docs/concepts/security-model.md): Review trust boundaries, secret handling, credentials, and fail-closed behavior.@@ -39,7 +40,6 @@ Documentation links below point directly to Markdown. Remove the \`.md\` suffix- [Schedules](${EVE_ORIGIN}/docs/schedules.md): Run prompts or handlers on a cron cadence.- [Hooks](${EVE_ORIGIN}/docs/guides/hooks.md): Subscribe to runtime stream events.- [Dynamic Capabilities](${EVE_ORIGIN}/docs/guides/dynamic-capabilities.md): Resolve models, tools, skills, subagents, and instructions at runtime.-- [Workflow Tool](${EVE_ORIGIN}/docs/subagents/workflow-tool.md): Let the model orchestrate subagents through the experimental Workflow tool.## Integratediff --git a/apps/docs/lib/geistdocs/redirects.test.ts b/apps/docs/lib/geistdocs/redirects.test.tsindex 225b20cd5..b6aea7a7b 100644--- a/apps/docs/lib/geistdocs/redirects.test.ts+++ b/apps/docs/lib/geistdocs/redirects.test.ts@@ -115,8 +115,10 @@ describe("docsRedirects", () => {["/docs/reference/project-layout.md", "/docs/getting-started.md"],["/docs/dynamic-capabilities", "/docs/guides/dynamic-capabilities"],["/docs/guides/state", "/docs/concepts/state"],- ["/docs/dynamic-workflows", "/docs/subagents/workflow-tool"],- ["/docs/guides/dynamic-workflows", "/docs/subagents/workflow-tool"],+ ["/docs/dynamic-workflows", "/docs/concepts/built-in-tools"],+ ["/docs/guides/dynamic-workflows", "/docs/concepts/built-in-tools"],+ ["/docs/subagents/workflow-tool", "/docs/concepts/built-in-tools"],+ ["/docs/subagents/workflow-tool.md", "/docs/concepts/built-in-tools.md"],["/docs/sessions", "/docs/concepts/sessions-runs-and-streaming"],["/docs/agent", "/docs/agent-config"],["/docs/guides/acp", "/docs/protocols/acp"],diff --git a/apps/docs/lib/geistdocs/redirects.ts b/apps/docs/lib/geistdocs/redirects.tsindex 05099d88e..5aeaf3db6 100644--- a/apps/docs/lib/geistdocs/redirects.ts+++ b/apps/docs/lib/geistdocs/redirects.ts@@ -55,8 +55,9 @@ export const docsRedirects: DocsRedirect[] = [...createDocsRedirects("/reference/project-layout", "/getting-started"),...createDocsRedirects("/dynamic-capabilities", "/guides/dynamic-capabilities"),...createDocsRedirects("/guides/state", "/concepts/state"),- ...createDocsRedirects("/dynamic-workflows", "/subagents/workflow-tool"),- ...createDocsRedirects("/guides/dynamic-workflows", "/subagents/workflow-tool"),+ ...createDocsRedirects("/dynamic-workflows", "/concepts/built-in-tools"),+ ...createDocsRedirects("/guides/dynamic-workflows", "/concepts/built-in-tools"),+ ...createDocsRedirects("/subagents/workflow-tool", "/concepts/built-in-tools"),...createDocsRedirects("/sessions", "/concepts/sessions-runs-and-streaming"),...createDocsRedirects("/agent", "/agent-config"),...createDocsRedirects("/guides/acp", "/protocols/acp"),diff --git a/docs/agent-config.md b/docs/agent-config.mdindex 64902da2d..f6c593e38 100644--- a/docs/agent-config.md+++ b/docs/agent-config.md@@ -259,6 +259,6 @@ During `eve dev`, ordinary dependencies are bundled into each retained runtime g## What to read next-- [Default harness](./concepts/default-harness) for the loop and built-in tools this config drives+- [Default harness](./concepts/default-harness) for compaction and model context, and [Built-in tools](./concepts/built-in-tools) for the framework-provided tool set- [TypeScript API Reference](./reference/typescript-api) for every `defineAgent` field and type- [Subagents](./subagents) for the `description` requirement and child-agent configdiff --git a/docs/concepts/built-in-tools.md b/docs/concepts/built-in-tools.mdnew file mode 100644index 000000000..6f2a90582--- /dev/null+++ b/docs/concepts/built-in-tools.md@@ -0,0 +1,215 @@+---+title: "Built-in Tools"+description: "The default and opt-in tools eve provides, including Workflow, glob, grep, and sleep."+---++eve provides a default tool set for every agent and additional framework tools you can add with one file. Use this page to review what the model can call, opt into more capabilities, or override and disable defaults. For custom tools, see [Tools](../tools).++## Default tools++Default tools require no imports. The exact set depends on the agent and session. `agent` is available only in the root session; `load_skill` and `connection_search` appear only when the agent declares the corresponding resources; `ask_question` requires a session that can request user input; and `web_search` requires a supported model provider. The harness advertises only the tools available to the current session.++The default shell and file tools (`bash`, `read_file`, and `write_file`) run in the app and proxy their work into the agent's [sandbox](../sandbox). The table shows where each tool's effect lands.++| Tool | Does | Where it runs |+| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |+| `bash` | Run a shell command. | Sandbox |+| `read_file` | Read a text file with line-numbered output (enables read-before-write). | Sandbox FS |+| `write_file` | Write a complete file; enforces read-before-write and stale-read detection. | Sandbox FS |+| `web_fetch` | Fetch a URL. | App runtime |+| `web_search` | Search the web (provider-managed; resolved from the model provider). | Provider |+| `todo` | Maintain a durable per-session todo list. | App runtime |+| `ask_question` | Ask the user a clarifying question or a choice mid-turn and park until they answer. No `execute`; the model calls it with `{ prompt, options?, allowFreeform? }`. See [Human-in-the-loop](/docs/human-in-the-loop). | App runtime |+| `agent` | From the root session, delegate a subtask to a fresh copy of the root agent. | App runtime |+| `load_skill` | Pull an on-demand [skill](../skills)'s instructions into the current turn. Present only when the agent declares skills. | App runtime |+| `connection_search` | Discover tools across declared [connections](../connections); matched tools become directly callable. Present only when the agent declares connections. | App runtime |++The model-facing file tools accept absolute paths and paths beginning with `$HOME/`. eve resolves `$HOME` against the sandbox before invoking non-shell file operations, so packaged skill references such as `$HOME/.agents/skills/<skill>/references/...` work consistently across `read_file`, `write_file`, and the opt-in `glob` and `grep` tools.++Notes:++- **`agent`** is available only in the root session. Its child uses the root's instructions, tools, connections, and sandbox, but starts with fresh conversation history and fresh [state](./state). The child receives neither `agent` nor `Workflow`; declared subagents do not receive the built-in `agent` either. See [Subagents](../subagents).+- **`load_skill`** only pulls instructions into context. It adds no new execution surface, because behavior still comes from the tools the agent already has.+- **`connection_search`** surfaces a connection's tools by their qualified name (e.g. `linear__list_issues`), which the model can then call directly. It's registered only when the agent has connections.+- **`web_search`** has no local executor; the provider runs it. AI Gateway models use Exa by default. To use Parallel instead, export `webSearch({ provider: "parallel" })` from `agent/tools/web_search.ts`. Direct provider models continue to use their native search implementation. To supply your own implementation, override it with `defineTool()`.++Review these default tools before production use. Disable, wrap, restrict, or require approval for any tool that can access the filesystem, network, shell, or sensitive data.++## Add framework-provided tools++Some framework-provided tools stay out of the default set. Add the corresponding file when your agent needs one:++| Tool | Definition to export | Purpose |+| ---------- | ------------------------------------------ | -------------------------------------------------- |+| `glob` | `defineGlobTool()` from `eve/tools` | Find sandbox files by glob pattern. |+| `grep` | `defineGrepTool()` from `eve/tools` | Search sandbox file contents by regex. |+| `Workflow` | `experimental_workflow()` from `eve/tools` | Orchestrate root-agent copies from generated code. |+| `sleep` | `sleep()` from `eve/tools/sleep` | Pause and durably resume the current turn. |++For example, add file discovery and content search with two files:++```ts title="agent/tools/glob.ts"+import { defineGlobTool } from "eve/tools";++export default defineGlobTool();+```++```ts title="agent/tools/grep.ts"+import { defineGrepTool } from "eve/tools";++export default defineGrepTool();+```++The filename supplies the model-facing tool name. You can pass a custom `description` to either helper. The tools run against the agent's sandbox and use the same schemas, results, and error behavior as eve's framework implementations.++The sections below cover `Workflow` and `sleep` in more detail.++## Override a default++Author a tool at the same slug and it takes over the built-in of that name. The file `agent/tools/write_file.ts` replaces the built-in `write_file` by existing:++```ts title="agent/tools/write_file.ts"+import { defineTool } from "eve/tools";+import { writeFile } from "eve/tools/defaults";++export default defineTool({+ ...writeFile, // keep the default description, schema, and executor+ async execute(input, ctx) {+ console.log("[write_file]", input.path);+ return writeFile.execute(input, ctx);+ },+});+```++Framework tool definitions are importable from `eve/tools/defaults` (`bash`, `readFile`, `writeFile`, `glob`, `grep`, `webFetch`, `todo`, `loadSkill`), so you can spread, wrap, or patch them. Importing a definition does not add it to an agent; export it from the corresponding `agent/tools/*.ts` file. Skip the spread and your replacement owns its own context. A fresh `defineTool` for `todo` won't inherit the framework's durable state key.++Provider-managed web search has a dedicated configuration helper instead of an executable default:++```ts title="agent/tools/web_search.ts"+import { webSearch } from "eve/tools";++export default webSearch({ provider: "parallel" });+```++Set `provider` to `"exa"` or `"parallel"`. Without this file, AI Gateway models use Exa.++## Disable a default++Export a `disableTool()` sentinel from a file named after the tool's slug. The filename is what picks the default to remove:++```ts title="agent/tools/bash.ts"+import { disableTool } from "eve/tools";++export default disableTool();+```++Use `agent/tools/agent.ts` to remove the root-only `agent` delegation tool. The root session then receives no tool for delegating to a fresh copy of itself, and the model never sees that tool.++If the filename matches no known framework tool, resolution fails instead of silently doing nothing, so a typo surfaces at build time rather than removing the wrong tool.++## When to override, disable, or author a new tool++Three moves shape the harness. The right one depends on whether the model should keep the built-in capability.++- **Override** when you want the same capability with different behavior. Spread the default from `eve/tools/defaults` and wrap it (logging, an extra guard, a different backend), and the model still sees a tool by that name. Spreading keeps the default's description, schema, and any framework state, such as the `todo` tool's durable state key. Drop the spread and your replacement owns its own context, losing that wiring.+- **Disable** when the model should not have the capability at all. A `disableTool()` sentinel removes the built-in, and the model never sees it. Reach for this to lock down `bash` or `web_fetch` in an agent that should not run shell commands or fetch arbitrary URLs.+- **Author a new tool** when you want a capability the harness does not ship. Give it a fresh slug under `agent/tools/` and it joins the built-ins instead of replacing one. See [Tools](../tools) for the authoring model.++## Workflow tool++The opt-in experimental `Workflow` tool lets the model write JavaScript that coordinates the agent's own subagents as a single durable step. The program can run them in sequence, feed one result into the next, fan out over a list, and combine the results. You enable the capability and the model decides and runs the orchestration.++A single turn can already call several subagents, and parallel tool calls dispatch concurrently. What a workflow adds is _programmatic_ coordination. The program decides how many subagents to run based on an earlier result, which output feeds which call, and how to combine everything. That is logic the model cannot express as a few one-off calls.++`Workflow` is a model-facing tool, not an API for authored tools, hooks, or application code. Authored code cannot submit a Workflow program or use `Workflow` to start an arbitrary user-authored Vercel Workflow. Use the [client SDK](../guides/client/overview) when application code needs to start or continue an eve session; use ordinary application APIs for other deterministic orchestration.++### Enable Workflow++Export the experimental Workflow definition from `agent/tools/workflow.ts`. The helper name carries the "experimental" warning, but the tool the model actually sees is named `Workflow`.++```ts title="agent/tools/workflow.ts"+import { experimental_workflow } from "eve/tools";++export default experimental_workflow();+```++Without that file, the `Workflow` tool stays off. It earns its keep only when the agent has subagents (or the built-in `agent`) worth coordinating:++```ts title="agent/subagents/analyst/agent.ts"+import { defineAgent } from "eve";++export default defineAgent({+ description: "Analyzes one metric: queries, computes, writes a short finding.",+ model: "anthropic/claude-opus-4.8",+});+```++When asked for a weekly business review, the model picks the metrics, runs one `analyst` per metric in parallel, and combines the findings. The program below is the kind of JavaScript the model authors. It fans `analyst` out over a runtime-decided list of metrics and merges the results:++```js+const metrics = ["revenue", "signups", "churn"];+const findings = await Promise.all(+ metrics.map((metric) => tools.analyst({ message: `Summarize last week's ${metric}.` })),+);+return findings.join("\n\n");+```++Each `tools.analyst(...)` call dispatches a child subagent, so the parent stream records one `subagent.called` per metric and one `subagent.completed` as each finishes:++```json+{ "type": "subagent.called", "data": { "name": "analyst", "toolName": "analyst", "callId": "call_1", "childSessionId": "ses_a1", "sequence": 0 } }+{ "type": "subagent.called", "data": { "name": "analyst", "toolName": "analyst", "callId": "call_2", "childSessionId": "ses_a2", "sequence": 1 } }+{ "type": "subagent.called", "data": { "name": "analyst", "toolName": "analyst", "callId": "call_3", "childSessionId": "ses_a3", "sequence": 2 } }+{ "type": "subagent.completed", "data": { "subagentName": "analyst", "callId": "call_1", "output": "..." } }+{ "type": "subagent.completed", "data": { "subagentName": "analyst", "callId": "call_2", "output": "..." } }+{ "type": "subagent.completed", "data": { "subagentName": "analyst", "callId": "call_3", "output": "..." } }+```++### What a workflow can orchestrate++A workflow reaches only this agent's own agents: the built-in `agent` (a copy of itself), declared [subagents](../subagents), and [remote agents](../guides/remote-agents). That is the whole list. No files, network, shell, skills, or connections. A workflow is a coordination layer over subagents, not a place to do other work. Each call can still request structured output via `outputSchema`, exactly like a direct subagent delegation.++### Caps on workflow-spawned subagents++Workflow orchestration is capped in two independent ways.++**Per-program call budget.** One Workflow program may dispatch at most `maxSubagents` subagent calls in total, counted across the whole program — sequential and parallel calls alike. Configure it on `experimental_workflow`; the default is 100. Calls beyond the budget do not start a child session; they resolve inside the program with a `WORKFLOW_SUBAGENT_LIMIT_REACHED` error result, and the budget is stated in the tool's description so the model sizes its fan-out to fit.++```ts title="agent/tools/workflow.ts"+import { experimental_workflow } from "eve/tools";++export default experimental_workflow({ maxSubagents: 4 });+```++**Root-only orchestration.** Only the root session receives `Workflow`. Children started by a workflow receive neither `Workflow` nor the built-in `agent`, so Workflow programs cannot recurse. A declared child can still call subagents defined in its own directory (see [Subagents](../subagents)).++### Where the JavaScript runs++The orchestration code never touches the agent's process. The runtime hands the program text to a small isolated JavaScript engine (a QuickJS sandbox) and runs it there. Nothing from the host realm crosses in, so there is no `process`, no `globalThis` from the agent, and no `import`/`require`. The program can reach exactly two things, the agent functions bridged in as `tools.<name>` and the ordinary language built-ins.++That is an allowlist, not a denylist. The sandbox cannot read files, open a socket, or see an environment variable because those are not present, not because each one is blocked in turn. When the program calls an agent function, that call bridges back out to the runtime, which dispatches it exactly like a direct delegation. The orchestration glue stays inside the sandbox.++### Durability, approvals, and observability++- **Durable.** The whole orchestration counts as one step. Subagents dispatched together run concurrently, and if a run parks (suspends durably without holding compute; see [Execution model and durability](./execution-model-and-durability)) on a long-running or human-gated child, it resumes where it left off after a restart.+- **Approval-safe.** A subagent that needs human approval (HITL, human-in-the-loop) mid-run surfaces its request to the user, and the workflow picks back up once that is answered, same as direct delegation.+- **Observable.** Every orchestrated subagent emits the usual `subagent.called` / `subagent.completed` events on the parent stream and gets its own child session and stream. The telemetry matches direct delegation, so existing dashboards and cost attribution keep working.++## The opt-in `sleep` tool++The framework also ships a durable `sleep` tool, but does not add it to agents by default. Enable it with `agent/tools/sleep.ts`:++```ts+import { sleep } from "eve/tools/sleep";++export default sleep();+```++The model calls it with `{ seconds }` when it is useful to wait before checking progress or status again. The pause sleeps the durable turn workflow, so it does not hold an application runtime open, and the same turn continues automatically when the duration elapses. If one model response makes concurrent `sleep` calls, eve waits for the longest requested duration.++## What to read next++- [Tools](../tools): define your own tools, gate them on approval, and shape their output with `toModelOutput`+- [Dynamic capabilities](../guides/dynamic-capabilities): generate the tool set per session with `defineDynamic`+- [Sandbox](../sandbox): configure the sandbox used by shell and file tools+- [Subagents](../subagents): declare the agents that `agent` and `Workflow` can calldiff --git a/docs/concepts/default-harness.md b/docs/concepts/default-harness.mdindex 71e9e3451..507294c21 100644--- a/docs/concepts/default-harness.md+++ b/docs/concepts/default-harness.md@@ -1,9 +1,9 @@----title: "The Harness"-description: "How eve manages model context and built-in tools during an agent turn."+title: "Default Harness"+description: "How eve manages model context and compaction during an agent turn."----The default harness is eve's built-in agent loop. It manages model calls, compaction, and tool execution. You can extend it with capabilities specific to your agent. To see how turns checkpoint and resume, read [Execution model and durability](./execution-model-and-durability).+The default harness is eve's built-in agent loop. It manages model calls, compaction, and tool execution. Review the model-facing defaults and available opt-ins in [Built-in tools](./built-in-tools). To see how turns checkpoint and resume, read [Execution model and durability](./execution-model-and-durability).## Compaction@@ -32,115 +32,8 @@ To discard model-message history instead of summarizing it, call the correspondisystem prompt, configured tools and skills, durable state, limits, and sandbox.Its stream boundary is `context.cleared` followed by `session.waiting`.-## Built-in tools--Built-in tools require no imports. The exact set depends on the agent and session. `agent` is available only in the root session; `load_skill` and `connection_search` appear only when the agent declares the corresponding resources; `ask_question` requires a session that can request user input; and `web_search` requires a supported model provider. The harness advertises only the tools available to the current session.--The shell and file tools (`bash`, `read_file`, `write_file`, `glob`, `grep`) run in the app and proxy their work into the agent's [sandbox](../sandbox). The table shows where each tool's effect lands.--| Tool | Does | Where it runs |-| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |-| `bash` | Run a shell command. | Sandbox |-| `read_file` | Read a text file with line-numbered output (enables read-before-write). | Sandbox FS |-| `write_file` | Write a complete file; enforces read-before-write and stale-read detection. | Sandbox FS |-| `glob` | Find files by glob pattern. | Sandbox FS |-| `grep` | Search file contents by regex. | Sandbox FS |-| `web_fetch` | Fetch a URL. | App runtime |-| `web_search` | Search the web (provider-managed; resolved from the model provider). | Provider |-| `todo` | Maintain a durable per-session todo list. | App runtime |-| `ask_question` | Ask the user a clarifying question or a choice mid-turn and park until they answer. No `execute`; the model calls it with `{ prompt, options?, allowFreeform? }`. See [Human-in-the-loop](/docs/human-in-the-loop). | App runtime |-| `agent` | From the root session, delegate a subtask to a fresh copy of the root agent. | App runtime |-| `load_skill` | Pull an on-demand [skill](../skills)'s instructions into the current turn. Present only when the agent declares skills. | App runtime |-| `connection_search` | Discover tools across declared [connections](../connections); matched tools become directly callable. Present only when the agent declares connections. | App runtime |--The model-facing file tools accept absolute paths and paths beginning with `$HOME/`. eve resolves `$HOME` against the sandbox before invoking non-shell file operations, so packaged skill references such as `$HOME/.agents/skills/<skill>/references/...` work consistently across `read_file`, `write_file`, `glob`, and `grep`.--Notes:--- **`agent`** is available only in the root session. Its child uses the root's instructions, tools, connections, and sandbox, but starts with fresh conversation history and fresh [state](./state). The child receives neither `agent` nor `Workflow`; declared subagents do not receive the built-in `agent` either. See [Subagents](../subagents).-- **`load_skill`** only pulls instructions into context. It adds no new execution surface, because behavior still comes from the tools the agent already has.-- **`connection_search`** surfaces a connection's tools by their qualified name (e.g. `linear__list_issues`), which the model can then call directly. It's registered only when the agent has connections.-- **`web_search`** has no local executor; the provider runs it. AI Gateway models use Exa by default. To use Parallel instead, export `webSearch({ provider: "parallel" })` from `agent/tools/web_search.ts`. Direct provider models continue to use their native search implementation. To supply your own implementation, override it with `defineTool()`.--Review these built-in tools before production use. Disable, wrap, restrict, or require approval for any tool that can access the filesystem, network, shell, or sensitive data.--## Override a default--Author a tool at the same slug and it takes over the built-in of that name. The file `agent/tools/write_file.ts` replaces the built-in `write_file` by existing:--```ts title="agent/tools/write_file.ts"-import { defineTool } from "eve/tools";-import { writeFile } from "eve/tools/defaults";--export default defineTool({- ...writeFile, // keep the default description, schema, and executor- async execute(input, ctx) {- console.log("[write_file]", input.path);- return writeFile.execute(input, ctx);- },-});-```--The framework defaults are importable from `eve/tools/defaults` (`bash`, `readFile`, `writeFile`, `glob`, `grep`, `webFetch`, `todo`, `loadSkill`), so you can spread, wrap, or patch them. Skip the spread and your replacement owns its own context. A fresh `defineTool` for `todo` won't inherit the framework's durable state key.--Provider-managed web search has a dedicated configuration helper instead of an executable default:--```ts title="agent/tools/web_search.ts"-import { webSearch } from "eve/tools";--export default webSearch({ provider: "parallel" });-```--Set `provider` to `"exa"` or `"parallel"`. Without this file, AI Gateway models use Exa.--## Disable a default--Export a `disableTool()` sentinel from a file named after the tool's slug. The filename is what picks the default to remove:--```ts title="agent/tools/bash.ts"-import { disableTool } from "eve/tools";--export default disableTool();-```--Use `agent/tools/agent.ts` to remove the root-only `agent` delegation tool. The root session then receives no tool for delegating to a fresh copy of itself, and the model never sees that tool.--If the filename matches no known framework tool, resolution fails instead of silently doing nothing, so a typo surfaces at build time rather than removing the wrong tool.--## When to override, disable, or author a new tool--Three moves shape the harness. The right one depends on whether the model should keep the built-in capability.--- **Override** when you want the same capability with different behavior. Spread the default from `eve/tools/defaults` and wrap it (logging, an extra guard, a different backend), and the model still sees a tool by that name. Spreading keeps the default's description, schema, and any framework state, such as the `todo` tool's durable state key. Drop the spread and your replacement owns its own context, losing that wiring.-- **Disable** when the model should not have the capability at all. A `disableTool()` sentinel removes the built-in, and the model never sees it. Reach for this to lock down `bash` or `web_fetch` in an agent that should not run shell commands or fetch arbitrary URLs.-- **Author a new tool** when you want a capability the harness does not ship. Give it a fresh slug under `agent/tools/` and it joins the built-ins instead of replacing one. See [Tools](../tools) for the authoring model.--## The opt-in `Workflow` tool--An experimental `Workflow` tool ships but stays off by default. To turn it on, export its definition from `agent/tools/workflow.ts`:--```ts-import { experimental_workflow } from "eve/tools";--export default experimental_workflow({ maxSubagents: 100 });-```--With it on, the model can orchestrate the agent's own subagents from model-authored JavaScript, all as one durable step. The tool is root-only — delegated subagent sessions never see it — and one program may dispatch at most the configured `maxSubagents` calls (default 100). See [Workflow Tool](../subagents/workflow-tool).--## The opt-in `sleep` tool--The framework also ships a durable `sleep` tool, but does not add it to agents by default. Enable it with `agent/tools/sleep.ts`:--```ts-import { sleep } from "eve/tools/sleep";--export default sleep();-```--The model calls it with `{ seconds }` when it is useful to wait before checking progress or status again. The pause sleeps the durable turn workflow, so it does not hold an application runtime open, and the same turn continues automatically when the duration elapses. If one model response makes concurrent `sleep` calls, eve waits for the longest requested duration.-## What to read next-- [Tools](../tools): define your own tools, gate them on approval, and shape their output with `toModelOutput`-- [Dynamic capabilities](../guides/dynamic-capabilities): generate the tool set per session with `defineDynamic`-- [Sandbox](../sandbox): the sandbox the shell and file tools run in+- [Built-in tools](./built-in-tools): review the default and opt-in framework tools and configure the model-facing tool set+- [Execution model and durability](./execution-model-and-durability): understand how turns checkpoint and resume+- [Context control](./context-control): choose what the model sees and whendiff --git a/docs/concepts/execution-model-and-durability.mdx b/docs/concepts/execution-model-and-durability.mdxindex a31e79fc1..78d10d48b 100644--- a/docs/concepts/execution-model-and-durability.mdx+++ b/docs/concepts/execution-model-and-durability.mdx@@ -46,7 +46,7 @@ An eve agent spans two execution environments with different responsibilities:The agent loop runs as a durable workflow in the app runtime. Model calls, tool executors, hooks, instrumentation, and connection clients also run there with full Node.js access.-App-side code reaches the sandbox through `ctx.getSandbox()`. The built-in `bash`, `read_file`, `write_file`, `glob`, and `grep` tools use it, and authored tools can use it when they need isolated filesystem or process access.+App-side code reaches the sandbox through `ctx.getSandbox()`. The default `bash`, `read_file`, and `write_file` tools use it, as do opt-in framework tools such as `glob` and `grep`. Authored tools can use it when they need isolated filesystem or process access.The [sandbox](../sandbox) owns the per-session filesystem and processes. Authored skills are materialized under `$HOME/.agents/skills`, and `agent/sandbox/workspace/**` seeds `/workspace`. The loop and sandbox have decoupled lifetimes: the durable workflow can park or restart independently, while the app runtime opens or reuses sandbox compute only when code needs it.diff --git a/docs/concepts/meta.json b/docs/concepts/meta.jsonindex 685aad11c..bbb4110d0 100644--- a/docs/concepts/meta.json+++ b/docs/concepts/meta.json@@ -6,6 +6,7 @@"sessions-runs-and-streaming","state","default-harness",+ "built-in-tools","context-control","security-model"]diff --git a/docs/concepts/security-model.md b/docs/concepts/security-model.mdindex 717578df5..4ab58960b 100644--- a/docs/concepts/security-model.md+++ b/docs/concepts/security-model.md@@ -16,7 +16,7 @@ Your eve agent runs across two contexts, with a trust boundary between them andThe app runtime is the trusted side. Your tool implementations, model calls, connections, state, and durable execution all run here, with `process.env` and full Node.js available. (On Vercel, this is a Vercel Function.)-The sandbox is the isolated side. The model runs shell commands there through the built-in `bash`, `read_file`, `write_file`, `glob`, and `grep` tools. It gets its own `/workspace` filesystem, but no `process.env`, no secrets, and no path back into the app runtime. (On Vercel, each sandbox is a [Vercel Sandbox](https://vercel.com/docs/sandbox) microVM with hardware-level isolation.) Only shell commands execute in the sandbox. Even the built-in `bash`/`read_file`/`write_file` tools live in the app runtime and _proxy_ into the sandbox. The model sees tool definitions and results, never your secrets.+The sandbox is the isolated side. The model runs shell commands and accesses files there through the default `bash`, `read_file`, and `write_file` tools and any opt-in sandbox tools such as `glob` and `grep`. It gets its own `/workspace` filesystem, but no `process.env`, no secrets, and no path back into the app runtime. (On Vercel, each sandbox is a [Vercel Sandbox](https://vercel.com/docs/sandbox) microVM with hardware-level isolation.) Only shell commands execute in the sandbox. Even the built-in `bash`/`read_file`/`write_file` tools live in the app runtime and _proxy_ into the sandbox. The model sees tool definitions and results, never your secrets.A concrete trace makes the boundary clear. When the model calls a custom `charge_card` tool, its `execute` runs in the app runtime, reads `process.env.STRIPE_KEY`, calls Stripe, and returns `{ ok: true }`. The model sees only `{ ok: true }`: the key never leaves the app runtime, and nothing about the call touches the sandbox. The built-in `write_file` is the mirror image, running in the app runtime and proxying the write into the sandbox `/workspace`. Either way the model drives the work through tool calls and their results, never by holding a credential or reaching the runtime directly.diff --git a/docs/guides/dynamic-capabilities.md b/docs/guides/dynamic-capabilities.mdindex d89569173..688b148b8 100644--- a/docs/guides/dynamic-capabilities.md+++ b/docs/guides/dynamic-capabilities.md@@ -295,6 +295,6 @@ Dynamic system content that changes frequently can reduce provider prompt-cache- Conditionally expose a specialist → [Subagents](../subagents)- The static tool basics this builds on → [Tools](../tools)-- The built-in tools and how to override them → [Default harness](../concepts/default-harness)+- The built-in tools and how to override them → [Built-in tools](../concepts/built-in-tools)- Authenticate a tool or connection to an external service → [Auth & route protection](./auth-and-route-protection)- Durable per-session memory for resolvers to read → [State](../concepts/state)diff --git a/docs/guides/remote-agents.md b/docs/guides/remote-agents.mdindex bad40707c..0166b5b72 100644--- a/docs/guides/remote-agents.md+++ b/docs/guides/remote-agents.md@@ -135,5 +135,5 @@ Both failure paths surface to the parent as a failed tool result, so the caller## What to read next- Local delegation and the isolation boundary → [Subagents](../subagents)-- Have the model orchestrate remote agents programmatically → [Workflow Tool](../subagents/workflow-tool)+- Have the model orchestrate remote agents programmatically → [Workflow tool](../concepts/built-in-tools#workflow-tool)- Securing the receiving deployment → [Auth & route protection](./auth-and-route-protection)diff --git a/docs/reference/typescript-api.md b/docs/reference/typescript-api.mdindex 786317fb3..adb169bd6 100644--- a/docs/reference/typescript-api.md+++ b/docs/reference/typescript-api.md@@ -52,7 +52,7 @@ export default defineTool({| `mockModel` | `eve/evals` | Deterministic fixture agent models | [Evals](../evals/overview) || `useEveAgent` | `eve/react`, `eve/vue`, `eve/svelte` | frontend | [Frontend](../guides/frontend/overview) |-A few non-`define*` helpers round out the set: `disableTool`, `experimental_workflow`, and `webSearch` from `eve/tools` (see [Default harness](../concepts/default-harness)), `sleep` from `eve/tools/sleep`, the route verbs `GET`/`POST`/`PUT`/`PATCH`/`DELETE`/`WS` from `eve/channels`, the approval policies `always`/`once`/`never` from `eve/tools/approval`, and the channel auth helpers `localDev`/`vercelOidc`/`placeholderAuth` from `eve/channels/auth`. To wrap a built-in tool, import its default value from `eve/tools/defaults` (`bash`, `readFile`, `writeFile`, `glob`, `grep`, `webFetch`, `todo`, `loadSkill`). `AgentReasoningDefinition` is exported from `eve` for the top-level `defineAgent({ reasoning })` setting. `AgentLimitsDefinition` is exported for `defineAgent({ limits })`. `AgentWorkflowDefinition` and `AgentWorkflowWorldDefinition` are exported from `eve` for the `defineAgent({ experimental: { workflow } })` config shape. `ExperimentalWorkflowToolInput`, `WebSearchToolInput`, and `WebSearchProvider` are exported from `eve/tools` for their corresponding tool configuration helpers.+A few additional helpers round out the set: `defineGlobTool`, `defineGrepTool`, `disableTool`, `experimental_workflow`, and `webSearch` from `eve/tools` (see [Built-in tools](../concepts/built-in-tools)), `sleep` from `eve/tools/sleep`, the route verbs `GET`/`POST`/`PUT`/`PATCH`/`DELETE`/`WS` from `eve/channels`, the approval policies `always`/`once`/`never` from `eve/tools/approval`, and the channel auth helpers `localDev`/`vercelOidc`/`placeholderAuth` from `eve/channels/auth`. To wrap a framework-provided tool, import its definition from `eve/tools/defaults` (`bash`, `readFile`, `writeFile`, `glob`, `grep`, `webFetch`, `todo`, `loadSkill`). `AgentReasoningDefinition` is exported from `eve` for the top-level `defineAgent({ reasoning })` setting. `AgentLimitsDefinition` is exported for `defineAgent({ limits })`. `AgentWorkflowDefinition` and `AgentWorkflowWorldDefinition` are exported from `eve` for the `defineAgent({ experimental: { workflow } })` config shape. `ExperimentalWorkflowToolInput`, `WebSearchToolInput`, and `WebSearchProvider` are exported from `eve/tools` for their corresponding tool configuration helpers.`defineInstructions` accepts `{ content: string, role?: "system" | "user" }`; omitted `role` means `"system"`. Its `eve/instructions` version of `defineDynamic` accepts only `session.started` and `turn.started` handlers returning `defineInstructions(...)` or `null`. The legacy `{ markdown: string }` definition remains available as a deprecated system-role form.@@ -70,33 +70,33 @@ A few non-`define*` helpers round out the set: `disableTool`, `experimental_work## Imports at a glance-| Import | Holds |-| ----------------------------------------------------------- | ----------------------------------------------------------------------- |-| `eve` | `defineAgent`, `defineRemoteAgent`, `defineDynamic`, agent config types |-| `eve/tools` | `defineTool`, `defineDynamic`, `disableTool`, `experimental_workflow` |-| `eve/tools/defaults` | the built-in tools as plain values |-| `eve/tools/approval` | `always`, `once`, `never` |-| `eve/tools/sleep` | opt-in durable `sleep` tool |-| `eve/connections` | `defineMcpClientConnection`, `defineOpenAPIConnection` |-| `eve/channels` | `defineChannel`, route verbs |-| `eve/channels/eve` | `eveChannel` |-| `eve/channels/auth` | `localDev`, `vercelOidc`, `placeholderAuth` |-| `eve/channels/{slack,discord,teams,telegram,twilio,github}` | platform channel factories |-| `eve/hooks` | `defineHook` |-| `eve/schedules` | `defineSchedule` |-| `eve/skills` | `defineSkill`, `defineDynamic` |-| `eve/instructions` | `defineInstructions`, `defineDynamic` |-| `eve/context` | `defineState`, session and state types |-| `eve/sandbox` | `defineSandbox`, backends |-| `eve/instrumentation` | `defineInstrumentation`, `isChannel` |-| `eve/models/openai` | `experimental_chatgpt` |-| `eve/evals` | `defineEval`, `defineEvalConfig`, `mockModel`, eval types |-| `eve/evals/expect` | `includes`, `equals`, `matches`, `similarity` |-| `eve/evals/reporters` | `Braintrust`, `JUnit`, `EvalReporter` |-| `eve/evals/loaders` | `loadJson`, `loadYaml` |-| `eve/react`, `eve/vue`, `eve/svelte` | `useEveAgent` |-| `eve/next`, `eve/nuxt`, `eve/sveltekit` | framework bundler plugins |-| [`eve/client`](../guides/client/overview) | `Client`, `ClientSession` |+| Import | Holds |+| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |+| `eve` | `defineAgent`, `defineRemoteAgent`, `defineDynamic`, agent config types |+| `eve/tools` | `defineTool`, `defineDynamic`, `defineGlobTool`, `defineGrepTool`, `disableTool`, `experimental_workflow` |+| `eve/tools/defaults` | framework tool definitions as plain values |+| `eve/tools/approval` | `always`, `once`, `never` |+| `eve/tools/sleep` | opt-in durable `sleep` tool |+| `eve/connections` | `defineMcpClientConnection`, `defineOpenAPIConnection` |+| `eve/channels` | `defineChannel`, route verbs |+| `eve/channels/eve` | `eveChannel` |+| `eve/channels/auth` | `localDev`, `vercelOidc`, `placeholderAuth` |+| `eve/channels/{slack,discord,teams,telegram,twilio,github}` | platform channel factories |+| `eve/hooks` | `defineHook` |+| `eve/schedules` | `defineSchedule` |+| `eve/skills` | `defineSkill`, `defineDynamic` |+| `eve/instructions` | `defineInstructions`, `defineDynamic` |+| `eve/context` | `defineState`, session and state types |+| `eve/sandbox` | `defineSandbox`, backends |+| `eve/instrumentation` | `defineInstrumentation`, `isChannel` |+| `eve/models/openai` | `experimental_chatgpt` |+| `eve/evals` | `defineEval`, `defineEvalConfig`, `mockModel`, eval types |+| `eve/evals/expect` | `includes`, `equals`, `matches`, `similarity` |+| `eve/evals/reporters` | `Braintrust`, `JUnit`, `EvalReporter` |+| `eve/evals/loaders` | `loadJson`, `loadYaml` |+| `eve/react`, `eve/vue`, `eve/svelte` | `useEveAgent` |+| `eve/next`, `eve/nuxt`, `eve/sveltekit` | framework bundler plugins |+| [`eve/client`](../guides/client/overview) | `Client`, `ClientSession` |Exported types ship from the same entrypoint as the helper they describe (for example `ToolDefinition` and `ToolContext` from `eve/tools`). For the exhaustive list, read `packages/eve/src/public/index.ts`.diff --git a/docs/sandbox.mdx b/docs/sandbox.mdxindex b2dea6521..4535b96e9 100644--- a/docs/sandbox.mdx+++ b/docs/sandbox.mdx@@ -3,7 +3,7 @@ title: "Sandbox"description: "The agent's isolated bash environment, including built-in file tools, a seeded /workspace, backends, lifecycle, and network policy."----The sandbox is the agent's isolated bash environment: a filesystem rooted at `/workspace` where it can run shell commands, execute scripts, and read or write files without ever touching your app runtime. Every eve agent has exactly one. The built-in `bash`, `read_file`, `write_file`, `glob`, and `grep` tools already target it, and your authored code can too.+The sandbox is the agent's isolated bash environment: a filesystem rooted at `/workspace` where it can run shell commands, execute scripts, and read or write files without ever touching your app runtime. Every eve agent has exactly one. The default `bash`, `read_file`, and `write_file` tools target it; you can also add the framework's `glob` and `grep` tools or access it from authored code.A working sandbox exists by default, with nothing to author. Override it only to add setup, seed files, pick a backend, or lock down the network.@@ -17,10 +17,8 @@ The model already has shell and file access through the default tools:| -------------------------- | ----------------------------------- || `bash` | run a shell command in the sandbox || `read_file` / `write_file` | read/write files under `/workspace` |-| `glob` | find files by pattern |-| `grep` | search file contents |-All of them run with `/workspace` as the working directory. The model-facing file tools accept both absolute paths and paths beginning with `$HOME/`; eve resolves the latter inside the sandbox before reading, writing, or searching. Any authored runtime function (a tool, a step, a model callback) can get a live sandbox handle with `ctx.getSandbox()`.+These tools run with `/workspace` as the working directory. The model-facing file tools accept both absolute paths and paths beginning with `$HOME/`; eve resolves the latter inside the sandbox before reading, writing, or searching. Any authored runtime function (a tool, a step, a model callback) can get a live sandbox handle with `ctx.getSandbox()`.```ts title="agent/tools/run_analysis.ts"import { defineTool } from "eve/tools";diff --git a/docs/subagents/index.mdx b/docs/subagents/index.mdxindex 9077ff046..9f4681d8c 100644--- a/docs/subagents/index.mdx+++ b/docs/subagents/index.mdx@@ -153,7 +153,7 @@ eve lowers every subagent visible to the current agent (the root built-in copy,Declared subagents can call nested subagents defined under their own directories. eve does not apply a separate depth limit; nesting ends where the authored directory tree ends. The built-in `agent` follows the stricter root-only rule above, so `limits.maxSubagentDepth` no longer exists.-`Workflow` is also root-only. Child sessions can still call their own declared or remote subagents, but they receive neither `Workflow` nor the built-in `agent`. The Workflow tool's `maxSubagents` option caps the number of calls made by one program (default 100); see [Workflow Tool](./subagents/workflow-tool).+`Workflow` is also root-only. Child sessions can still call their own declared or remote subagents, but they receive neither `Workflow` nor the built-in `agent`. The Workflow tool's `maxSubagents` option caps the number of calls made by one program (default 100); see [Workflow tool](./concepts/built-in-tools#workflow-tool).A directly declared subagent's tool name is the bare path-derived name, with no prefix. `agent/subagents/researcher/` registers as the tool `researcher`. A subagent supplied by a mounted extension includes the mount namespace, such as `crm__reviewer`. The model, approvals, logs, and evals reference the resulting name. Its input schema is:@@ -205,4 +205,4 @@ Split out a subagent when the task needs a different prompt or specialist role,## What to read next- [Remote agents](./guides/remote-agents): call another eve deployment as a subagent.-- [Workflow Tool](./subagents/workflow-tool): have the model orchestrate its subagents programmatically (fan-out, map-reduce).+- [Workflow tool](./concepts/built-in-tools#workflow-tool): have the model orchestrate its subagents programmatically (fan-out, map-reduce).diff --git a/docs/subagents/meta.json b/docs/subagents/meta.jsonindex 40d6bd018..6f7ca8ada 100644--- a/docs/subagents/meta.json+++ b/docs/subagents/meta.json@@ -1,5 +1,5 @@{"title": "Subagents","defaultOpen": false,- "pages": ["index", "workflow-tool"]+ "pages": ["index"]}diff --git a/docs/subagents/workflow-tool.md b/docs/subagents/workflow-tool.mddeleted file mode 100644index d0fb57265..000000000--- a/docs/subagents/workflow-tool.md+++ /dev/null@@ -1,88 +0,0 @@-----title: "Workflow Tool"-description: "The experimental Workflow tool: let the model orchestrate its own subagents from model-authored JavaScript as one durable step."------The experimental `Workflow` tool lets the model write JavaScript that coordinates the agent's own subagents as a single durable step. The program can run them in sequence, feed one result into the next, fan out over a list, and combine the results. You enable the capability and the model decides and runs the orchestration.--A single turn can already call several subagents, and parallel tool calls dispatch concurrently. What a workflow adds is _programmatic_ coordination. The program decides how many subagents to run based on an earlier result, which output feeds which call, and how to combine everything. That is logic the model cannot express as a few one-off calls.--`Workflow` is a model-facing tool, not an API for authored tools, hooks, or application code. Authored code cannot submit a Workflow program or use `Workflow` to start an arbitrary user-authored Vercel Workflow. Use the [client SDK](../guides/client/overview) when application code needs to start or continue an eve session; use ordinary application APIs for other deterministic orchestration.--## Enable the Workflow tool--Export the experimental Workflow definition from `agent/tools/workflow.ts`. The helper name carries the "experimental" warning, but the tool the model actually sees is named `Workflow`.--```ts title="agent/tools/workflow.ts"-import { experimental_workflow } from "eve/tools";--export default experimental_workflow();-```--Without that file, the `Workflow` tool stays off. It earns its keep only when the agent has subagents (or the built-in `agent`) worth coordinating:--```ts title="agent/subagents/analyst/agent.ts"-import { defineAgent } from "eve";--export default defineAgent({- description: "Analyzes one metric: queries, computes, writes a short finding.",- model: "anthropic/claude-opus-4.8",-});-```--When asked for a weekly business review, the model picks the metrics, runs one `analyst` per metric in parallel, and combines the findings. The program below is the kind of JavaScript the model authors. It fans `analyst` out over a runtime-decided list of metrics and merges the results:--```js-const metrics = ["revenue", "signups", "churn"];-const findings = await Promise.all(- metrics.map((metric) => tools.analyst({ message: `Summarize last week's ${metric}.` })),-);-return findings.join("\n\n");-```--Each `tools.analyst(...)` call dispatches a child subagent, so the parent stream records one `subagent.called` per metric and one `subagent.completed` as each finishes:--```json-{ "type": "subagent.called", "data": { "name": "analyst", "toolName": "analyst", "callId": "call_1", "childSessionId": "ses_a1", "sequence": 0 } }-{ "type": "subagent.called", "data": { "name": "analyst", "toolName": "analyst", "callId": "call_2", "childSessionId": "ses_a2", "sequence": 1 } }-{ "type": "subagent.called", "data": { "name": "analyst", "toolName": "analyst", "callId": "call_3", "childSessionId": "ses_a3", "sequence": 2 } }-{ "type": "subagent.completed", "data": { "subagentName": "analyst", "callId": "call_1", "output": "..." } }-{ "type": "subagent.completed", "data": { "subagentName": "analyst", "callId": "call_2", "output": "..." } }-{ "type": "subagent.completed", "data": { "subagentName": "analyst", "callId": "call_3", "output": "..." } }-```--## What a workflow can orchestrate--A workflow reaches only this agent's own agents: the built-in `agent` (a copy of itself), declared [subagents](./), and [remote agents](../guides/remote-agents). That is the whole list. No files, network, shell, skills, or connections. A workflow is a coordination layer over subagents, not a place to do other work. Each call can still request structured output via `outputSchema`, exactly like a direct subagent delegation.--## Caps on workflow-spawned subagents--Workflow orchestration is capped in two independent ways.--**Per-program call budget.** One Workflow program may dispatch at most `maxSubagents` subagent calls in total, counted across the whole program — sequential and parallel calls alike. Configure it on `experimental_workflow`; the default is 100. Calls beyond the budget do not start a child session; they resolve inside the program with a `WORKFLOW_SUBAGENT_LIMIT_REACHED` error result, and the budget is stated in the tool's description so the model sizes its fan-out to fit.--```ts title="agent/tools/workflow.ts"-import { experimental_workflow } from "eve/tools";--export default experimental_workflow({ maxSubagents: 4 });-```--**Root-only orchestration.** Only the root session receives `Workflow`. Children started by a workflow receive neither `Workflow` nor the built-in `agent`, so Workflow programs cannot recurse. A declared child can still call subagents defined in its own directory (see [Subagents](./)).--## Where the JavaScript runs--The orchestration code never touches the agent's process. The runtime hands the program text to a small isolated JavaScript engine (a QuickJS sandbox) and runs it there. Nothing from the host realm crosses in, so there is no `process`, no `globalThis` from the agent, and no `import`/`require`. The program can reach exactly two things, the agent functions bridged in as `tools.<name>` and the ordinary language built-ins.--That is an allowlist, not a denylist. The sandbox cannot read files, open a socket, or see an environment variable because those are not present, not because each one is blocked in turn. When the program calls an agent function, that call bridges back out to the runtime, which dispatches it exactly like a direct delegation. The orchestration glue stays inside the sandbox.--## Durability, approvals, and observability--- **Durable.** The whole orchestration counts as one step. Subagents dispatched together run concurrently, and if a run parks (suspends durably without holding compute; see [Execution model & durability](../concepts/execution-model-and-durability)) on a long-running or human-gated child, it resumes where it left off after a restart.-- **Approval-safe.** A subagent that needs human approval (HITL, human-in-the-loop) mid-run surfaces its request to the user, and the workflow picks back up once that is answered, same as direct delegation.-- **Observable.** Every orchestrated subagent emits the usual `subagent.called` / `subagent.completed` events on the parent stream and gets its own child session and stream. The telemetry matches direct delegation, so existing dashboards and cost attribution keep working.--## What to read next--- Declare the subagents a workflow orchestrates → [Subagents](./)-- Call another deployment as one of those agents → [Remote agents](../guides/remote-agents)-- The `agent/tools/` opt-in mechanism → [Default harness](../concepts/default-harness)diff --git a/docs/tools/human-in-the-loop.md b/docs/tools/human-in-the-loop.mdindex 980a61094..cdfc71d2f 100644--- a/docs/tools/human-in-the-loop.md+++ b/docs/tools/human-in-the-loop.md@@ -91,7 +91,7 @@ The built-in `ask_question` tool lets the model pause and ask the user, rather t- `options`: an optional list of choices to offer. Channels render these as buttons or a select menu.- `allowFreeform`: whether the user may answer with free text instead of picking an option.-`ask_question` is part of the [default harness](/docs/concepts/default-harness), so it is available without you defining anything. It produces the same `input.requested` pause as an approval, and resumes the same way.+`ask_question` is part of the [default tool set](/docs/concepts/built-in-tools), so it is available without you defining anything. It produces the same `input.requested` pause as an approval, and resumes the same way.## How pause and resume works@@ -124,7 +124,7 @@ From your own frontend, scan all messages for pending requests and answer throug## What to read next- [Tools](/docs/tools): define the typed actions an approval gates-- [Default harness](/docs/concepts/default-harness): the built-in tools, including `ask_question`+- [Built-in tools](/docs/concepts/built-in-tools): the default tools, including `ask_question`- [Sessions, runs & streaming](/docs/concepts/sessions-runs-and-streaming): the event and resume contract behind the pause- [Building a frontend](/docs/guides/frontend/overview): render and answer requests from your own UI- [Multi-tenant approvals](/docs/patterns/multi-tenant-approvals): resolve per-tenant approval policy for authored and connection toolsdiff --git a/docs/tools/overview.mdx b/docs/tools/overview.mdxindex 6960065b1..4599077c7 100644--- a/docs/tools/overview.mdx+++ b/docs/tools/overview.mdx@@ -141,6 +141,6 @@ Do not return secrets, credentials, unnecessary personal data, or unbounded sens- [Human-in-the-loop](./human-in-the-loop): gate a tool on approval, or have the agent ask a question- [Skills](/docs/skills): on-demand procedures the model loads when relevant-- [Default harness](/docs/concepts/default-harness): the built-in tools and how to override or disable them+- [Built-in tools](/docs/concepts/built-in-tools): the default and opt-in framework tools and how to override or disable them- [Dynamic capabilities](/docs/guides/dynamic-capabilities): tools whose set is resolved per session with `defineDynamic`- [Authentication](/docs/guides/auth-and-route-protection): authenticate a tool to an external servicediff --git a/e2e/fixtures/agent-tools-sandbox/agent/tools/grep.ts b/e2e/fixtures/agent-tools-sandbox/agent/tools/grep.tsnew file mode 100644index 000000000..eeae71499--- /dev/null+++ b/e2e/fixtures/agent-tools-sandbox/agent/tools/grep.ts@@ -0,0 +1,3 @@+import { defineGrepTool } from "eve/tools";++export default defineGrepTool();diff --git a/e2e/fixtures/agent-tools-sandbox/evals/sandbox/file-tools.eval.ts b/e2e/fixtures/agent-tools-sandbox/evals/sandbox/file-tools.eval.tsindex 8d8080c0f..18410e1a4 100644--- a/e2e/fixtures/agent-tools-sandbox/evals/sandbox/file-tools.eval.ts+++ b/e2e/fixtures/agent-tools-sandbox/evals/sandbox/file-tools.eval.ts@@ -1,15 +1,15 @@import { defineEval } from "eve/evals";-// The framework `write_file`, `read_file`, and `grep` tools all target the-// sandbox filesystem. Writing a unique token with `write_file`, then locating-// it with `grep`, proves these built-in tools operate on the same `/workspace`-// the bash tool does — without any authored tool definitions.+// The default `write_file` tool and opt-in framework `grep` tool both target+// the sandbox filesystem. Writing a unique token with `write_file`, then+// locating it with `grep`, proves they operate on the same `/workspace` as+// `bash`.const FILE_TOOLS_TOKEN = "sandbox-file-tools-ok-Q2H";const FILE_TOOLS_PATH = "/workspace/file-tools-note.txt";export default defineEval({tags: ["real-model"],- description: "Sandbox: built-in write_file/grep tools operate on the sandbox filesystem.",+ description: "Sandbox: write_file and opt-in grep operate on the sandbox filesystem.",async test(t) {await t.send([diff --git a/packages/eve/src/client/agent-info-schema.ts b/packages/eve/src/client/agent-info-schema.tsindex 8e2abbbf3..5ee82a23d 100644--- a/packages/eve/src/client/agent-info-schema.ts+++ b/packages/eve/src/client/agent-info-schema.ts@@ -70,7 +70,7 @@ const tool = entry.extend({const frameworkTool = tool.extend({disabledByAuthor: z.boolean(),replacedByAuthoredTool: z.boolean(),- status: z.enum(["active", "disabled", "replaced"]),+ status: z.enum(["active", "disabled", "opt-in", "replaced"]),});const dynamicResolver = source.extend({diff --git a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.test.ts b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.test.tsindex f50099171..73e9af5a9 100644--- a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.test.ts+++ b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.test.ts@@ -5,6 +5,34 @@ import { createCompiledAgentManifest } from "#compiler/manifest.js";import { buildAgentInfoResponseFromManifest } from "#internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js";describe("buildAgentInfoResponseFromManifest", () => {+ it("reports opt-in framework tools as unavailable", () => {+ const manifest = createCompiledAgentManifest({+ agentRoot: "/app/agent",+ appRoot: "/app",+ config: {+ model: {+ id: "openai/gpt-5",+ routing: { kind: "gateway", target: "openai" },+ },+ name: "app",+ },+ });++ const result = buildAgentInfoResponseFromManifest(+ { manifest, schedules: [] },+ {+ gatewayCredentials: { apiKey: false, oidc: false },+ mode: "development",+ },+ );++ expect(result.tools.available.map((tool) => tool.name)).not.toContain("glob");+ expect(result.tools.available.map((tool) => tool.name)).not.toContain("grep");+ expect(result.tools.framework.find((tool) => tool.name === "glob")?.status).toBe("opt-in");+ expect(result.tools.framework.find((tool) => tool.name === "grep")?.status).toBe("opt-in");+ expect(AgentInfoResultSchema.safeParse(result).success).toBe(true);+ });+it("reports unresolved dynamic models without a model id", () => {const manifest = createCompiledAgentManifest({agentRoot: "/app/agent",diff --git a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.ts b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.tsindex de7492af6..31c7603d5 100644--- a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.ts+++ b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.ts@@ -8,6 +8,36 @@ import {import { resolveAgent } from "#runtime/resolve-agent.js";describe("buildFrameworkToolInfo", () => {+ it("reports opt-in tools as inactive and unavailable by default", () => {+ const info = buildFrameworkToolInfo({+ authoredToolNames: new Set(),+ delegationToolNames: new Set(),+ disabledFrameworkToolNames: new Set(),+ });++ expect(info.available.map((tool) => tool.name)).not.toContain("glob");+ expect(info.available.map((tool) => tool.name)).not.toContain("grep");+ expect(info.framework.find((tool) => tool.name === "glob")).toMatchObject({+ status: "opt-in",+ });+ expect(info.framework.find((tool) => tool.name === "grep")).toMatchObject({+ status: "opt-in",+ });+ });++ it("reports an authored opt-in tool as replacing the framework definition", () => {+ const info = buildFrameworkToolInfo({+ authoredToolNames: new Set(["grep"]),+ delegationToolNames: new Set(),+ disabledFrameworkToolNames: new Set(),+ });++ expect(info.framework.find((tool) => tool.name === "grep")).toMatchObject({+ replacedByAuthoredTool: true,+ status: "replaced",+ });+ });+it("reports the built-in agent action as active and available by default", () => {const info = buildFrameworkToolInfo({authoredToolNames: new Set(),diff --git a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.ts b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.tsindex 685044b1a..f130f23e8 100644--- a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.ts+++ b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.ts@@ -3,6 +3,7 @@ import {getAllFrameworkToolDefinitions,getAllFrameworkToolNames,getFrameworkDynamicToolResolvers,+ getOptInFrameworkToolNames,} from "#runtime/framework-tools/index.js";import {getAllFrameworkChannelNames,@@ -51,7 +52,7 @@ export interface AgentInfoToolEntry extends AgentInfoSource {export interface AgentInfoFrameworkToolEntry extends AgentInfoToolEntry {readonly disabledByAuthor: boolean;readonly replacedByAuthoredTool: boolean;- readonly status: "active" | "disabled" | "replaced";+ readonly status: "active" | "disabled" | "opt-in" | "replaced";}export interface AgentInfoDynamicResolverEntry extends AgentInfoSource {@@ -425,6 +426,7 @@ export function buildFrameworkToolInfo(input: {const occupiedToolNames = new Set([...input.authoredToolNames, ...input.delegationToolNames]);const available: AgentInfoToolEntry[] = [];const framework: AgentInfoFrameworkToolEntry[] = [];+ const optInFrameworkToolNames = getOptInFrameworkToolNames();for (const definition of getAllFrameworkToolDefinitions()) {const disabledByAuthor = input.disabledFrameworkToolNames.has(definition.name);@@ -433,7 +435,9 @@ export function buildFrameworkToolInfo(input: {? "disabled": occupiedToolNames.has(definition.name)? "replaced"- : "active";+ : optInFrameworkToolNames.has(definition.name)+ ? "opt-in"+ : "active";const rendered = renderTool(definition, {origin: "framework",replacesFrameworkTool: false,diff --git a/packages/eve/src/runtime/framework-tools/glob.ts b/packages/eve/src/runtime/framework-tools/glob.tsindex e8d47e030..ae2b26be8 100644--- a/packages/eve/src/runtime/framework-tools/glob.ts+++ b/packages/eve/src/runtime/framework-tools/glob.ts@@ -61,9 +61,6 @@ export const GLOB_TOOL_DEFINITION: ResolvedToolDefinition = {"Usage:",'- Supports glob patterns like "**/*.js" or "src/**/*.ts".',"- Returns matching file paths.",- "- Use this tool when you need to find files by name patterns.",- "- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.",- "- Use the grep tool instead if you need to search file contents.","- Call this tool in parallel when you know there are multiple patterns to search for.",].join("\n"),execute: executeGlob,diff --git a/packages/eve/src/runtime/framework-tools/grep.ts b/packages/eve/src/runtime/framework-tools/grep.tsindex 24dc40ad6..65767bd50 100644--- a/packages/eve/src/runtime/framework-tools/grep.ts+++ b/packages/eve/src/runtime/framework-tools/grep.ts@@ -84,8 +84,6 @@ export const GREP_TOOL_DEFINITION: ResolvedToolDefinition = {'- Supports full regex syntax (e.g. "log.*Error", "function\\s+\\w+").','- Filter files by pattern with the glob parameter (e.g. "*.js", "*.{ts,tsx}").',"- Returns matching lines with file paths and line numbers.",- "- Use this tool when you need to find files containing specific patterns.",- "- Use the glob tool instead if you only need to find files by name.","- Call this tool in parallel when you have multiple independent searches.","- Any line longer than 2000 characters is truncated.",].join("\n"),diff --git a/packages/eve/src/runtime/framework-tools/index.test.ts b/packages/eve/src/runtime/framework-tools/index.test.tsindex 896b9742c..bf5cbd52c 100644--- a/packages/eve/src/runtime/framework-tools/index.test.ts+++ b/packages/eve/src/runtime/framework-tools/index.test.ts@@ -5,6 +5,7 @@ import {getAllFrameworkToolNames,getFrameworkDynamicToolResolvers,getFrameworkToolDefinitions,+ getOptInFrameworkToolNames,} from "#runtime/framework-tools/index.js";import { isToolSchema } from "#shared/tool-schema.js";@@ -39,7 +40,20 @@ describe("framework-tools/index", () => {}expect(names).toContain("agent");- expect(getFrameworkToolDefinitions().map((tool) => tool.name)).not.toContain("agent");+ const defaultNames = getFrameworkToolDefinitions().map((tool) => tool.name);+ expect(defaultNames).not.toContain("agent");+ expect(defaultNames).not.toContain("glob");+ expect(defaultNames).not.toContain("grep");+ });++ it("identifies framework tools that require explicit authoring", () => {+ expect([...getOptInFrameworkToolNames()].sort()).toEqual(["glob", "grep"]);+ });++ it("does not direct default tools to opt-in tools", () => {+ const readFile = getFrameworkToolDefinitions().find((tool) => tool.name === "read_file");++ expect(readFile?.description).not.toMatch(/\b(?:glob|grep)\b/u);});it("uses one validated runtime schema for every framework-defined input", () => {diff --git a/packages/eve/src/runtime/framework-tools/index.ts b/packages/eve/src/runtime/framework-tools/index.tsindex 36c61b533..1fb08685e 100644--- a/packages/eve/src/runtime/framework-tools/index.ts+++ b/packages/eve/src/runtime/framework-tools/index.ts@@ -48,8 +48,6 @@ const REGISTERED_FRAMEWORK_DYNAMIC_TOOLS: readonly FrameworkDynamicToolDefinitioconst REGISTERED_FRAMEWORK_TOOLS: readonly ResolvedToolDefinition[] = [ASK_QUESTION_TOOL_DEFINITION,BASH_TOOL_DEFINITION,- GLOB_TOOL_DEFINITION,- GREP_TOOL_DEFINITION,READ_FILE_TOOL_DEFINITION,WRITE_FILE_TOOL_DEFINITION,TODO_TOOL_DEFINITION,@@ -58,8 +56,14 @@ const REGISTERED_FRAMEWORK_TOOLS: readonly ResolvedToolDefinition[] = [SKILL_TOOL_DEFINITION,];+const OPT_IN_FRAMEWORK_TOOLS: readonly ResolvedToolDefinition[] = [+ GLOB_TOOL_DEFINITION,+ GREP_TOOL_DEFINITION,+];+const ALL_FRAMEWORK_TOOLS: readonly ResolvedToolDefinition[] = [...REGISTERED_FRAMEWORK_TOOLS,+ ...OPT_IN_FRAMEWORK_TOOLS,AGENT_TOOL_DEFINITION,...TASK_TOOL_DEFINITIONS,];@@ -108,6 +112,11 @@ export function getAllFrameworkToolDefinitions(): readonly ResolvedToolDefinitioreturn ALL_FRAMEWORK_TOOLS;}+/** Returns framework tools that authors must explicitly add to an agent. */+export function getOptInFrameworkToolNames(): ReadonlySet<string> {+ return new Set(OPT_IN_FRAMEWORK_TOOLS.map((definition) => definition.name));+}+/*** Returns the names of every framework-provided tool the framework knows* about, regardless of whether the current agent gates any of them ondiff --git a/packages/eve/src/runtime/framework-tools/read-file.ts b/packages/eve/src/runtime/framework-tools/read-file.tsindex 783f87a5e..c6fbd1fa2 100644--- a/packages/eve/src/runtime/framework-tools/read-file.ts+++ b/packages/eve/src/runtime/framework-tools/read-file.ts@@ -62,8 +62,6 @@ export const READ_FILE_TOOL_DEFINITION: ResolvedToolDefinition = {"- By default, this tool returns up to 2000 lines from the start of the file.","- The offset parameter is the line number to start from (1-indexed).","- To read later sections, call this tool again with a larger offset.",- "- Use the grep tool to find specific content in large files or files with long lines.",- "- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.",'- Contents are returned with each line prefixed by its line number as `<line>: <content>`. For example, if a file has contents "foo\\n", you will receive "1: foo\\n".',"- Any line longer than 2000 characters is truncated.","- Call this tool in parallel when you know there are multiple files you want to read.",diff --git a/packages/eve/src/runtime/framework-tools/skill.test.ts b/packages/eve/src/runtime/framework-tools/skill.test.tsindex f6809e87e..fa728ab23 100644--- a/packages/eve/src/runtime/framework-tools/skill.test.ts+++ b/packages/eve/src/runtime/framework-tools/skill.test.ts@@ -27,8 +27,7 @@ describe("SKILL_TOOL_DEFINITION", () => {"Loading adds the skill instructions to the current turn.",);expect(SKILL_TOOL_DEFINITION.description).toContain("Available skills block");- expect(SKILL_TOOL_DEFINITION.description).toContain("not for MCP connections");- expect(SKILL_TOOL_DEFINITION.description).toContain("connection_search");+ expect(SKILL_TOOL_DEFINITION.description).not.toContain("connection_search");});});diff --git a/packages/eve/src/runtime/framework-tools/skill.ts b/packages/eve/src/runtime/framework-tools/skill.tsindex afd768f56..d75f8f099 100644--- a/packages/eve/src/runtime/framework-tools/skill.ts+++ b/packages/eve/src/runtime/framework-tools/skill.ts@@ -88,7 +88,6 @@ const SKILL_TOOL_METADATA = {description: ["Load the full instructions for one available skill by name or id.","Use this tool when the request clearly matches a listed skill description or when the user explicitly asks for that skill.",- "This is not for MCP connections; use connection_search to access an installed connection.","Loading adds the skill instructions to the current turn.",'Choose the "skill" value from the Available skills block.',].join(" "),diff --git a/packages/eve/test/runtime-agent-graph.test.ts b/packages/eve/test/runtime-agent-graph.test.tsindex f9466c5cf..5c97ff2ce 100644--- a/packages/eve/test/runtime-agent-graph.test.ts+++ b/packages/eve/test/runtime-agent-graph.test.ts@@ -381,14 +381,6 @@ describe("resolveRuntimeAgentGraph", () => {kind: "authored-tool",name: "bash",},- {- kind: "authored-tool",- name: "glob",- },- {- kind: "authored-tool",- name: "grep",- },{kind: "authored-tool",name: "read_file",@@ -471,14 +463,6 @@ describe("resolveRuntimeAgentGraph", () => {kind: "authored-tool",name: "bash",},- {- kind: "authored-tool",- name: "glob",- },- {- kind: "authored-tool",- name: "grep",- },{kind: "authored-tool",name: "read_file",@@ -787,8 +771,6 @@ describe("resolveRuntimeAgentGraph", () => {});expect(tools.map((tool) => tool.name)).toEqual(["ask_question",- "glob",- "grep","read_file","write_file","todo",@@ -827,8 +809,6 @@ describe("resolveRuntimeAgentGraph", () => {expect(graph.root.turnAgent.tools.map((tool) => tool.name)).toEqual(["ask_question","bash",- "glob",- "grep","read_file","write_file","todo",@@ -912,8 +892,6 @@ describe("resolveRuntimeAgentGraph", () => {expect(tools.map((tool) => tool.name)).toEqual(["ask_question",- "glob",- "grep","read_file","write_file","todo",