ToolApprovalPolicyRegistry
AgentPrism.Core.dllHolds the code-defined approval policies registered at startup, keyed by tool name.
public sealed class ToolApprovalPolicyRegistryInheritance
Section titled “Inheritance”object ← ToolApprovalPolicyRegistry
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”One tool has at most one policy: a second registration for the same tool name is a configuration mistake, not a “last one wins” situation — a security policy the consumer expected to be active must not be silently dropped.
Constructors
Section titled “Constructors”ToolApprovalPolicyRegistry(IEnumerable<ToolApprovalPolicyRegistration>)
Section titled “ ToolApprovalPolicyRegistry(IEnumerable<ToolApprovalPolicyRegistration>)”Creates a new registry from registrations.
public ToolApprovalPolicyRegistry(IEnumerable<ToolApprovalPolicyRegistration> registrations)Parameters
Section titled “Parameters”registrations IEnumerable<ToolApprovalPolicyRegistration>
The policy registrations.
Exceptions
Section titled “Exceptions”registrations is null.
The same tool name is registered more than once.
Methods
Section titled “Methods”TryGet(string, out Func<ToolApprovalContext, ToolApprovalPolicyDecision>?)
Section titled “ TryGet(string, out Func<ToolApprovalContext, ToolApprovalPolicyDecision>?)”Looks up the policy for a tool, if one is registered.
public bool TryGet(string toolName, out Func<ToolApprovalContext, ToolApprovalPolicyDecision>? policy)Parameters
Section titled “Parameters”toolName string
The tool name.
policy Func<ToolApprovalContext, ToolApprovalPolicyDecision>?
The policy delegate, when found.