Skip to content

ToolApprovalRuleRequest

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

Request to create a persistent, argument-conditioned approval rule.

public sealed record ToolApprovalRuleRequest : IEquatable<ToolApprovalRuleRequest>

objectToolApprovalRuleRequest

IEquatable<ToolApprovalRuleRequest>

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

This is a separate creation path from the “remember this decision” rule AgentPrism.ToolApprovalResolver writes from the approve/reject flow — that path fingerprints an exact call (ArgumentsHash); this one writes a standing, admin-authored comparison instead. There is no free-text expression field here — the code-only tools rule applies to the HTTP surface too.

public ToolApprovalRuleRequest()

The agent the rule holds for. When empty it covers every agent of the tenant.

public string? AgentName { get; init; }

string?

All conditions must match for the rule to apply (AND). An empty list (the default) matches every call of the tool.

public IReadOnlyList<ToolArgumentCondition> ArgumentConditions { get; init; }

IReadOnlyList<ToolArgumentCondition>

The tool the rule holds for.

public required string ToolName { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ToolApprovalRuleRequest? other)

other ToolApprovalRuleRequest?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(ToolApprovalRuleRequest?, ToolApprovalRuleRequest?)

Section titled “ operator ==(ToolApprovalRuleRequest?, ToolApprovalRuleRequest?)”
public static bool operator ==(ToolApprovalRuleRequest? left, ToolApprovalRuleRequest? right)

left ToolApprovalRuleRequest?

right ToolApprovalRuleRequest?

bool

operator !=(ToolApprovalRuleRequest?, ToolApprovalRuleRequest?)

Section titled “ operator !=(ToolApprovalRuleRequest?, ToolApprovalRuleRequest?)”
public static bool operator !=(ToolApprovalRuleRequest? left, ToolApprovalRuleRequest? right)

left ToolApprovalRuleRequest?

right ToolApprovalRuleRequest?

bool