NeMo Guardrails
NVIDIA's open-source framework for adding programmable safety rules to AI — enforcing what your AI can and cannot say or do.
The Compliance Officer for Your AI
Imagine hiring a compliance officer whose only job is to review every AI response before it reaches a user, and every user message before the AI processes it. They work in milliseconds, never tire, apply the same rules consistently, and can be programmed with your exact business requirements. That's the role NeMo Guardrails plays.
NeMo Guardrails is an open-source framework from NVIDIA that allows organizations to define behavioral rules for AI systems. These rules — called guardrails — operate as a layer on top of any large language model, checking inputs and outputs against your defined policies before anything reaches the user or executes in the system.
NeMo Guardrails doesn't replace your AI model. It wraps around it. The model does the reasoning; the guardrails enforce the boundaries. You get the model's capabilities within the limits you define.
Three Types of Guardrails
Input Rails
Rules that evaluate what's coming in before the AI sees it. If a user's message contains prohibited content, a jailbreak pattern, or a sensitive query, the input rail intercepts it before it ever reaches the language model. The model processes only messages that pass the input check.
Dialog Rails
Rules that govern the flow of conversation. If a user is asking about topic X, dialog rails can require the AI to always include a disclaimer, redirect to a human, or follow a specific structured flow — regardless of what the model would otherwise generate.
Output Rails
Rules that evaluate what the AI is about to say before it reaches the user. If the model generates a response that violates a policy — mentions a competitor, makes a regulatory claim, or produces potentially harmful content — the output rail blocks or modifies it before delivery.
Click the card to reveal the explanation
Your AI Answers Customer Financial Questions
Your bank deploys an AI to answer customer questions about products, rates, and account management. Without guardrails, you're relying on the AI's general training to know what's appropriate. The model is capable and helpful.
Without guardrails: a customer asks "Should I put my retirement savings into this high-risk investment?" The AI, trained on enthusiastic financial content, provides a confident-sounding recommendation — potentially violating securities regulations on investment advice.
With NeMo Guardrails configured for financial services: that question triggers a predefined dialog rail. The AI's response is intercepted and replaced with: "That's a great question for one of our licensed financial advisors. I can help you schedule a consultation. Questions about specific investment recommendations require a licensed professional." The policy is enforced automatically, consistently, and auditably — without retraining the model.
- The rule is configurable by your compliance team, not just your AI team
- Every application of the rule is logged for audit purposes
- The model's capabilities for everything else remain unchanged
- New rules can be added without model updates
How a Request Flows Through NeMo Guardrails
1 / 5💬 User sends a message
A user submits a message to your AI system. Before it reaches the language model, it enters the NeMo Guardrails pipeline.
🔍 Input rail evaluation
The guardrails system evaluates the message against your defined input rules. Does it match a prohibited pattern? Is it a jailbreak attempt? Does it require a specific routing? If it fails, the guardrail handles the response directly — the model never sees it.
🤖 Model generates response
If the input passes, it's sent to the language model. The model generates a response using its normal reasoning capabilities.
🛡️ Output rail evaluation
Before the response reaches the user, output rails evaluate it. Does it contain prohibited content? Does it make claims that require a disclaimer? Does it follow the required response structure? Responses that fail are blocked or modified.
✅ User receives compliant response
The user receives only responses that have passed both input and output evaluation. All rail activations are logged — a complete audit trail of every policy enforcement decision.
Without behavioral guardrails, your AI is only as safe as the model's general training:
- Jailbreaks may succeed — the model can often be manipulated into bypassing its own safety training
- Regulatory violations can occur through confident-sounding incorrect statements
- Off-topic or harmful content can reach users
- No audit trail of policy violations — you can't demonstrate compliance
- Competitor mentions or sensitive topics handled inconsistently by the model
- Consistent policy enforcement — rules apply equally to every request, every user
- Audit trail — every rule activation is logged, demonstrating compliance
- Rapid policy updates — new rules deploy without model retraining
- Regulatory alignment — compliance team can configure rules directly
- Defense against jailbreaks — input rails catch known attack patterns before the model sees them
Guardrails don't make your AI perfect — they make it consistently bounded within your defined policy space.
When Guardrails Are Most Valuable
- Regulated industries (finance, healthcare, legal, insurance) — where specific claims or advice require licensed professionals
- Customer-facing deployments — where brand consistency and compliance exposure are high
- Sensitive topic handling — anywhere the AI might encounter topics requiring specific responses (mental health, legal rights, safety information)
- Competitive sensitivity — enforcing rules about competitor mentions or pricing discussions
- Compliance demonstration — when audit trails of AI behavior are required by regulators or enterprise contracts
Guardrails are a layer, not a complete solution. They work alongside least-privilege design, input sanitization, and human oversight — not instead of them.