# `Jidoka.Review.Policy`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/review/policy.ex#L1)

Policy describing when a model-requested operation must pause for review.

A policy is definition data. Runtime approval still flows through
`Jidoka.Review.Interrupt`, `Jidoka.Review.Request`, and
`Jidoka.Review.Response`.

# `mode`

```elixir
@type mode() :: :pre_execution
```

# `t`

```elixir
@type t() :: %Jidoka.Review.Policy{
  message: nil | nil | binary(),
  metadata: map(),
  mode: :pre_execution,
  predicate: nil | nil | any(),
  reason: any(),
  required: boolean(),
  ttl_ms: nil | nil | integer()
}
```

# `from_input`

```elixir
@spec from_input(t() | keyword() | map() | true | false | nil) ::
  {:ok, t() | nil} | {:error, term()}
```

Normalizes an optional review policy, including boolean shorthand.

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Builds a review policy from keyword or map attributes.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Builds a review policy and raises if the attributes are invalid.

# `required?`

```elixir
@spec required?(t() | nil) :: boolean()
```

Returns true when a policy requires human review.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for a review policy.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Projects a review policy into a stable map.

---

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