Skip to main content

Guardrails IA

Validates an AI input or output against defined security rules. Detects inappropriate content, prompt injections, and policy violations.

Parameters

ParameterTypeRequiredVariableDescription
inputdynamic valueYesYesContent to validate (typically an LLM output or user text).
checksarrayNoNoList of checks to perform (pii_detection, toxicity, prompt_injection, hallucination, custom).
onViolationchoice (block, warn, sanitize)NoNoAction on detected violation: block the workflow, warn, or sanitize the content. (Default: "warn")
sanitizeRulesarrayNoNoCustom sanitization rules (regex pattern and replacement text).
groundingSourcesdynamic valueNoYesReference sources for hallucination detection (documents, factual data).
continueOnViolationbooleanNoNoContinue the workflow even when a violation is detected. (Default: false)
anonymizePIIbooleanNoNoAnonymize detected personal data with reversible identifiers. (Default: false)
outputVariabletextNoNoOutput variable name containing the validated content.
violationsVariabletextNoNoVariable name storing the list of detected violations.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : guardrailResult

{
"passed": false,
"violations": []
}

Example

Check that an AI response complies with rules.

Input :

{"text": "Voici les resultats de l analyse..."}

Output :

{"passed": true, "violations": []}
Tip

{{guardrailResult.passed}} is true if no violations are detected. {{guardrailResult.violations}} lists violated rules if any.