Nvidia Nemo Guardrails
Agent Buildingnvidia-nemo-guardrailsNvidia 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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/mkurman/zorai/blob/HEAD/skills/scientific-skills/nvidia-nemo-guardrails/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/nvidia-nemo-guardrails, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
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
uv pip install nemoguardrails
Basic Guardrails
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
# 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
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