Skip to main content
readonly approvals: HarnessApprovalLedger
Persistent, authorization-gated approval inspection and decisions.

inspect()

inspect(id): Promise<HarnessApproval>
Parameters Returns Promise<HarnessApproval>

grant()

grant(id): Promise<HarnessApproval>
Parameters Returns Promise<HarnessApproval>

deny()

deny(id): Promise<HarnessApproval>
Parameters Returns Promise<HarnessApproval>

Required Actions

Each decision is checked against the authorization port, which must allow one action. Without the port, every decision fails closed.

HarnessApproval

Properties arguments
readonly arguments: JSONValue
authorization
readonly authorization: AgentHarnessAuthorizationIdentity
createdAt
readonly createdAt: number
expiresAt
readonly expiresAt: number
id
readonly id: string
requiredAction
readonly requiredAction: string
runId
readonly runId: string
status
readonly status: "pending" | "granted" | "denied" | "expired" | "consumed"
toolCallId
readonly toolCallId: string
toolName
readonly toolName: string
updatedAt
readonly updatedAt: number

HarnessApprovalStatus

HarnessApprovalStatus = typeof HARNESS_APPROVAL_STATUSES[number]

HARNESS_APPROVAL_STATUSES

const HARNESS_APPROVAL_STATUSES: readonly ["pending", "granted", "denied", "expired", "consumed"]

HarnessAuthorizationError

Constructors Constructor
new HarnessAuthorizationError(code): HarnessAuthorizationError
Parameters Returns HarnessAuthorizationError Properties cause?
optional cause?: unknown
code
readonly code: "identity_unavailable" | "unauthenticated" | "forbidden" | "policy_unavailable"
message
message: string
name
name: string
stack?
optional stack?: string
stackTraceLimit
static stackTraceLimit: number
The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
Parameters Returns void prepareStackTrace()
static prepareStackTrace(err, stackTraces): any
Parameters Returns any See https://v8.dev/docs/stack-trace-api#customizing-stack-traces

HarnessApprovalError

Constructors Constructor
new HarnessApprovalError(code): HarnessApprovalError
Parameters Returns HarnessApprovalError Properties cause?
optional cause?: unknown
code
readonly code: "expired" | "replayed" | "conflicting" | "consumed" | "missing"
message
message: string
name
name: string
stack?
optional stack?: string
stackTraceLimit
static stackTraceLimit: number
The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. Methods captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
Parameters Returns void prepareStackTrace()
static prepareStackTrace(err, stackTraces): any
Parameters Returns any See https://v8.dev/docs/stack-trace-api#customizing-stack-traces