Nous.Plugins.InputGuard.Policy (nous v0.13.3)

View Source

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}

Summary

Functions

Apply the configured policy action for the given result.

Functions

apply(result, ctx, tools, config)

Apply the configured policy action for the given result.

Returns the (possibly modified) context and tools tuple.