ToolApprovalAgentOptions.AutoApprovalRules Property

Definition

Gets or sets a collection of heuristic functions that can automatically approve function calls that would otherwise require user approval.

public System.Collections.Generic.IEnumerable<Func<Microsoft.Extensions.AI.FunctionCallContent,System.Threading.Tasks.ValueTask<bool>>>? AutoApprovalRules { get; set; }
member this.AutoApprovalRules : seq<Func<Microsoft.Extensions.AI.FunctionCallContent, System.Threading.Tasks.ValueTask<bool>>> with get, set
Public Property AutoApprovalRules As IEnumerable(Of Func(Of FunctionCallContent, ValueTask(Of Boolean)))

Property Value

Remarks

Each function receives a FunctionCallContent representing the tool call that requires approval and returns a ValueTask<TResult> that resolves to true to auto-approve the call, or false to continue evaluating the next rule.

Auto-approval rules are evaluated after standing rules (derived from prior user approvals) but before prompting the user. Rules are evaluated in order; the first rule returning true causes the function call to be auto-approved.

Applies to