# `Nous.Plugins.InputGuard.Policy`
[🔗](https://github.com/nyo16/nous/blob/v0.17.1/lib/nous/plugins/input_guard/policy.ex#L1)

Maps severity levels to policy actions for the InputGuard plugin.

The policy determines what happens when input is flagged at each severity level.

## Actions

  * `:block` — Halts the agent loop by setting `needs_response: false` and injecting
    an assistant message indicating the request was blocked.
  * `:warn` — Injects a system message warning the LLM about the flagged input.
    Execution continues normally.
  * `:log` — Logs the violation via `Logger.warning/1`. Execution continues unchanged.
  * `:callback` — Calls the user-provided `on_violation` function from config.
  * `fun/2` — A function `fn result, ctx -> ctx end` for fully custom handling.

## Default Policy

    %{suspicious: :warn, blocked: :block}

# `apply`

```elixir
@spec apply(
  Nous.Plugins.InputGuard.Result.t(),
  Nous.Agent.Context.t(),
  [Nous.Tool.t()],
  map()
) ::
  {Nous.Agent.Context.t(), [Nous.Tool.t()]}
```

Apply the configured policy action for the given result.

Returns the (possibly modified) context and tools tuple.

---

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