Skip to content

Documentation / @agentick/guardrails / GuardrailDenied

Class: GuardrailDenied

Defined in: guardrails/src/errors.ts:6

Error thrown when a guardrail denies a tool execution.

Extends

Constructors

Constructor

new GuardrailDenied(toolName, reason): GuardrailDenied

Defined in: guardrails/src/errors.ts:7

Parameters

toolName

string

reason

string

Returns

GuardrailDenied

Overrides

GuardError.constructor

Properties

cause?

readonly optional cause: Error

Defined in: shared/src/errors.ts:108

Original error that caused this error

Inherited from

GuardError.cause


code

readonly code: AgentickErrorCode

Defined in: shared/src/errors.ts:102

Unique error code for programmatic handling

Inherited from

GuardError.code


details

readonly details: Record<string, unknown>

Defined in: shared/src/errors.ts:105

Additional error details

Inherited from

GuardError.details


guardType?

readonly optional guardType: string

Defined in: shared/src/errors.ts:683

Type of guard that denied access

Inherited from

GuardError.guardType


toolName

readonly toolName: string

Defined in: guardrails/src/errors.ts:8

Methods

denied()

static denied(reason, details?): GuardError

Defined in: shared/src/errors.ts:706

Create a custom guard denied error

Parameters

reason

string

details?

Record<string, unknown>

Returns

GuardError

Inherited from

GuardError.denied


fromJSON()

static fromJSON(json): AgentickError

Defined in: shared/src/errors.ts:169

Create error from serialized format

Parameters

json

SerializedAgentickError

Returns

AgentickError

Inherited from

GuardError.fromJSON


role()

static role(roles): GuardError

Defined in: shared/src/errors.ts:699

Create a role-based guard error

Parameters

roles

string[]

Returns

GuardError

Inherited from

GuardError.role


toJSON()

toJSON(): SerializedAgentickError

Defined in: shared/src/errors.ts:137

Serialize error for transport (JSON-safe)

Returns

SerializedAgentickError

Inherited from

GuardError.toJSON

Released under the ISC License.