Skip to navigation

Check Content

View as MarkdownOpen in Claude

Guardrail check request.

Returns 422 when rail_types includes a type with no configured flows, when the serving engine cannot run a tool check it was asked for: a tool rail type, or tools, on a config the IORails engine does not serve, or when tools holds an entry that isn’t a function tool.

Request

This endpoint expects an object.
modelstringRequired

The LLM model to use for chat completion (e.g., ‘gpt-4o’, ‘llama-3.1-8b’).

frequency_penaltydouble or nullOptional
Frequency penalty parameter.
guardrailsobjectOptional
Guardrails specific options for the request.
logit_biasmap from strings to any or nullOptional
Logit bias parameter.
logprobsboolean or nullOptional
Log probabilities parameter.
max_completion_tokensinteger or nullOptional
The maximum number of completion tokens to generate, including reasoning tokens.
max_tokensinteger or nullOptional
The maximum number of tokens to generate.
messageslist of objects or nullOptional
The list of messages in the current conversation.
parallel_tool_callsboolean or nullOptional
Whether to allow parallel tool calls during tool use.
presence_penaltydouble or nullOptional
Presence penalty parameter.
stopstring or list of strings or nullOptional
Stop sequences.
streamboolean or nullOptionalDefaults to false

If set, partial message deltas will be sent as server-sent events.

temperaturedouble or nullOptional
Sampling temperature to use.
tool_choicestring or map from strings to any or nullOptional
Tool choice parameter.
toolslist of maps from strings to any or nullOptional

Tools that tool_call rails validate calls against: the allowlist and each tool’s argument schema. Each entry is a Chat Completions function tool, with a function object and a non-empty name; any other entry returns 422. Only the IORails engine runs tool checks; on LLMRails a request with tools returns 422.

top_pdouble or nullOptional

Top-p sampling parameter.

Response

Successful Response
contentstring
Content after rails processing.
statusstring

Overall check result: passed, modified, or blocked.

railstring or nullOptional
Name of the blocking rail, if any.
reasonstring or nullOptional
Why the rail blocked the content, if the engine reports it.
tool_violationslist of objects or nullOptional

The tool calls or tool results a tool rail blocked, each with a violation_type to switch on. Present only when a tool rail blocked (IORails).

Errors

422
Unprocessable Entity Error