Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adds programmable guardrails to LLM applications via Colang, covering moderation, topic restriction, fact-checking, and dialog flow control.
74% 78%+4 ptsof test cases passed
Passed 18 of 23 test cases with the skill, and 17 of 23 without it.
Write Python code using NeMo Guardrails to register a topic named 'politics' with a danger level of 3 on an existing `rails` instance.
The code calls rails.register_topic with politics.
3 of 3 safety checks passed
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.
uv pip install nemoguardrails
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
# 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."
Published skills whose descriptions closely match this one, with their benchmark result.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.