NeMo Guardrails is an open-source Python library that applies configurable input, output, and tool-call checks to conversational apps, RAG pipelines, and agents.
Overview
NeMo Guardrails lets teams declare what agents and chat applications may do through policy configuration, mixing fast local rules with model-backed checks for jailbreaks, injected instructions, and unsafe tool use. Agents that run commands, call APIs, query data, and read the web can be gated at prompts, responses, retrieved content, and tool boundaries.
You define rails, models, and prompts in configuration files, then run the library inside your Python process or deploy it as a standalone server. Check mode keeps your application in control of LLM and tool execution while sending relevant payloads to the library for verdicts; proxy mode routes generation through the library so input and output rails run on the traffic path.
Supported patterns include conversational moderation, RAG grounding and sensitive-data handling, tool-call and tool-result validation, regex and CEL rules, LLM self-checks, third-party moderation APIs, and hooks for coding agents. Integrations span the Python SDK, a Checks API, a gateway server, and a hooks server.
The library is Apache 2.0 licensed and designed to run with your choice of local detectors or hosted inference endpoints. Configurations can align with the separate NeMo Guardrails microservice so policies can move between local development and production deployment.
Key features
- YAML and Colang policy configuration
- Input and output content safety rails
- Tool-call and tool-result validation
- Jailbreak and injection detection
- PII detect and mask integrations
- Check mode and proxy mode runtimes
- Checks API and gateway server
- Hooks server for coding agents
Use cases
- Gate agent tool calls before execution
- Moderate chat inputs and model outputs
- Filter RAG context and verify answers
- Shared guardrails service for many apps
- Refund or policy limits without a live LLM