# Nvidia Nemo Guardrails

> Nvidia Nemo Guardrails is an Agent Skill for agent building published in the mkurman/zorai repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

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.

- Skill name: `nvidia-nemo-guardrails`
- Category: [Agent Building](https://www.openparable.com/skill/agent-building/1)
- Source: https://github.com/mkurman/zorai/blob/HEAD/skills/scientific-skills/nvidia-nemo-guardrails/SKILL.md
- Repository: mkurman/zorai (320 GitHub stars when collected)

## SKILL.md

## 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: https://www.openparable.com/skill/agent-building/nvidia-nemo-guardrails (OpenParable). Cite the canonical URL above.
