Codex.Guardrail (Codex SDK v0.7.2)

Copy Markdown View Source

Represents an input or output guardrail invoked around agent execution.

Summary

Functions

Builds a guardrail definition.

Executes the guardrail handler against the given payload and context.

Types

stage()

@type stage() :: :input | :output

t()

@type t() :: %Codex.Guardrail{
  handler: function(),
  name: String.t(),
  run_in_parallel: boolean(),
  stage: stage()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Builds a guardrail definition.

run(guardrail, payload, context)

@spec run(t(), term(), map()) :: :ok | {:reject, String.t()} | {:tripwire, String.t()}

Executes the guardrail handler against the given payload and context.