Skip to content

SkillScriptGrant

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The record carrying permission to execute a skill script.

public sealed record SkillScriptGrant : IEquatable<SkillScriptGrant>

objectSkillScriptGrant

IEquatable<SkillScriptGrant>

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

Script execution is a deliberate exception to AgentPrism’s “tools are defined only in code” rule. The grant record is this exception’s gate: a script with no grant record does not run, even with a whitelisted interpreter.

If SkillScriptGrant.ScriptName is null, the grant covers all of the skill’s scripts.

public SkillScriptGrant()

The moment the grant expires. Never expires if null.

public DateTimeOffset? ExpiresAt { get; init; }

DateTimeOffset?

The moment the grant was given (UTC).

public DateTimeOffset GrantedAt { get; init; }

DateTimeOffset

The actor who gave the grant.

public string? GrantedBy { get; init; }

string?

The grant record identifier. A time-ordered UUID (v7).

public Guid Id { get; init; }

Guid

The moment the grant was revoked. Active if null.

public DateTimeOffset? RevokedAt { get; init; }

DateTimeOffset?

The name of the script granted. If null, all of the skill’s scripts are covered.

public string? ScriptName { get; init; }

string?

The name of the skill granted.

public required string SkillName { get; init; }

string

The tenant the grant belongs to.

public required string TenantId { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(SkillScriptGrant? other)

other SkillScriptGrant?

bool

public override int GetHashCode()

int

Reports whether the grant is active at the given moment.

public bool IsActiveAt(DateTimeOffset instant)

instant DateTimeOffset

The evaluation moment.

bool

true if the grant is active.

An expired grant is automatically invalid; the record is not expected to be deleted. Cleanup is the retention phase’s concern.

public override string ToString()

string

operator ==(SkillScriptGrant?, SkillScriptGrant?)

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

left SkillScriptGrant?

right SkillScriptGrant?

bool

operator !=(SkillScriptGrant?, SkillScriptGrant?)

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

left SkillScriptGrant?

right SkillScriptGrant?

bool