Skip to content

Guardrail Nodes

Guardrail nodes check input or output for safety concerns. They have two output handles: pass and block.

{
"id": "guard-1",
"type": "guardrail",
"data": {
"type": "guardrail",
"guardrailType": "content",
"config": {
"blockedTopics": ["violence", "illegal"],
"action": "block"
}
}
}

Detects personally identifiable information (emails, phone numbers, SSNs, etc.).

{
"guardrailType": "pii",
"config": {
"detectors": ["email", "phone", "ssn", "credit_card", "address"],
"action": "redact",
"redactWith": "[REDACTED]"
}
}
ActionBehavior
blockReject the message entirely
redactReplace PII with placeholder text
warnAllow but flag for review

Detects prompt injection and jailbreak attempts.

{
"guardrailType": "jailbreak",
"config": {
"sensitivity": "medium",
"action": "block",
"customPatterns": []
}
}

Sensitivity levels: low, medium, high

Filters content based on blocked topics or custom rules.

{
"guardrailType": "content",
"config": {
"blockedTopics": ["violence", "illegal", "adult"],
"action": "block",
"customRules": [
{ "pattern": "competitor_name", "action": "warn" }
]
}
}

Place guardrails before agent nodes to check input, or after to check output:

Start → Guardrail (input check) → Agent → Guardrail (output check) → End