Switch the coding agent (claude/codex/opencode) for an existing task. Creates a NEW child task running on the requested runner with a bounded recent-context handoff (last few turns + assistant tail) — the parent task stays immutable. Use this instead of continue_task when the user wants a differe...
AI agents call fork_task to retrieve information from Yaver without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | string | — | Optional opencode mode: 'build', 'plan', or any custom agent in the user's opencode.json. Empty = opencode defaultAgent. Other runners ignore. |
input | string | Yes | User's new prompt for the forked agent. |
model | string | — | Optional model id. Empty = runner default. |
runner | string | Yes | Target runner for the child task. |
task_id | string | Yes | The parent task ID to fork from. |
context_words | integer | — | Word budget for the recent-context handoff. Default 1200. Clamped to [100, 5000]. |
Parameters from the server's own tool schema.
Even though fork_task only reads data, uncontrolled read access leaks sensitive information and racks up API costs — an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Attacks that exploit this kind of access
Switch the coding agent (claude/codex/opencode) for an existing task. Creates a NEW child task running on the requested runner with a bounded recent-context handoff (last few turns + assistant tail) — the parent task stays immutable. Use this instead of continue_task when the user wants a different runner/model/mode mid-conversation. Claude/Codex/OpenCode don't share session formats, so an in-place runner swap would corrupt session state. Returns the child task ID + runner + how many words of context were carried. It is categorised as a Read tool in the Yaver MCP Server, which means it retrieves data without modifying state.
fork_task accepts 6 parameters: mode, input, model, runner, task_id, context_words. Required: input, runner, task_id. The full parameter table on this page comes from the server's own tool schema.
Register the Yaver MCP server in PolicyLayer and add a rule for fork_task: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Yaver. Nothing to install.
fork_task is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the fork_task rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for fork_task. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
fork_task is provided by the Yaver MCP server (yaver-cli). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.