🛡️ Guardrails
Check content for personal data, valid JSON, banned phrases and grounding before it is sent or stored — then branch on pass or fail.
Overview
The Guardrails node checks content before it's sent, stored or shown — usually an AI node's reply — and continues on Pass or Fail. Put it between an AI node and anything that emails a customer, writes to a CRM or answers in a chat.
Set Content to Check (e.g. {{ai_response.response}}) and turn on one or more checks. Cheap checks run first; the AI grounding check only runs if they passed, so no AI credits are spent on content that was already blocked.
Personal data (PII)
- Pattern detection (default): email addresses, phone numbers, Social Security numbers and card numbers (Luhn-checked, so order numbers aren't flagged), plus optional dates.
- Smart detection: names, street addresses, IDs, dates of birth and appointment dates, found anywhere in free text by Falcon's PII detection service. Other dates — "I was in a car accident on March 3rd" — are left alone. If the service can't be reached, the node errors rather than let content through (it fails closed).
- Custom terms: exact words to catch, such as a patient's name or an account number.
- When found: Block takes the Fail branch; Redact masks the matches (e.g.
[REDACTED EMAIL]) and continues on Pass.
Other checks
- Valid JSON — the content must parse as JSON, optionally with required fields (dot paths like
customer.email). - Regex rule — fail if the content matches a pattern (a blocklist like
guarantee|refund), or fail unless it matches (a required format). - Grounded in source (AI) — an AI judge scores whether every factual claim is supported by the agent's knowledge base or by text you provide; below the threshold (default 70) it fails. Uses AI credits unless you pick your own API key.
Output
The output variable (default guardrails_result) and {{$json}} hold { passed, content, failures, checks }. Downstream, use {{guardrails_result.content}} — the checked text, with PII masked when redaction is on.failures lists each failed check with a message, which is useful in a Fail-branch notification.
Related
- PHI/PII redaction removes personal data from stored execution logs after a run; Guardrails checks content during the run.
- Configuration errors (no content, no checks enabled, an invalid regex) fail the node instead of picking a branch, and the workflow checker reports them before you run.