nemoguardrails.server.hooks.checking
The bridge to the engine: the check a hook’s tool call asks for, and the verdict the check’s result gives.
Module Contents
Classes
Functions
Data
API
A check’s verdict on a tool call, before it becomes the agent’s response.
Refuse any field the outcome’s kind doesn’t have, so only a valid allow, deny or error exists.
Raise unless the field name holds a non-empty string.
Raise when any of the fields names is set, since this kind of outcome has none of them.
The tool call a hook asks to check, whichever agent sent it; internal to the hooks server.
A deny when any violation is a decision on the call, or an error when every violation is a check failure.
A rail_failed error when every failure is a rail’s, otherwise an error with no code naming the first other.
The first non-empty reason among the decided violations, then the result’s reason, then the rail that blocked.
The error message for a failed rail, naming the rail when the violation does.
The one assistant message carrying call, as check_async() takes it; with no id when the call has none.
A compatibility declaration of the tool call names, as check_async() takes tools, for per-tool rails.
The verdict a tool-call check’s result gives: allow, deny, or an error when no rail decided.