ToolApprovalAgent.AllToolsAutoApprovalRule Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets an auto-approval rule that approves every tool call, regardless of tool name or arguments.
public static Func<Microsoft.Extensions.AI.FunctionCallContent,System.Threading.Tasks.ValueTask<bool>> AllToolsAutoApprovalRule { get; }
static member AllToolsAutoApprovalRule : Func<Microsoft.Extensions.AI.FunctionCallContent, System.Threading.Tasks.ValueTask<bool>>
Public Shared ReadOnly Property AllToolsAutoApprovalRule As Func(Of FunctionCallContent, ValueTask(Of Boolean))
Property Value
Remarks
Add this rule to AutoApprovalRules to automatically approve all tool calls without prompting the user. This effectively disables approval prompts for every tool, so use it only when running in a fully trusted context.
For example, to auto-approve every tool call:
builder.UseToolApproval(new ToolApprovalAgentOptions
{
AutoApprovalRules = [ToolApprovalAgent.AllToolsAutoApprovalRule],
});