Enum ToolApprovalMode
Specifies the default approval requirement for a tool invocation.
public enum ToolApprovalMode
Fields
Never = 0The tool never requires approval. It is safe to execute automatically.
Conditional = 1The tool may require approval depending on context (e.g., specific arguments or policy configuration). The runtime should check the permission policy.
Always = 2The tool always requires explicit user approval before execution.
Examples
Reading the default approval mode of a built-in tool:
using LMKit.Agents.Tools;
IToolMetadata meta = (IToolMetadata)BuiltInTools.HttpPost;
if (meta.DefaultApproval == ToolApprovalMode.Always)
{
Console.WriteLine($"Tool '{((ITool)meta).Name}' always requires user approval.");
}
Remarks
This indicates whether user approval should be requested before a tool executes. The actual enforcement depends on the ToolPermissionPolicy configured on the agent or tool registry.