toolApproval
A call-level dynamic approval configuration for WorkflowAgent that can be passed in the constructor or on each generate()/stream() call. It takes precedence over the tool's own static needsApproval setting.
Timeline (last 90 days)
Before the fix b3588dc, WorkflowAgent would pass assistant replies containing tool calls to the toolApproval approval function, causing the approval logic to see pending, rejected, and invalid sibling calls and treat them as completed history messages.
After the fix b3588dc, the toolApproval approval function receives only the messages actually sent to the model in this step, excluding system messages and excluding the current response, aligning with the documented conventions of generateText and streamText.
After the fix 7655f47, WorkflowAgent passes the tool metadata, dynamic flag, and title of server-side tool definitions to the toolApproval policy, both for newly initiated tool calls and for calls re-approved from message history replay.
If a project uses @ai-sdk/workflow to build Agent workflows with a human approval step, 2.0.106 is worth upgrading to as soon as possible, because all three fixes directly relate to the input accuracy of approval logic and the reliability of permission boundaries.
WorkflowAgent's toolApproval configuration can be passed in the constructor or on each generate() or stream() call, and it takes precedence over the tool's own needsApproval setting.
In WorkflowAgent, a tool call rejected by toolApproval receives an execution-denied tool result but does not pause the entire workflow.
Version @ai-sdk/workflow@2.0.105 introduces previously missing configuration options such as toolApproval, toolOrder, and the timeout object.
All Facts (7)
Before the fix b3588dc, WorkflowAgent would pass assistant replies containing tool calls to the toolApproval approval function, causing the approval logic to see pending, rejected, and invalid sibling calls and treat them as completed history messages.
50%UnverifiedAfter the fix b3588dc, the toolApproval approval function receives only the messages actually sent to the model in this step, excluding system messages and excluding the current response, aligning with the documented conventions of generateText and streamText.
50%UnverifiedAfter the fix 7655f47, WorkflowAgent passes the tool metadata, dynamic flag, and title of server-side tool definitions to the toolApproval policy, both for newly initiated tool calls and for calls re-approved from message history replay.
50%UnverifiedIf a project uses @ai-sdk/workflow to build Agent workflows with a human approval step, 2.0.106 is worth upgrading to as soon as possible, because all three fixes directly relate to the input accuracy of approval logic and the reliability of permission boundaries.
50%UnverifiedWorkflowAgent's toolApproval configuration can be passed in the constructor or on each generate() or stream() call, and it takes precedence over the tool's own needsApproval setting.
50%UnverifiedIn WorkflowAgent, a tool call rejected by toolApproval receives an execution-denied tool result but does not pause the entire workflow.
50%UnverifiedVersion @ai-sdk/workflow@2.0.105 introduces previously missing configuration options such as toolApproval, toolOrder, and the timeout object.
50%