NVIDIA NeMo Guardrails is an open-source Python package for adding programmable guardrails to LLM-based applications. It lets developers block, alter, or validate unsafe, off-topic, malicious, or policy-violating user inputs and model responses without rewriting the application or model backend. The library organizes control logic around input, retrieval, dialog, execution, and output rails, configured through YAML files and Colang flows, with custom Python actions and runtime interfaces. Teams use it for content safety, jailbreak protection, topic control, PII detection and masking, and agentic security such as tool-call validation. It integrates via a Python SDK, an OpenAI-compatible guardrails server, and frameworks including LangChain and LangGraph. Configurations are portable to the NeMo Guardrails microservice for Kubernetes deployment.
How to use NVIDIA NeMo Guardrails
1
Install the library
Install the open-source nemoguardrails Python package from PyPI following the official installation guide.
2
Configure rails
Define models, prompts, rails, and runtime settings in YAML files and describe conversational flows and guardrail logic in Colang.
3
Add custom actions
Extend guardrails with Python functions, tools, or external APIs for application-specific checks.
4
Integrate with your application
Call the library through the Python SDK, run the guardrails server for OpenAI-style chat completions, or use LangChain/LangGraph integrations.
5
Deploy to production
Reuse the same YAML and Colang configuration with the NeMo Guardrails microservice on Kubernetes with Helm.
NVIDIA NeMo Guardrails Features
Input, retrieval, dialog, execution, and output rails
YAML configuration and Colang flows
Custom Python actions and third-party API integrations
Content safety and jailbreak protection
Topic control and PII detection/masking
Agentic security with tool-call validation
Python SDK and OpenAI-compatible guardrails server
LangChain and LangGraph integrations
Portable configuration to the NeMo Guardrails microservice
NVIDIA NeMo Guardrails Use Cases
Add content safety checks to LLM inputs and outputs
Detect and block jailbreak attempts
Keep conversations within predefined topics
Detect and mask personally identifiable information
Validate tool calls in LLM-based agents
Integrate guardrails into Python, LangChain, or LangGraph applications
NVIDIA NeMo Guardrails FAQs
It is an open-source Python package for adding programmable guardrails to LLM-based applications, allowing developers to block, alter, or validate inputs and model responses.
Rails are guardrail stages that run at different points of an LLM interaction: input, retrieval, dialog, execution, and output.
Configuration uses YAML files for models, prompts, rails, and runtime settings, plus Colang flows for conversational flows and guardrail logic.
Yes. Custom Python actions, LangChain tools, and third-party API integrations can extend guardrails with application-specific checks.
You can use the Python SDK directly, run a guardrails server exposing OpenAI-style chat completions endpoints, or use LangChain and LangGraph integrations.
Yes. It provides tool-call validation, agent workflow protection with LangGraph, and action monitoring for LLM-based agents that use tools.
The same YAML and Colang configuration can be used with the NeMo Guardrails microservice, a container image deployed on Kubernetes with Helm.
Documented use cases include content safety, jailbreak protection, topic control, PII detection and masking, and agentic security.