ToolAuthorizationResult
AgentPrism.Abstractions.dllThe outcome of an authorization decision.
public sealed record ToolAuthorizationResult : IEquatable<ToolAuthorizationResult>Inheritance
Section titled “Inheritance”object ← ToolAuthorizationResult
Implements
Section titled “Implements”IEquatable<ToolAuthorizationResult>
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”ToolAuthorizationResult()
Section titled “ ToolAuthorizationResult()”public ToolAuthorizationResult()Properties
Section titled “Properties”IsAllowed
Section titled “ IsAllowed”Gets whether the call may proceed.
public required bool IsAllowed { get; init; }Property Value
Section titled “Property Value”Reason
Section titled “ Reason”Gets the text returned to the model as the tool’s result when the call is denied. null when allowed.
public string? Reason { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”This text is sent to the model, not shown to the user directly — the same rule applies to every other model-facing string. It carries no secret.
Methods
Section titled “Methods”Allow()
Section titled “ Allow()”Creates an allowing result.
public static ToolAuthorizationResult Allow()Returns
Section titled “Returns”A result with ToolAuthorizationResult.IsAllowed set to true.
Deny(string)
Section titled “ Deny(string)”Creates a denying result.
public static ToolAuthorizationResult Deny(string reason)Parameters
Section titled “Parameters”reason string
The text returned to the model as the tool’s result.
Returns
Section titled “Returns”A result with ToolAuthorizationResult.IsAllowed set to false.
Exceptions
Section titled “Exceptions”reason is empty or whitespace.
Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(ToolAuthorizationResult?)
Section titled “ Equals(ToolAuthorizationResult?)”public bool Equals(ToolAuthorizationResult? other)Parameters
Section titled “Parameters”other ToolAuthorizationResult?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(ToolAuthorizationResult?, ToolAuthorizationResult?)
Section titled “ operator ==(ToolAuthorizationResult?, ToolAuthorizationResult?)”public static bool operator ==(ToolAuthorizationResult? left, ToolAuthorizationResult? right)Parameters
Section titled “Parameters”left ToolAuthorizationResult?
right ToolAuthorizationResult?
Returns
Section titled “Returns”operator !=(ToolAuthorizationResult?, ToolAuthorizationResult?)
Section titled “ operator !=(ToolAuthorizationResult?, ToolAuthorizationResult?)”public static bool operator !=(ToolAuthorizationResult? left, ToolAuthorizationResult? right)Parameters
Section titled “Parameters”left ToolAuthorizationResult?
right ToolAuthorizationResult?