Guardrails IA
Validates an AI input or output against defined security rules. Detects inappropriate content, prompt injections, and policy violations.
Parameters
| Parameter | Type | Required | Variable | Description |
|---|---|---|---|---|
input | dynamic value | Yes | Yes | Content to validate (typically an LLM output or user text). |
checks | array | No | No | List of checks to perform (pii_detection, toxicity, prompt_injection, hallucination, custom). |
onViolation | choice (block, warn, sanitize) | No | No | Action on detected violation: block the workflow, warn, or sanitize the content. (Default: "warn") |
sanitizeRules | array | No | No | Custom sanitization rules (regex pattern and replacement text). |
groundingSources | dynamic value | No | Yes | Reference sources for hallucination detection (documents, factual data). |
continueOnViolation | boolean | No | No | Continue the workflow even when a violation is detected. (Default: false) |
anonymizePII | boolean | No | No | Anonymize detected personal data with reversible identifiers. (Default: false) |
outputVariable | text | No | No | Output variable name containing the validated content. |
violationsVariable | text | No | No | Variable 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.