Skip to content

Graphorin API reference v0.15.1


Graphorin API reference / @graphorin/agent / / AgentToToolOptions

Interface: AgentToToolOptions

Defined in: packages/agent/src/types.ts:710

Stable

agent.toTool({...}) options.

Properties

PropertyModifierTypeDescriptionDefined in
capability?readonly"read-only"Run the sub-agent under a restricted capability: a 'read-only' worker cannot execute or advertise writer tools. The orchestrator-worker recipe is parent (full capability) + workers via toTool({ capability: 'read-only', contextFold: true }).packages/agent/src/types.ts:732
contextFold?readonly| boolean | { maxChars?: number; }Context folding at the sub-agent boundary: instead of the raw final output, the parent receives a compact distilled outcome - status, step/tool-call counts, tools used, and the final text clamped to maxChars (default 2000). Keeps tool-heavy child runs from flooding the parent window. Default off (raw output).packages/agent/src/types.ts:740
description?readonlystring-packages/agent/src/types.ts:712
exposeTurns?readonly"none" | "all" | "final"-packages/agent/src/types.ts:713
forwardEvents?readonlySubagentForwardPolicyWhich child events forward into the parent stream.packages/agent/src/types.ts:725
inputFilter?readonlyHandoffFilterShapes the sub-agent seed from the parent history: when supplied, the sub-agent is seeded with [...inputFilter(parentMessages), { role: 'user', content: input }]. Without a filter the sub-agent sees ONLY the input string - no parent conversation crosses the boundary (least authority by construction; there is no secret-inheritance mechanism at this boundary at all).packages/agent/src/types.ts:723
name?readonlystring-packages/agent/src/types.ts:711
propagateTaint?readonlybooleanPropagate the child run's coarse taint flags across the fold (default true): when the child saw untrusted / sensitive content, the tool result carries a widen-only taint override (sourceKind: 'sub-agent') that re-arms the PARENT's data-flow ledger. A no-op when the parent has no dataFlowPolicy. Set false only for children whose inputs are fully trusted.packages/agent/src/types.ts:749