Safety & Moderation
Refusal policies, content filters and output validation.
Refusal Policy Guardrail
A drop-in policy block that defines what an assistant must refuse, how to refuse gracefully, and how to offer safe alternatives.
Content Safety (NeMo)
These are the default prompts released by Meta, except for policy O7, which was added to address direct insults. prompts: - task: content_safety_check
Structured Output Guardrail
Constrains a model to emit valid, schema-conformant JSON and specifies what to do when validation fails — reask, repair, or refuse.
PII Redaction Guardrail
Instructs a model to detect and redact personally identifiable information from its inputs and outputs before responding.
Injection Detection (NeMo Guardrail)
flow injection detection """ Reject, omit, or sanitize injection attempts from the bot. This rail operates on the $bot_message. """ response = await I
Output Check (NeMo Guardrail)
flow self check output $allowed = await SelfCheckOutputAction if not $allowed if $system.config.enable_rails_exceptions send OutputRailException(messa
Sensitive Data Detection (NeMo Guardrail)
INPUT RAILS flow detect sensitive data on input """Check if the user input has any sensitive data.""" $has_sensitive_data = await DetectSensitiveDataA
Facts (NeMo Guardrail)
flow self check facts """Check if the previous answer is accurate w.r.t. the relevant chunks. This output rail must be enabled explicitly per output m
Topic Safety (NeMo)
prompts: - task: topic_safety_check_input $model=topic_control content: | You are to act as a customer service agent, providing users with factual inf
Self Check Thinking (NeMo)
prompts: - task: self_check_input content: | Your task is to check if the user message below complies with the company policy for talking with the com
Llama Guard (NeMo)
These are the default prompts released by Meta, with the exception of policy O7, which was added to address direct insults. prompts: - task: llama_gua
Input Check (NeMo Guardrail)
flow self check input $allowed = await SelfCheckInputAction if not $allowed if $system.config.enable_rails_exceptions send InputRailException(message=
Hallucination Vulnerability Prompt Checker
# Hallucination Vulnerability Prompt Checker **VERSION:** 1.6 **AUTHOR:** Scott M **PURPOSE:** Identify structural openings in a prompt that may lead
Regex (NeMo Guardrail)
INPUT RAILS flow regex check input """Check if the user input matches any forbidden regex patterns.""" $result = await DetectRegexMatchAction(source="
Hallucination (NeMo Guardrail)
flow bot inform answer unknown bot say "I don't know the answer to that." flow hallucination warning """Warning rail for hallucination.""" bot said so
Jailbreak Detection (NeMo Guardrail)
flow jailbreak detection heuristics """ Heuristic checks to assess whether the user's prompt is an attempted jailbreak. """ $is_jailbreak = await Jail