Guardrail applied before or after tool invocation.
Builds a tool guardrail definition.
Runs the guardrail handler for a tool call.
@type stage() :: :input | :output
@type t() :: %Codex.ToolGuardrail{ behavior: :allow | :reject_content | :raise_exception, handler: function(), name: String.t(), run_in_parallel: boolean(), stage: stage() }
@spec new(keyword()) :: t()
@spec run(t(), map(), term(), map()) :: :ok | {:reject, String.t()} | {:tripwire, String.t()}