The guard under calibration: a DecisionGuard surface or an InputGuard strategy ensemble, resolved from the same configuration the plugin reads.
Nous.Eval.Guard.Subject.new({:decision_guard, %{model: dm}}, :user_input)
Nous.Eval.Guard.Subject.new({:input_guard, %{strategies: [...]}}, :user_input)A DecisionGuard subject holds the Nous.Hook.Decision the plugin builds for
the surface (Nous.Plugins.DecisionGuard.decision/2), whether the
Pattern ensemble runs beside it (user input), the per-call timeout and
:on_error. An InputGuard subject holds the strategy list, :aggregation
and :fail_closed; it guards :user_input only.
Guard inputs from cases
state/3 builds what the guard classifies from a classifier case's
input, mirroring the runner's payloads: a tool_call case becomes a
:pre_tool_use payload (tool_name, arguments), a tool_result case a
:post_tool_use payload (plus result), a model_output case a
:post_response payload (content, tool_calls); task is the env's
task. When a case has no tool.description, the description comes from
the :tools given (the agent under test's tools; a Nous.Tool's
developer description, as the guard itself reads it, or a name => description map). A user-input case is classified on its text plus its
text/* attachments, as Nous.Plugins.InputGuard.Engine.message_text/2
renders them.
Summary
Functions
Resolves {:decision_guard, config} (a :decision_guard_config) or
{:input_guard, config} (an :input_guard_config) for surface.
Returns {:error, message} on an invalid configuration.
"sha256:<hex>" of everything that decides what the subject's model is
asked (not the bands, which only replay reads): two subjects with equal
recording fingerprints over the same cases and tools give the same
recording, so the second is served from the cache.
What the subject classifies for case: {:text, text} on user input,
else {:state, state} (the decision model's state, built by the decision's
state builder). See the moduledoc for tools.
Types
@type kind() :: :decision_guard | :input_guard
@type t() :: %Nous.Eval.Guard.Subject{ aggregation: :any | :majority | :all, config: map(), decision: Nous.Hook.Decision.t() | nil, fail_closed: boolean(), kind: kind(), on_error: :allow | :escalate | :deny, pattern_ensemble: boolean(), strategies: [{module(), keyword()}], surface: Nous.Eval.Guard.Case.surface(), timeout: non_neg_integer() | :infinity }
Functions
@spec new({kind(), map() | keyword()} | t(), Nous.Eval.Guard.Case.surface()) :: {:ok, t()} | {:error, String.t()}
Resolves {:decision_guard, config} (a :decision_guard_config) or
{:input_guard, config} (an :input_guard_config) for surface.
Returns {:error, message} on an invalid configuration.
@spec recording_fingerprint(t(), [Nous.Eval.Guard.Case.t()], term()) :: String.t()
"sha256:<hex>" of everything that decides what the subject's model is
asked (not the bands, which only replay reads): two subjects with equal
recording fingerprints over the same cases and tools give the same
recording, so the second is served from the cache.
@spec state( t(), Nous.Eval.Guard.Case.t(), [Nous.Tool.t()] | %{required(String.t()) => String.t()} ) :: {:text, String.t()} | {:state, term()}
What the subject classifies for case: {:text, text} on user input,
else {:state, state} (the decision model's state, built by the decision's
state builder). See the moduledoc for tools.