Zurück zu den Updates
New releaseSep 17, 2026

Guardrails v0.24.1

Programmierbare Guardrails für LLM-Chat-Apps: Eingabe-/Ausgabe-Regeln durchsetzen, Jailbreaks und Prompt-Injections blockieren, Halluzinationen erkennen und sensible Daten maskieren.

Teilen

NVIDIA NeMo Guardrails Library

License PyPI Python Tests/Linux Tests/Windows Tests/macOS Lint Documentation Total downloads Monthly downloads

Documentation · Quickstart · Use cases · Integrations · Guardrail catalog · Examples · Community · Security · Releases · Changelog

NeMo Guardrails is an open-source library for applying programmable safety and security controls to LLM and agentic applications. Agents run commands, call APIs, query your data, and read the web. Conversational applications apply input and output checks; retrieval-augmented generation (RAG) systems filter retrieved content and check answers against evidence.

You use the NeMo Guardrails library to declare what each agent may do in a policy, combining low-latency local rules with model-backed checks for jailbreaks, injected instructions, and unsafe tool calls. Your application or agent harness runs these checks and uses their results to decide whether to continue.

pip install nemoguardrails

Requires Python 3.11–3.13. Refer to the installation guide for optional packages and setup.

[!NOTE] Version 0.25.0 deprecates LLMRails, with removal planned no earlier than 0.27.0. Use Guardrails for new integrations and follow the migration guide.

What You Can Build

How It Works

Use the NVIDIA NeMo Guardrails library to define your policy in configuration files that specify the rails, models, and prompts to use. Run the library in your Python application or deploy it as a server. Choose check mode or proxy mode based on how your application manages model requests.

Check Mode

Your application or agent harness calls the LLM and executes tools directly. At each point that requires a policy decision, send the relevant prompt, model response, tool call, or tool result to the library for checking. Use the result to handle blocked or modified content before you execute a tool, return a response, or pass a tool result to the model.

Use check_async() in Python, POST /v1/checks on the Guardrails server, or the hooks server for coding agents. For tool checks with check_async(), use the IORails engine and specify RailType.TOOL_CALL or RailType.TOOL_RESULT in rail_types. Check tool calls before execution and tool results after execution.

Check mode: your application calls the LLM and tools directly and requests checks through the Python SDK, Guardrails server, or hooks server. Configured rails return a result and can call a guardrail model.

Proxy Mode

Route model requests through the library to apply the configured input and output rails. Input rails can block a request before it reaches the application LLM. For non-streaming requests, output rails check the response before the library returns it. Blocked content produces a refusal or an error, depending on the integration and configuration.

Use generate_async() or stream_async() in Python, or POST /v1/chat/completions on the Guardrails server. Your application executes tools; supported integrations can check tool calls in model responses and tool results in subsequent requests. The gateway server also supports POST /v1/chat/completions and POST /v1/responses, but its built-in profiles do not support tool content. Each gateway /v1/responses request must include "store": false.

When output streaming is enabled for stream_async(), the default stream_first: true setting delivers chunks before checking them. To check each chunk before delivery, set rails.output.streaming.stream_first: false. For configuration details, refer to output rail streaming.

Proxy mode: your application routes model requests through the library, which applies configured rails and forwards allowed requests to the LLM. Rails can call a guardrail model. Your application executes tools.

Kategorien