How Guardrails Work#

The NeMo Guardrails toolkit applies guardrails at multiple stages of the LLM interaction.

Stage

Rail Type

Common Use Cases

Before LLM

Input rails

Content safety, jailbreak detection, topic control, PII masking

After LLM

Output rails

Response filtering, fact checking, sensitive data removal

RAG pipeline

Retrieval rails

Document filtering, chunk validation

Tool calls

Execution rails

Action input/output validation

Conversation

Dialog rails

Flow control, guided conversations

Programmable Guardrails Flow