AlwaysApproveToolApprovalResponseContent Class

Definition

Wraps a ToolApprovalResponseContent with additional "always approve" settings, enabling the ToolApprovalAgent middleware to record standing approval rules so that future matching tool calls are auto-approved without user interaction.

public sealed class AlwaysApproveToolApprovalResponseContent : Microsoft.Extensions.AI.AIContent
type AlwaysApproveToolApprovalResponseContent = class
    inherit AIContent
Public NotInheritable Class AlwaysApproveToolApprovalResponseContent
Inherits AIContent
Inheritance
AlwaysApproveToolApprovalResponseContent

Remarks

Instances of this class should not be created directly. Instead, use the extension methods CreateAlwaysApproveToolResponse(ToolApprovalRequestContent, String) or CreateAlwaysApproveToolWithArgumentsResponse(ToolApprovalRequestContent, String) on ToolApprovalRequestContent to create instances with the appropriate flags set.

The ToolApprovalAgent middleware will unwrap the InnerResponse to forward to the inner agent, while extracting the approval settings to persist as Microsoft.Agents.AI.ToolApprovalRule entries in the session state.

Properties

Name Description
AlwaysApproveTool

Gets a value indicating whether all future calls to the same tool should be auto-approved regardless of the arguments provided.

AlwaysApproveToolWithArguments

Gets a value indicating whether all future calls to the same tool with the exact same arguments should be auto-approved.

InnerResponse

Gets the underlying ToolApprovalResponseContent that will be forwarded to the inner agent.

Applies to