--- id: nemoguardrails version: "0.23.0" license: LICENSE.md license_treatment: permissive maintenance: active --- # nemoguardrails — NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems. License: permissive · Maintenance: active · Downloads: 407.2K/mo ## What it is and what it does NeMo Guardrails is an NVIDIA open-source library that inserts a programmable control layer between your application code and an LLM. It lets you define rules—called rails—that shape how the LLM responds: rejecting unsafe inputs, preventing jailbreaks and prompt injections, enforcing topic boundaries, masking sensitive data, and steering conversations along predefined paths. The library supports five rail types (input, dialog, retrieval, execution, output) and works with multiple LLM providers. You configure guardrails via YAML and Python files in a standard folder structure, then instantiate an LLMRails object and call generate() or generate_async() instead of the LLM directly. The API mirrors OpenAI's Chat Completions format, so integration requires minimal code changes. It's async-first internally but exposes both sync and async methods, and includes built-in protections against common LLM vulnerabilities like jailbreaks and hallucinations. Use it for: - Add fact-checking and output moderation to retrieval-augmented generation (RAG) systems - Build domain-specific chatbots that stay on topic and follow predefined conversation flows - Protect custom LLM endpoints from jailbreaks and prompt injection attacks - Mask sensitive data (PII, credentials) in user input before the LLM sees it - Enforce authentication and support workflows in conversational applications ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds programmable guardrails to LLM-based conversational applications to control output behavior, prevent unsafe responses, and enforce structured dialog flows. Yes, if you are building LLM-based conversational applications and need safety controls. The library is actively maintained, has no known vulnerabilities, supports current Python versions, and low install friction. The 18 dependencies are standard ecosystem packages. Permissive licensing allows commercial use. Main consideration: evaluate whether the guardrails configuration overhead and async-first design fit your application architecture. ## Install pip install nemoguardrails uv add nemoguardrails poetry add nemoguardrails ## Installing nemoguardrails Before you install: Low install friction with a pure-Python wheel. Active maintenance with recent release (44 days old) and 6951 repository stars. Requires Python 3.10–3.13; 18 runtime dependencies including aiohttp, pydantic, and onnxruntime add moderate weight but are standard ecosystem packages. License in practice: Permissive license (Apache-2.0 primary with Other/Proprietary noted in classifiers). No restrictions on commercial use or modification; review LICENSE.md for any dual-licensing details if proprietary clauses apply. Quickstart: from nemoguardrails import LLMRails, RailsConfig config = RailsConfig.from_path("PATH/TO/CONFIG") rails = LLMRails(config) completion = rails.generate( messages=[{"role": "user", "content": "Hello world!"}] ) Requires Python 3.10, 3.11, 3.12, or 3.13. Guardrails configuration folder with config.yml, config.py, and actions.py must be provided. Verify before relying: - Performance overhead of guardrails layer relative to direct LLM calls - Compatibility with specific LLM providers beyond those listed in documentation - Memory footprint with all 18 runtime dependencies loaded ## Package facts - License: LICENSE.md (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 407.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llm safety guardrails, prompt injection protection, conversational ai safety, llm output moderation, jailbreak prevention, rag safety layer, llm behavior control, llm-safety, conversational-ai, prompt-engineering [View on SkillFed](https://skillfed.io/packages/nemoguardrails) · [View on PyPI](https://pypi.org/project/nemoguardrails/)