← all repositories
NVIDIA-NeMo/Guardrails

NVIDIA's safety net for chatbots that won't just say "no"

A programmable policy layer that sits between your users and your LLM, using a custom language called Colang to enforce dialog rules without hardcoding every edge case.

6.8k stars Python Other AI
Guardrails
Velocity · 7d
+8.7
★ / day
Trend
cooling
star history

What it does

NeMo Guardrails wraps your LLM calls in a configurable policy engine. You define rules in YAML and a Python-like DSL called Colang, and the toolkit intercepts user inputs, retrieved documents, tool calls, and model outputs to enforce them. It supports OpenAI, LLaMA-2, Falcon, and others, and can run as a Python library or a standalone server.

The interesting bit

The Colang language is the unusual part. Instead of regexes or prompt engineering, you write dialog flows like define user express insult → bot express calmly willingness to help. The system compiles these into canonical forms that steer the LLM without stripping away its generative flexibility. It’s a bet that guardrails should be first-class infrastructure, not afterthought filters.

Key highlights

  • Five rail types: input, dialog, retrieval, execution, and output — each can reject, rewrite, or reroute
  • Async-first API with sync wrappers; LLMRails.generate and generate_async mirror OpenAI’s chat format
  • Optional LangChain integration via environment variable or set_default_framework("langchain")
  • Includes vulnerability scanning results for an example bot, showing jailbreak and prompt-injection coverage
  • Apache 2.0 licensed, published on arXiv with a technical evaluation

Caveats

  • Requires a C++ compiler because of the annoy dependency; platform-specific setup needed
  • README notes two versions of Colang (1.0 and another) but cuts off mid-sentence, so migration status is unclear
  • The “seamless and secure” tool connection claim is stated but not substantiated with specifics

Verdict

Worth evaluating if you’re shipping production chatbots or RAG pipelines and need auditable, version-controlled safety policies. Probably overkill for internal prototypes or cases where a simple system prompt suffices.

Frequently asked

What is NVIDIA-NeMo/Guardrails?
A programmable policy layer that sits between your users and your LLM, using a custom language called Colang to enforce dialog rules without hardcoding every edge case.
Is Guardrails open source?
Yes — NVIDIA-NeMo/Guardrails is an open-source project tracked on heatdrop.
What language is Guardrails written in?
NVIDIA-NeMo/Guardrails is primarily written in Python.
How popular is Guardrails?
NVIDIA-NeMo/Guardrails has 6.8k stars on GitHub and is currently cooling off.
Where can I find Guardrails?
NVIDIA-NeMo/Guardrails is on GitHub at https://github.com/NVIDIA-NeMo/Guardrails.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.