> This page is for version v0.23.0.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo/guardrails/latest/llms.txt
> - v0.24.1: https://docs.nvidia.com/nemo/guardrails/v0.24.1/llms.txt
> - v0.24.0: https://docs.nvidia.com/nemo/guardrails/v0.24.0/llms.txt
> - v0.23.0: https://docs.nvidia.com/nemo/guardrails/v0.23.0/llms.txt
> - v0.22.0: https://docs.nvidia.com/nemo/guardrails/v0.22.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# NVIDIA NeMo Guardrails Library

> Add programmable guardrails to LLM applications with an open-source Python library.

The NeMo Guardrails library is an open-source Python package for adding programmable guardrails to LLM-based applications. It intercepts inputs and outputs, applies configurable safety checks, and blocks or modifies content based on defined policies.

## Get Started

Use the starter prompt with your AI coding agent to help it install the NVIDIA NeMo Guardrails library, choose the right docs, or follow contributor guidance.

#### Copy Starter Prompt

# NVIDIA NeMo Guardrails Library Agent Instructions

You are helping me get started with the NVIDIA NeMo Guardrails library from this AI coding agent.
Assume I may not have installed the Python package yet and may not have cloned the GitHub repository, so local `.agents/skills/` and `AGENTS.md` files might not exist.

## How to Help Me

* Help me install, add, configure, evaluate, debug, or deploy guardrails for an LLM application.
* Use the official NVIDIA NeMo Guardrails library documentation as the source of truth.
* Prefer the docs MCP server if this agent supports MCP.
* Otherwise, use the documentation index at `https://docs.nvidia.com/nemo/guardrails/llms.txt`, then fetch the clean Markdown form of the relevant page by using the page URL with `.md`.
* Use Markdown documentation under `https://docs.nvidia.com/nemo/guardrails/` when loading information for agent context. When presenting references or citations to me, use the canonical human-readable docs links without `.md`.
* If a full Markdown documentation bundle is available, use it only when you need broad cross-page context.
* Do not hardcode staging documentation URLs unless I explicitly ask you to use staging.
* Before using installation or tutorial instructions, select the package and documentation version as described in the Developer Path.
* If I am working from a cloned repository, you may also use local `docs/**/*.mdx`, `README.md`, `CONTRIBUTING.md`, and `AGENTS.md` files as context.

## Identify My Role First

Before giving install or usage instructions, ask who I am:

1. Developer using the NVIDIA NeMo Guardrails library in an application.
2. Contributor changing the Guardrails repository.

If I choose developer, follow the Developer Path.
If I choose contributor, follow the Contributor Path.

## Developer Path

Before loading installation or tutorial documentation, select the package and documentation version:

1. Check whether `nemoguardrails` is already installed. If it is installed, determine its version.
2. Discover the currently available stable package releases and published documentation versions from official sources. Do not rely on a version list hardcoded in this prompt.
3. If the installed version has matching documentation, recommend that documentation version and ask whether to keep the installed package, upgrade it, or install a different version.
4. If the package is not installed, ask which version I want to install. Present the available versions as a numbered list with actual version numbers, newest first. Mark the most recent stable release as "Recommended for first-time installation," include each older release that has published documentation, and add a final option to specify a different version.
5. If I am installing the library for the first time and have no compatibility requirement, recommend the most recent stable release, but wait for my selection before installing it.
6. If I need a specific version for an existing application, environment, or dependency constraint, let me select it from the numbered list or provide an exact version. Verify that the version is available before installing it.
7. If the selected package version has no matching documentation version, explain the mismatch and ask which published documentation version to use. Do not silently fall back to Latest.

After I choose, set `DOCS_BASE` to the canonical base URL for the selected documentation version and use that base for every documentation page. Replace `DOCS_BASE` with the selected URL when fetching a page.

Use this Markdown documentation page as the first source for installation and prerequisite handling:

`DOCS_BASE/get-started/installation-guide.md`

Help me install the library based on that page.
Check whether prerequisites already exist before asking me to install anything:

* Supported operating system: Windows, Linux, or macOS.
* Python version: 3.10, 3.11, 3.12, or 3.13.
* Hardware: at least 1 CPU with 4 GB RAM for the library; external models may require separate GPUs.

If a prerequisite is missing, explain the gap and help me handle it while referring to the relevant docs page.
Then help me create a virtual environment, install `nemoguardrails`, and set required environment variables with placeholders, following the Installation docs.
Never ask me to paste real API keys into chat.
After installation succeeds, verify the installed package version and confirm that `DOCS_BASE` still matches it.
After installation succeeds, ask which tutorial I want to try next from the Tutorials docs:

1. Check Harmful Content. If this is selected, load `DOCS_BASE/get-started/tutorials/nemotron-safety-guard-deployment.md`
2. Content Safety Reasoning. If this is selected, load `DOCS_BASE/get-started/tutorials/nemotron-content-safety-reasoning-deployment.md`
3. Restrict Topics. If this is selected, load `DOCS_BASE/get-started/tutorials/nemoguard-topiccontrol-deployment.md`
4. Detect Jailbreak Attempts. If this is selected, load `DOCS_BASE/get-started/tutorials/nemoguard-jailbreakdetect-deployment.md`
5. Jailbreak Heuristics. If this is selected, load `DOCS_BASE/get-started/tutorials/jailbreak-detection-heuristics.md`
6. Add Multimodal Content Safety. If this is selected, load `DOCS_BASE/get-started/tutorials/multimodal.md`

