nemoguardrails.library.cel.actions
Module Contents
Functions
Data
API
Evaluate all of a tool’s CEL expressions, blocking when any is true.
A failing expression (an error or a non-boolean result) raises even if another expression matched, so the rail fails closed.
The compiled program for expression, cached outside the config (see CelOptions.compile_expressions).
Return the tool’s CEL options for source.
Raises when none are configured, so the rail fails closed: a tool the CEL rail runs for with no expressions to check cannot be validated.
Checks a tool call’s arguments against that tool’s CEL expressions.
Parameters:
Fixed per surface, always “tool_call”.
ToolCall — The tool call to check. Its arguments are args and its name is tool.
Optional[ Tool ] — The declared tool, used only by @tool_call_validation to check
the call’s arguments against its schema before this function runs.
RailsConfig — The rails configuration object.
Returns: RailOutcome
RailOutcome that blocks when any expression is true, with the matched expressions in
Checks a tool result’s content against that tool’s CEL expressions.
Parameters:
Fixed per surface, always “tool_result”.
ToolCall — The prior call this result answers. Its arguments are args and its name
is tool.
ToolResult — The tool result to check. Its content is result, as the tool returned it.
RailsConfig — The rails configuration object.
Returns: RailOutcome
RailOutcome that blocks when any expression is true, with the matched expressions in