Table of Contents

Class ToolSafetyTierAttribute

Namespace
JD.AI.Core.Attributes
Assembly
JD.AI.Core.dll

Declares the safety tier for a [KernelFunction] method. This attribute replaces the hardcoded dictionary in ToolConfirmationFilter by co-locating safety classification with the tool definition.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class ToolSafetyTierAttribute : Attribute
Inheritance
ToolSafetyTierAttribute
Inherited Members

Examples

[KernelFunction("read_file")]
[ToolSafetyTier(SafetyTier.AutoApprove)]
[Description("Read file contents")]
public static string ReadFile([Description("Path")] string path) { ... }

Constructors

ToolSafetyTierAttribute(SafetyTier)

Initializes a new ToolSafetyTierAttribute with the specified tier.

public ToolSafetyTierAttribute(SafetyTier tier)

Parameters

tier SafetyTier

The safety tier classification for this tool method.

Properties

Reason

Gets or sets an optional reason for the tier classification, useful for documentation and audit purposes.

public string? Reason { get; set; }

Property Value

string

Tier

Gets the safety tier classification.

public SafetyTier Tier { get; }

Property Value

SafetyTier