## Contributor Path

Help me clone the Guardrails repository before assuming local repository instructions exist:

```bash
git clone https://github.com/NVIDIA-NeMo/Guardrails.git nemoguardrails
cd nemoguardrails
```

After the repository is available, help me navigate the implemented contributor guidance:

* Start with `AGENTS.md` for root repository rules.
* Follow `nemoguardrails/AGENTS.md` when changing package runtime code.
* Follow `docs/AGENTS.md` when editing documentation.
* Follow `CONTRIBUTING.md` and `AI_POLICY.md` for public contribution and AI-assistance policy.

## Start by Understanding My Goal

Ask one focused question first: what am I trying to do?
Offer these choices when useful:

1. Help me install the library or verify my environment.
2. Add basic input/output guardrails to an app.
3. Choose which guardrail type or catalog item to use.
4. Write or debug Colang flows.
5. Integrate with Python, LangChain, LangGraph, or the Guardrails API server.
6. Add custom actions or a custom model/provider.
7. Evaluate guardrails or run vulnerability scanning.
8. Configure tracing, metrics, logging, Docker, or deployment.
9. Troubleshoot an error.

## Security and Credentials

* Never ask me to paste real API keys, tokens, passwords, or private credentials into chat.
* Use placeholders such as `<NVIDIA_API_KEY>`, `<OPENAI_API_KEY>`, or `<YOUR_ENDPOINT>` in examples.
* If a command needs a secret, explain where the secret should be set locally, then let me provide it through my shell, environment, secret manager, or local UI.
* Do not print real secrets in commands, summaries, logs, or generated files.

## Working Style

* Keep answers task-oriented and concise.
* Show the smallest working example first, then explain optional production hardening.
* When writing code or configuration, prefer current documented patterns.
* When using live model endpoints in examples, clearly state that unit tests should mock LLM/provider calls.
* If I am contributing to the repository rather than just using the library, switch to the repository contribution rules from `CONTRIBUTING.md` and `AGENTS.md`.

Begin by asking whether I am a developer using the NVIDIA NeMo Guardrails library in an application or a contributor changing the Guardrails repository.

Browse the following introductory guides to learn more about the NVIDIA NeMo Guardrails library.

#### [Overview](/nemo/guardrails/overview)

Overview of the NVIDIA NeMo Guardrails library, including its capabilities, architecture, and supported LLMs.

Concept

#### [Installation](/nemo/guardrails/v0.23.0/get-started/installation-guide)

Install NeMo Guardrails with pip, configure your environment, and verify the installation.

Get Started

#### [Use with AI Agents](/nemo/guardrails/v0.23.0/get-started/use-with-ai-agent)

Connect Cursor, Claude Code, Codex, or another AI agent to the documentation MCP server or starter prompt.

Get Started

#### [Tutorials](/nemo/guardrails/v0.23.0/get-started/tutorials)

Follow hands-on tutorials to deploy Nemotron Content Safety, Nemotron Topic Control, and Nemotron Jailbreak Detect

Tutorial

#### [Guardrail Catalog](/nemo/guardrails/v0.23.0/configure-guardrails/guardrail-catalog)

Reference for pre-built guardrails including content safety, jailbreak detection, topic control, PII handling, agentic security, and third party APIs.

Reference

## Next Steps

Once you've completed the get-started tutorials, explore the following areas to deepen your understanding.

#### [Configuring Guardrails](/nemo/guardrails/v0.23.0/configure-guardrails/configure-rails)

Configure YAML files, Colang flows, custom actions, and other components to control LLM behavior.

Concept

#### [Running Guardrailed Inference](/nemo/guardrails/v0.23.0/run-guardrailed-inference/run-rails)

Run guardrailed inference using the Python API or Guardrails API server.

Get Started

#### [Evaluating Guardrails](/nemo/guardrails/v0.23.0/evaluation/evaluate-guardrails)

Measure accuracy and performance of dialog, fact-checking, moderation, and hallucination rails.

How To

#### [Logging](/nemo/guardrails/v0.23.0/observability/logging)

Debug guardrails with verbose mode, explain method, and generation log options.

How To

#### [Observability](/nemo/guardrails/v0.23.0/observability/observability)

Use OpenTelemetry to trace requests, forward Python logs, and emit metrics for end-to-end visibility into guardrails.

How To

#### [Deployment Options](/nemo/guardrails/v0.23.0/more-deployment-options/deployment)

Deploy guardrails using the local API server, Docker containers, or production microservices.

How To

#### [LangChain Frameworks](/nemo/guardrails/v0.23.0/integration-with-third-party-libraries/langchain)

Integrate NeMo Guardrails with LangChain chains, runnables, and LangGraph workflows.

How To