ToolApprovalAgent.AllToolsAutoApprovalRule Property

Definition

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],
});

Applies to