Open-source toolkit for adding programmable safety guardrails to LLM-powered applications using the Colang specification language for topic control, content filtering, and fact-checking.
Safety rails for AI applications — prevent your AI from going off-topic, generating harmful content, or exposing sensitive information using NVIDIA's programmable guardrail toolkit.
NVIDIA NeMo Guardrails is an open-source Python toolkit for developers who need programmable safety controls around LLM applications, using Colang and configurable rails to manage user input, retrieved context, tool calls, dialog flow, and model output before responses reach users. It is designed to sit between an application and one or more LLMs, so teams can control how user input, retrieved context, tool calls, dialog flow, and model output are handled before the response reaches the user. The project describes guardrails, or rails, as specific controls over LLM behavior, such as refusing unwanted topics, responding in a prescribed way to certain user requests, following predefined conversational paths, using a particular language style, extracting structured data, or applying moderation and fact-checking. NeMo Guardrails is most relevant for teams building production assistants, retrieval-augmented generation systems, customer support chatbots, internal copilots, and LLM endpoints where basic prompt instructions are not enough to enforce behavior consistently.
A core part of the toolkit is Colang, a purpose-built modeling language for defining controllable dialogue flows. Colang has a Python-like syntax and is intended to let developers describe user intents, bot responses, and conversational flows in configuration files. The repository states that both Colang 1.0 and Colang 2.0 are supported, with Colang 1.0 as the default. A typical configuration folder can include config.yml for model and rail settings, rails.co files for Colang definitions, actions.py for custom Python actions, and config.py for custom initialization. This makes NeMo Guardrails more of a developer framework than a plug-and-play SaaS moderation product: teams define behavior in code and configuration, then integrate it into their application through the Python API or the guardrails server.
The library supports multiple rail categories. Input rails run on user input and can reject or transform a request before it reaches the LLM. Dialog rails guide conversation flow and topic handling. Retrieval rails can inspect or transform retrieved context before it is placed into a prompt. Execution rails can govern tool or action behavior. Output rails inspect generated responses before they are returned to the user.
Was this helpful?
NeMo Guardrails is NVIDIA's open-source toolkit for adding programmable safety controls to LLM applications. Its Colang specification language supports configurable safety rules, while multi-layered input/output/dialog rails provide defense-in-depth. Best for developer teams deploying conversational AI in sensitive or customer-facing environments.
An event-driven programming language specifically designed for defining conversational guardrails. Define flows, patterns, and rules that control how the AI system handles various scenarios without requiring ML expertise.
Use Case:
Writing a set of Colang flows that prevent a customer service bot from discussing competitor products, sharing internal pricing strategies, or making promises about delivery timelines.
Input rails filter user messages before LLM processing, output rails filter responses before delivery, and dialog rails control conversation flow. Each layer can be configured independently for defense-in-depth.
Use Case:
Configuring input rails to block jailbreak attempts, dialog rails to keep conversations on-topic, and output rails to catch hallucinated facts before they reach users.
Built-in mechanisms to verify LLM claims against provided knowledge bases, reducing hallucination in responses by cross-referencing generated content with authoritative sources.
Use Case:
A healthcare chatbot verifying that any medical information it provides aligns with the approved knowledge base before presenting it to patients.
Pre-built input rails that detect and block common jailbreak and prompt injection attempts, including role-play attacks, instruction override attempts, and social engineering patterns.
Use Case:
Protecting a public-facing chatbot from users attempting to manipulate the AI into ignoring its safety instructions or revealing system prompts.
Integrates with LangChain, LangGraph, LlamaIndex, and other frameworks. Can be added to existing LLM applications without rewriting core logic — guardrails wrap existing conversation flows.
Use Case:
Adding topic control and safety filtering to an existing LangChain-based customer support agent by wrapping it with NeMo Guardrails configuration.
Supports streaming LLM responses while still applying output rails, with proper word spacing and accurate token counting in streaming mode.
Use Case:
Deploying a real-time conversational agent that streams responses to users while still catching and filtering inappropriate content before it appears.
Free
Ready to get started with NVIDIA NeMo Guardrails?
View Pricing Options →We believe in transparent reviews. Here's what NVIDIA NeMo Guardrails doesn't handle well:
Weekly insights on the latest AI tools, features, and trends delivered to your inbox.
No reviews yet. Be the first to share your experience!
Get started with NVIDIA NeMo Guardrails and see if it's the right fit for your needs.
Get Started →Take our 60-second quiz to get personalized tool recommendations
Find Your Perfect AI Stack →Explore 20 ready-to-deploy AI agent templates for sales, support, dev, research, and operations.
Browse Agent Templates →