# `Codex.Guardrail`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/guardrail.ex#L1)

Represents an input or output guardrail invoked around agent execution.

# `stage`

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

# `t`

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

# `new`

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

Builds a guardrail definition.

# `run`

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

Executes the guardrail handler against the given payload and context.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
