defineHarnessSubagent
Purpose and behavior
Section titled “Purpose and behavior”Define a tool that runs a built-in child agent, with a fresh history, in the parent’s borrowed sandbox. The parent model sends { prompt }; the tool returns JSON text with the child’s text and conversation identifier, and a child failure is handled like any tool error. Child tokens count toward the dispatch usage and every ancestor budget, and ancestor permissions also apply to child tools.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredHarnessSubagentOptionsTool name, description shown to the parent model and built-in child agent. Unknown keys are rejected.options.nameRequiredstringUnique tool name exposed to the parent model, using 1–64 letters, digits, underscores or hyphens.options.descriptionRequiredstringTells the parent model when to delegate to this child; sent with the tool schema.options.agentRequiredCustomAgentBuilt-in agent from createAgent({ harness: createHarness(…), model }) that supplies the child’s instructions, tools, limits and permissions. A CLI agent is rejected with code configuration.