NeMo Guardrails

NeMo Guardrails

What is

NeMo Guardrails

?

NeMo Guardrails is an open-source Python library that adds programmable guardrails to LLM applications, blocking, altering or validating unsafe, off-topic, malicious or policy-violating user inputs and model responses.

At a glance

Attribute

Value

Primary use case

Programmable safety and policy guardrails for LLM applications and agents

Deployment type

Self-managed Python library; container microservice on Kubernetes with Helm

Pricing model

Open source (Apache-2.0), free

API compatibility

Python SDK; HTTP server with OpenAI-style /v1/chat/completions

Supported integrations

Including LangChain, LangGraph, NemoGuard NIMs, LlamaGuard, ActiveFence, Cisco AI Defense, Microsoft Presidio

Source type

Open

AEP branch

Agent Infrastructure

AEP category

Governance

AEP subcategory

Agent Security

AEP detail

Output Guardrails

Profile

NeMo Guardrails sits between application code and the LLM. A guardrails configuration defines the LLMs to use and any number of rails. YAML files set models, prompts and active rails. Colang, a Python-like modeling language, defines conversational flows and event-driven behavior. Custom Python actions, tools or external APIs add application-specific checks. A configuration with no rails simply forwards requests to the LLM.

Focus

Developers building chatbots, RAG question answering, custom LLM endpoints and tool-using agents who need to enforce safety and policy rules without rewriting the application or model backend.

Background

Developed by NVIDIA as part of the NVIDIA NeMo suite of microservices, tools and libraries. The library is released under the Apache-2.0 license.

Features

Five rail types

Input, retrieval and output rails can reject or alter user messages, retrieved RAG chunks and model responses, for example to mask sensitive data. Dialog and execution rails govern how the LLM is prompted and how tool calls are handled.

Content safety and jailbreak detection

Combines LLM self-checking, heuristic pattern detection, NVIDIA NemoGuard models and community or third-party services. Inputs and outputs are screened for harmful content and bypass attempts.

Topic control with Colang

Dialog and topical rails written in Colang keep conversations within defined subject boundaries. They can also steer the bot along predefined paths, such as authentication or support procedures.

PII detection and masking

Detects sensitive entities in inputs, outputs and retrieved content through GLiNER-PII, Microsoft Presidio, Private AI, Polygraf, AutoAlign or GuardrailsAI validators. Matching content is either blocked or masked.

Agentic security

Execution rails validate tool inputs and outputs before and after invocation, and agent actions are logged and traced. LangGraph integration for multi-agent workflows requires the LangChain opt-in.

Python SDK and guardrails server

Applications either call the LLMRails Python API directly or send requests to a server exposing OpenAI-style endpoints such as /v1/chat/completions.

Pros and cons

Pros

  • Layered safety and policy enforcement around LLM calls, without changing the underlying model or application architecture.

  • Configurations move unchanged from local development with the library to production on the microservice.

  • The generate method uses the OpenAI Chat Completions message format, so switching calls from the LLM to the guardrails layer needs minimal code changes.

Cons

  • The library is self-managed: the team runs, scales and maintains it within its own Python application or server.

  • NVIDIA states the built-in guardrails may not suit every production use case, so teams must validate them against their own requirements.

  • Dialog and topic rails require learning Colang, a purpose-built modeling language.

  • The production microservice deploys on Kubernetes with Helm, which teams without a cluster must adopt first.

FAQs

What is NeMo Guardrails?

It is an NVIDIA Python package for adding guardrails to LLM-based applications. It checks and controls what users send to the model and what the model returns.

How is NeMo Guardrails licensed?

The library is open source under the Apache License 2.0. Teams can use and modify it at no cost.

How can NeMo Guardrails be deployed?

Teams can embed the library in their own Python environment or run it as a guardrails server. For production, NVIDIA offers a container-based microservice installed on Kubernetes through Helm, and it reads the same YAML and Colang configuration.

Which LLMs and frameworks does it work with?

It works with multiple models, including OpenAI GPT-3.5 and GPT-4, LLaMa-2, Falcon, Vicuna and Mosaic. It also integrates with LangChain and LangGraph.

Can applications not written in Python use it?

Yes. The guardrails server accepts HTTP/REST requests in an OpenAI-style chat completions format, so any application that can make HTTP calls can route traffic through it.

Can I add my own guardrail logic?

Yes. Custom checks can be written as Python actions or registered as LangChain tools. Teams can also connect external moderation and validation services.

Table of contents

Every piece of research we publish. Nothing else.

One weekly digest of new reports, market guides, interviews, and benchmarks. No drip sequences, no product pitches, and we don't hand your address to a sponsor. Unsubscribe in one click.

Weave Intelligence may collect information about your activity on our website.

To learn more, please read our Privacy Policy.

© 2026 Weave Intelligence. All rights reserved.

Every piece of research we publish. Nothing else.

One weekly digest of new reports, market guides, interviews, and benchmarks. No drip sequences, no product pitches, and we don't hand your address to a sponsor. Unsubscribe in one click.

Weave Intelligence may collect information about your activity on our website.

To learn more, please read our Privacy Policy.

© 2026 Weave Intelligence. All rights reserved.