---
name: nvidia-nemo-guardrails-382e2f0a2481
description: "NVIDIA NeMo Guardrails — programmable guardrails for LLM applications. Colang-based dialog management, topical rails (fact-checking, moderation), safety rails, and security rails for production AI."
tags: [nemo-guardrails, llm-safety, nvidia, colang, governance, moderation, zorai]
---
## Overview

NVIDIA NeMo Guardrails provides programmable guardrails for LLM applications. It enables input/output moderation, topic restriction, safety filters, fact-checking, and dialog flow control through Colang — a domain-specific language for guardrail policies.

## Installation

```bash
uv pip install nemoguardrails
```

## Basic Guardrails

```python
from nemoguardrails import RailsConfig, LLMRails

config = RailsConfig.from_path("config")
rails = LLMRails(config)

response = rails.generate(messages=[{"role": "user", "content": "How do I hack a system?"}])
print(response["content"])  # Blocked or safe response
```

## Colang Configuration

```yaml
# config/config.yml
rails:
  input:
    flows:
      - self check input
  output:
    flows:
      - self check output

# config/prompts.yml
define user said inappropriate
  "I want to hack"

define bot refuse to respond
  "I cannot help with that request."

define flow
  user said inappropriate
  bot refuse to respond
```

## Topic Moderation

```python
from nemoguardrails import LLMRails

rails = LLMRails(config)
rails.register_topic("politics", danger_level=3)
rails.register_topic("medical_advice", danger_level=2)

response = rails.generate("What is the best treatment for covid?")
# Guardrails can restrict to general info or block entirely
```

## References
- [NeMo Guardrails docs](https://docs.nvidia.com/nemo/guardrails/)
- [Colang language guide](https://docs.nvidia.com/nemo/guardrails/colang)

---
Source attribution: mkurman
Original project: https://github.com/mkurman/zorai/blob/d06ee7597049567dab92db22d41b2764cf89094a/skills/scientific-skills/nvidia-nemo-guardrails/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 zorai contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: mkurman
Original project: https://github.com/mkurman/zorai/blob/d06ee7597049567dab92db22d41b2764cf89094a/skills/scientific-skills/nvidia-nemo-guardrails/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Product Management
Roles: Data Scientist, ML / AI Engineer, Product Manager
Specialties: API
Tools: Nemoguardrails
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 834364e86ee00f7b9c7f7caebbedc24cbeae0708581ca73f585d69a26ce6c969
