Skip to content

Documentation / @agentick/kernel / GuardFn

Type Alias: GuardFn() ​

GuardFn = (envelope) => boolean | Promise<boolean>

Defined in: kernel/src/guard.ts:11

Guard function that inspects the procedure envelope to decide allow/deny.

  • Return true to allow execution.
  • Return false to deny (createGuard constructs a GuardError from config).
  • Throw a GuardError directly for full control over the error.

Parameters ​

envelope ​

ProcedureEnvelope<any[]>

Returns ​

boolean | Promise<boolean>

Released under the ISC License.