Validator (VALIDATOR)

Checks the incoming value with a rule, a script or an AI model, and continues on Pass or on Fail. Inside a Loop, Pass ends the loop.

Category: Flow Control · Deployed: yes · Tool-capable: no

Ports

Port Kind Purpose

Input (in_value)

Input

The value to check

Pass (out_pass)

Output

Runs when the check passes

Fail (out_fail)

Output

Runs when the check fails

The Validator does not change the value. The module after Pass or Fail receives the same value the Validator received. Only one of the two outputs runs. An output with nothing connected simply ends that path.

Properties

Choose the Validation Type first (required). Its own fields appear below it.

Validation Type How it checks

CONDITION

Compares one field with a value — fast, exact, and free

SCRIPT

Runs your own Python code

LLM

An AI model judges the text, for example for harmful content — flexible, but slower, and the result is not always the same

CONDITION — compare one field

Field Required Meaning

Condition Field (conditionField)

Yes

The name of the field to check. The previous module must send a JSON object that contains it

Condition Operator (conditionOperator)

Yes

See the table below

Condition Value (conditionValue)

Yes, except for EXISTS / NOT_EXISTS

The value the field is compared with. For GREATER_THAN and LESS_THAN, enter a number. Hidden for EXISTS and NOT_EXISTS

Operator Passes when

EQUALS

The field’s value is exactly the Condition Value, including upper and lower case

NOT_EQUALS

The field’s value is anything else

CONTAINS

The Condition Value appears somewhere in the field’s value (upper and lower case must match)

GREATER_THAN / LESS_THAN

Both are numbers, and the field’s value is greater / smaller. If one is not a number, the check fails

EXISTS

The field is there, whatever its value

NOT_EXISTS

The field is not there

If the incoming value is not a JSON object, every field counts as missing: only NOT_EXISTS passes. An empty value always fails.

SCRIPT — your own Python code

Field Required Meaning

Script (script)

Yes

Python code that decides pass or fail. The incoming value is in the variable pipeline_input. The code must print true or false, or {"pass": true} / {"pass": false}

Requirements (requirements)

No

Extra Python packages to install before the code runs, for example requests==2.32.3. Each package makes the check slower. Empty → nothing is installed

Timeout (s) (timeoutSeconds)

No

How many seconds installing the packages and running the code may take together, 1–300. Default: 30. Higher → slow code can finish. Lower → a stuck script is stopped sooner

  • pipeline_input holds the incoming value only when it is a JSON object. For plain text it is empty ({}), so a script cannot read plain text.

  • If the script fails, runs too long, or prints anything else, the check fails.

  • The code runs in the same closed-off container as the Python Script module.

LLM — an AI model judges

Use Select AI Server & Model to fill in the model fields at once.

Field Required Meaning

Model Provider (model.provider)

Yes

OLLAMA, OPEN_AI, ANTHROPIC or GEMINI. A model made for checking text gives the most reliable results

Model Name (model.name)

Yes

For example llama-guard3 or gpt-4o-mini. A small, fast model is usually enough

Model URL (model.url)

Yes

The address of the model server, for example localhost:11434

API Key (model.apiKey)

No

Needed for OPEN_AI, ANTHROPIC and GEMINI. Leave empty for OLLAMA. Not part of an export

Model Timeout (min) (model.timeoutMinutes)

No

How long to wait for the model’s answer, 1–120 minutes. Default: 20. Higher → slow models can finish. Lower → a stuck model stops sooner

Guardrail Checks (checks)

Yes

What the model checks the text for — the same list as in Guardrails. More checks → more problems are caught, but also more harmless texts fail

Custom Validation Description (description)

No

An extra rule in your own words that the model also checks, for example "The answer must not name a price."

Heuristic Detection Threshold (threshold)

No

How strict the check is, from 0.0 to 1.0. Default: 0.5. The model rates how likely the text breaks a rule; a rating below this value passes. Lower → stricter: more texts fail. Higher → more lenient: more texts pass

If the model cannot be reached, times out, or gives an unreadable answer, the value passes. The check is skipped in that case and no error is shown. For a check that must never let something through, make sure the model is reachable, and test the check with a text that should fail.

  • An empty value passes without a model call.

Use cases

  • The end condition of a Loop — its most important use. Put the Validator into the Loop’s Body and connect Pass to what should happen after success.

  • Branching on data: CONDITION with GREATER_THAN, for example to send a warning only above a limit.

  • Quality gate: LLM with a Custom Validation Description, for example "The answer must name a source."

  • Anything you can compute: SCRIPT for checks a single comparison cannot express.

Notes

  • Inside a Loop, Pass is the loop’s real success exit. Fail starts the next round. See Loop.

  • CONDITION and SCRIPT need JSON. The previous module must send a JSON object, not plain text. Use Structured Output or Text Format (Word Count) to produce one.

  • Different safe direction per type: a broken SCRIPT fails the check, a broken LLM check passes the value. Keep this in mind for checks that must never let something through.

  • Prefer CONDITION where it is enough — it costs nothing. LLM adds a model call to every check.