Skip to content

ToolApprovalContext

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The tool call a code-defined approval policy judges. Read-only.

public sealed class ToolApprovalContext

objectToolApprovalContext

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Registered with IAgentPrismBuilder.AddToolApprovalPolicy(toolName, policy) (AgentPrism.Core). A policy runs before the data rules (ToolApprovalRule) and its decision, when not ToolApprovalPolicyDecision.Undecided, overrides them — a policy is a security boundary written in code, and data cannot loosen it.

public ToolApprovalContext()

Gets the agent making the call, when known.

public string? AgentName { get; init; }

string?

Gets the call’s arguments, keyed by parameter name.

public required IReadOnlyDictionary<string, object?> Arguments { get; init; }

IReadOnlyDictionary<string, object?>

Gets the tenant making the call.

public required string TenantId { get; init; }

string

Gets the tool being called.

public required string ToolName { get; init; }

string

Reads a number at a dotted path into ToolApprovalContext.Arguments (for example order.amount). Returns null if the path does not resolve or the value is not a number.

public double? GetNumber(string path)

path string

The dotted path. No array index is accepted.

double?

Reads text at a dotted path into ToolApprovalContext.Arguments (for example customer.tier). Returns null if the path does not resolve or the value is not text.

public string? GetString(string path)

path string

The dotted path. No array index is accepted.

string?