NeMo Guardrails with Llama 3.1 Nemotron Safety Guard 8B

This page explains when a NeMo Guardrails content safety check should use Nemotron Safety Guard 8B, how to choose a hosted or self-hosted NIM, and how to configure, parse and test the model before it guards production traffic.

On this page

When Nemotron Safety Guard 8B belongs in your NeMo Guardrails input and output rails

If your LLM application needs input and output moderation, a self-check prompt, where the application model judges its own traffic, may not be enough. A dedicated content safety model is a separate judge that classifies each user prompt and each model response against a safety policy, so the application model is not grading its own work. NeMo Guardrails can call the Nemotron Safety Guard 8B model from its content safety rails on input and output, and this page covers how that wiring is built. The model is a good candidate for teams that want a purpose-built judge in the rail chain, that need multilingual coverage, and that can run a GPU-backed model endpoint in a place their security team will approve.

Before choosing it, confirm the model facts against NVIDIA's current model card and license terms rather than relying on this page: the supported languages, the hazard categories it labels, the context length, the license that governs commercial use, and whether the weights can be run in your own environment or only reached through a hosted endpoint. Also confirm how its output is formatted, because the rail depends on parsing that output reliably. Your evaluation should use your own policy and your own traffic, since a general safety classifier may label categories differently from your acceptable use policy.

Two platform facts shape the deployment advice. NeMo Guardrails is open source under the Apache 2.0 license, so the library itself carries no license fee. NVIDIA has, however, sunset the NeMo Guardrails microservice container, with no new releases after October 1, 2026, so a container-based deployment built on that artifact is not a supported path. The runtime you choose, whether the Python library inside your own service, a server you build from the library, or an inference gateway such as NeMo Helix, determines how the model endpoint is hosted, configured and upgraded. Settle that runtime first, then decide how the safety model reaches it.

How a user message passes through the Nemotron safety check and back

The flow starts when a user message reaches the NeMo Guardrails input rail, which calls the content safety model through its endpoint. That endpoint is either a NIM you host inside your network or a hosted NIM outside it, so the trust boundary between the two matters for data handling. The verdict is parsed: safe messages pass to the application LLM, unsafe ones are refused. The same path then repeats on the output rail before the response returns to the user. Check where the verdict is logged, and confirm which hosted endpoint terms and data flows apply before you use one.

Input and output rails call the same safety endpoint, with logs written inside your network.

Hosted or self-hosted NIM: which deployment fits your environment

This table compares a hosted NIM endpoint with a self-hosted NIM for the Nemotron Safety Guard model across the factors that usually decide the choice. Read each row against your data classification, network rules and GPU plans, and confirm the open items with NVIDIA before you commit to a design.

FactorHosted NIM endpointSelf-hosted NIM
Where prompt and response text travelsInput and output text is sent to the hosted service outside your network. Confirm the data handling terms, regions and retention with NVIDIA in writing.Text stays inside the infrastructure you control, provided the gateway and logs are also kept internal.
Control over model versionsThe provider decides when the model or serving stack changes. Ask how version changes are announced and whether a pinned version is available.You choose and pin the NIM image and model version, and schedule upgrades and retests yourself.
Network isolation and air-gapped feasibilityRequires outbound connectivity from the guardrails runtime. Not suitable for air-gapped networks.Can run on isolated networks if the container images and model artifacts are brought in through an approved process. Confirm licensing and transfer steps with NVIDIA.
GPU capacityNo GPUs needed on your side. Confirm rate limits, throughput and latency expectations for your traffic.You provision GPU capacity sized for your request volume, latency targets and any co-hosted models. Confirm supported accelerators with NVIDIA's NIM documentation.
Operational ownershipThe provider runs availability, patching and scaling. Your team owns credentials, rate handling and fallback behavior when the endpoint is unavailable.Your team owns deployment, GPU operations, health checks, patching, scaling and incident response for the model server.
Evidence for security and compliance reviewsAssessors will ask for the provider's data processing terms and subprocessor details, which you must obtain and file.Configuration, image versions, access logs and network policies are under your control and can be shown directly to reviewers.
What to confirm with NVIDIAHosting regions, data retention, logging by the provider, service levels, and whether the Nemotron Safety Guard model is available on this endpoint.Supported NIM image and tag for this model, GPU requirements, licensing for on-premises use, and the artifact transfer process for offline sites.

How the content_safety model type, prompts and output parsing work together

The content safety check is a chain of three parts, and a block or allow decision is only as reliable as the weakest link between them. The content_safety model type in config.yml tells NeMo Guardrails which model to call and where it runs. The prompt is the text the model receives for an input check or an output check, and it carries the policy: the categories the model should judge against and the instruction on how to answer. The parser then reads the model's text reply and converts it into a decision the rail can act on, such as stopping the request or letting it pass. Each part assumes something about the others, so the configuration has to be treated as one unit rather than three independent settings.

The parser and the policy categories must match the response format that Nemotron Safety Guard 8B actually produces. If the model is asked for one label format but the parser looks for another, the rail does not fail loudly. It may read every reply as safe, or it may read every reply as unsafe, and either outcome can look normal in a demo. A category list that differs from the one the model was trained to report can have the same silent effect, because the model will still answer, just not in terms the rail expects. For that reason, the first test is not a single harmful prompt but a review of the raw model output for a few known safe and unsafe inputs, confirming that the parsed decision matches what you expect.

Before you copy any key names or prompt text, confirm them against the current NeMo Guardrails documentation for content safety rails and against the model card and prompt guidance published for Nemotron Safety Guard 8B. This page does not reproduce either, so treat the exact field names, prompt wording, category identifiers and expected output format as items to verify in your installed version. Pin the library version you test against, because the configuration surface changes across releases. Record the prompt and parser pair you validated, so that any future upgrade or model swap triggers a repeat of the same raw-output review.

Setting up Nemotron Safety Guard 8B in a NeMo Guardrails configuration

This sequence takes a team from a clean Python environment to a NeMo Guardrails configuration that checks inputs and outputs with Nemotron Safety Guard 8B. Each step closes with a check the team can run, so the endpoint is proven before any rail can block traffic.

  1. Confirm the Python version

    Platform or application engineers confirm that the host or build image runs Python 3.11, 3.12 or 3.13, the versions NeMo Guardrails 0.25.0 supports. Create a dedicated virtual environment for the guardrails service so its dependencies stay separate from the application. Check: run python --version inside that environment and confirm the output starts with 3.11, 3.12 or 3.13. Any other version stops the install here, before time is spent on configuration.

  2. Install the nemoguardrails package

    Install the nemoguardrails package from PyPI, pinned to 0.25.0 so every environment runs the same release. The library is licensed under Apache 2.0, and the GitHub release notes list the 0.25.0 changes to review before you upgrade from an earlier version. Pin the version in your requirements file and record it in your change log. Check: run pip show nemoguardrails and confirm the version field reads 0.25.0, then run nemoguardrails --help to confirm the command-line tool loads.

  3. Choose a hosted or self-hosted endpoint

    The architecture lead decides where Nemotron Safety Guard 8B runs. A hosted endpoint is simpler to start with, but every prompt and response that the rail checks leaves your network. A self-hosted NIM keeps that traffic inside your infrastructure and needs GPU capacity, container hosting and an access policy for the model. Confirm the model license terms, endpoint URL, model name and authentication method in NVIDIA's current model documentation before you build. Check: record the chosen values in one configuration note that the platform and security teams both approve.

  4. Verify the endpoint answers directly

    Before NeMo Guardrails is involved, the engineer sends a direct request to the safety model endpoint with one benign prompt and one clearly unsafe prompt from your test set. This isolates network, authentication and model-name problems from configuration problems. Confirm that the endpoint returns a response in the format the model documentation describes, and that the request completes within the timeout your application will use. Check: both requests return a successful HTTP status with a readable body, and the response for the unsafe prompt differs from the benign one. Keep these requests in the repository so they can be rerun after every change.

  5. Create the model entry and content safety rail

    The engineer adds a model entry to config.yml that points at the endpoint verified in the previous step, then declares a content_safety rail that refers to that model. The application's own LLM stays a separate model entry, so the safety check and the chat model can be changed independently. Keep endpoint addresses and API keys in environment variables, outside the file that goes into version control. Check: load the folder with the nemoguardrails command-line tool or the Python API and confirm it finishes without validation errors.

  6. Add input and output rail flows

    Add the content safety flows to the input and output rail sections of config.yml, so user prompts are checked before the application model receives them and model responses are checked before users see them. Start with Colang 1.0, which is the default, unless your dialog design needs Colang 2.0. Decide the refusal message each rail returns and how the application responds when a rail blocks a request. Check: send one benign and one unsafe prompt through the loaded configuration, confirm the benign prompt reaches the application model, and confirm the unsafe prompt is blocked on the input rail.

  7. Load the configuration and run checks

    Load the configuration through the Python API or the guardrails server, then run the same test set through the path your application will use. In the Python API, the Guardrails class is the current entry point, because LLMRails is deprecated in 0.25.0 with removal planned no earlier than 0.27.0. The guardrails server loads configurations from a folder and exposes an HTTP API, and NVIDIA provides a Dockerfile for building a server image. Do not use the retired NeMo Guardrails microservice container for this build. Check: safe prompts pass, unsafe prompts are blocked on the expected rail, and the server returns the same results after the image is rebuilt.

Testing with safe and unsafe prompts before enforcing the rails

Before any rail blocks real traffic, run a fixed test set through the input and output rails and record what each prompt does. The cards below cover the six categories we would build, what a pass looks like for each, and the evidence to keep so a reviewer can rerun the same checks later.

Safe baseline set

Start with ordinary requests that your assistant must answer: product questions, account help, summaries and routine drafting. The pass condition is that none of these are blocked and that answers come back in the expected shape. A false positive on this set usually means a policy category or the output parser is too broad. Keep the prompt text, the rail decision, and the final response for each case.

Clearly unsafe prompts by category

Write a set of unambiguous violating prompts for each policy category your deployment enforces, such as violence, harassment, sexual content involving minors, or self-harm. The pass condition is that the input rail blocks each one and returns your configured refusal rather than a model answer. Record the category the guard reported, so a reviewer can see that the right policy was applied.

Borderline prompts

Include prompts that are close to a policy line, such as a security researcher asking how a known attack works, or a novelist describing a crime. Borderline cases show where the guard is too strict or too loose for your users. Passing here means the team has made and documented a decision for each case, not that every borderline prompt is blocked. Keep the expected decision next to the observed one.

Unsafe model outputs for the output rail

Test the output rail separately by feeding it unsafe completions, either from a stub model or from a fixed set of recorded responses, so the application model does not need to misbehave on cue. The pass condition is that the output rail replaces the unsafe completion before the user sees it. Confirm that the streamed and non-streamed paths both enforce the rail, since a rail that only covers one path leaves a gap.

Multilingual prompts

Build the same unsafe and safe prompts in each language your users write in, and confirm the guard classifies them in those languages. Ask the model vendor which languages the Nemotron Safety Guard model covers, because coverage claims should be verified in your own tests rather than assumed. Keep a native speaker's review of the expected labels, since translated prompts can change meaning.

Regression after upgrades and endpoint changes

Store the full test set in version control and rerun it after any change to the NeMo Guardrails version, the guard model or its tag, the NIM endpoint, the prompts, or the parser. A change is accepted only when the results match the last approved run or each difference is reviewed. Keep the run report, the version identifiers used, and the approver's sign-off with each run. Check the NeMo Guardrails release notes before upgrading, since the 0.25.0 release deprecates the LLMRails class.

Release notes

Security and data handling for hosted and self-hosted deployments

With a hosted endpoint, the guard model runs on infrastructure you do not operate. Each user prompt, and any model response the rail sends for classification, leaves your network and reaches the provider. Start the data flow review with the request payload, not the model name, and treat every classified message as data sent to a third party until your contract and documentation say otherwise.

  • Outbound text. Confirm which fields the rail sends, including system prompts, retrieved chunks and conversation history, because a guard often receives more context than the user typed.
  • Provider terms. Confirm whether prompts and verdicts are retained, for how long, whether they are used for training, and in which regions they are processed.
  • Logging and blocked requests. Ask what request logs the provider keeps and who can read them. Keep your own record of blocked requests in your gateway logs so an incident review does not depend on the provider.
  • API keys. Store the key in your secrets manager, scope it to one application, rotate it on a schedule and keep it out of config.yml and Colang files committed to source control.
  • Failure behavior. Decide whether the rail blocks or allows traffic when the endpoint times out or is unreachable, then test that path. A remote dependency adds a failure mode your network does not control.

Before approval, get the provider's written answers on retention, training use and regional processing, and check them against the terms that apply to your account.

What to confirm about the model, the NeMo runtime and the sunset before you commit

Nemotron Safety Guard 8B depends on a chain of decisions: which NeMo product you run, which NeMo Guardrails release you pin, what the model covers, and what it costs to host. Each card below names one of these limits and the person who can confirm it before you commit budget or architecture.

NeMo microservice sunset

NVIDIA's NGC catalog says NeMo microservices were sunset as of October 1, 2026, with no new releases and no support for the container. A design that pulls the NeMo Guardrails microservice image and a NIM for the safety model needs a new basis. Ask your NVIDIA account team what supported path exists for existing NeMo Microservices users and whether your NIM entitlement still applies.

NGC guardrails container

NeMo Platform and NeMo Helix

NVIDIA's archived microservices documentation says new development has moved to NeMo Platform. The repository linked from that notice now resolves to NeMo Helix, an Apache-2.0 control plane that runs NeMo Guardrails as an inference gateway middleware plugin. Confirm with NVIDIA whether Helix is the intended host for guardrail configurations and whether it fits your gateway, or whether you keep the library in your own services.

NeMo Helix guardrail docs

Python and release pinning

NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13, so hosts on older interpreters need an upgrade before installation. The latest release is 0.25.0, published in November 2026, and the previous one was 0.24.1. Your platform team should pin the exact version in a lock file, test the configuration against it, and record the pin in change control.

Supported Python
3.11 to 3.13
nemoguardrails on PyPI

LLMRails to Guardrails rename

Release 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0. Any application code that calls LLMRails will still run for now, but new code should use the new class. Your developers should read NVIDIA's 0.25 migration guide before writing the integration, and your upgrade plan should set a date to remove the old call.

NeMo Guardrails docs

Language coverage and policy categories

Ask the model owner or NVIDIA for the exact list of supported languages and the policy categories the model was trained to judge. Test your real user languages and your own harm categories with a sample set before production, since a category missing from the model's taxonomy will pass through unless you add a separate check. Your product or trust and safety lead should sign off on this list.

GPU, latency and hosting cost

Self-hosting an 8B guard model needs GPU capacity sized for your input and output volume, and every rail adds a model call to each request. Your infrastructure team should measure latency and GPU utilization on a load test, and your finance lead should price GPU hours as a recurring cost. Ask NVIDIA for the supported hardware and minimum memory before you size nodes.

Model license terms

The NeMo Guardrails library is Apache 2.0, but the Llama 3.1 Nemotron Safety Guard model carries its own license, which governs use, redistribution and commercial terms. Have legal counsel read the model license and any NVIDIA AI Enterprise terms that apply before you bake the model into a product or a container image. This license is separate from the library license.

Questions buyers ask before using Nemotron Safety Guard 8B

What drives the cost of a Nemotron guard compared with a self-check prompt?

The main difference is where the cost lands. A self-check prompt reuses the application's existing LLM, so the added cost is extra tokens per request and more latency on every call. A Nemotron Safety Guard 8B adds a separate model that needs GPU capacity, either a hosted endpoint you pay for or a self-hosted NIM on hardware you run. Cost components include the GPU hours or hosted usage, storage for model artifacts, the engineering time to wire the rail, and the evaluation work to prove the policy behaves as intended. Costs recur with traffic and with hosting, while the configuration work is largely one-time, plus revisions when policy changes. When requesting a quote, ask which of these items are included and who pays for the GPU capacity.

How long does a first Nemotron Safety Guard configuration usually take?

The duration depends mainly on what must be decided before any code is written. The largest drivers are the number of rails (input only, output only, or both), whether the model is hosted or self-hosted, how much of the policy is standard and how much is organization-specific, and how many languages must be covered. Access to GPU capacity and endpoints often sets the critical path, because the rail cannot be tested until the model answers. Test data preparation also takes time, since a useful test set needs safe and unsafe prompts that reflect real traffic. Ask the partner for a written timeline tied to a defined scope, and confirm which of these dependencies are already in place in your environment.

What does the work need from our team?

Four inputs are needed before work starts. First, GPU capacity: a self-hosted NIM needs accelerators sized for the model, or a hosted endpoint with approved network access. Second, endpoint access: the application host must reach the model endpoint, and the team must agree how traffic and credentials are handled. Third, policy owners: someone accountable must decide which categories are blocked, what the refusal says, and how edge cases are routed. Fourth, test data: representative safe and unsafe prompts in each language in scope, reviewed by people who know the business. Confirm with your platform team which of these already exist, because missing inputs usually delay the project more than the configuration itself.

Can our internal team set this up without an outside partner?

Yes, a capable platform or security engineering team can configure NeMo Guardrails and a Nemotron guard alone, since the library is Apache 2.0 licensed and the setup uses standard Python and container tooling. The harder parts are usually the ones outside the code: sizing GPU capacity, designing the policy, building a test set, and proving the rails hold up under adversarial prompts. An internal team should weigh whether it has people who can run that testing and keep the configuration current as the model and library change. A partner is often used for a fixed-scope first build, knowledge transfer, or independent testing. DeployOpen plans, implements, documents and supports these platforms inside your own infrastructure, and scope and deliverables are agreed in writing before work starts.

Does the NeMo Guardrails microservice sunset affect this design?

It affects the choice of packaging, not the core design of a rail. NVIDIA's NGC catalog page says the NeMo microservices have been sunset as of October 1, 2026, with no new releases and no continued support for that container. Its archived documentation directs existing users to their NVIDIA account team and says new development has moved to NeMo Platform. A design built on the open-source nemoguardrails Python library and a self-run server image does not depend on that container, but you should confirm the supported deployment path for your environment. The NeMo Helix documentation describes NeMo Guardrails running as an inference gateway plugin, which is a separate design decision. Ask NVIDIA which path it supports for your contract and ask your partner to document the chosen path.

What changes when we upgrade the model or the NeMo Guardrails version?

Both upgrades can change behavior, so each needs its own regression run. A new NeMo Guardrails release can change configuration handling, Python APIs and server behavior. The current release is 0.25.0, which deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0, and NVIDIA publishes a 0.25 migration guide. Colang 1.0 is the default, and NVIDIA's convert tool can move configurations to Colang 2.x, but NVIDIA says converted configurations still need manual review. A model change can shift refusal rates and category decisions even when the code is untouched. Keep the test set under version control, rerun safe and unsafe prompts after each change, and record the results as evidence before rollout.

How DeployOpen scopes, builds and tests a Nemotron-based guardrail

DeployOpen plans NeMo Guardrails with Llama 3.1 Nemotron Safety Guard 8B as a written, fixed-scope engagement. We first settle where the model will run, whether hosted or self-hosted, then build the content_safety rails, test them against safe and unsafe prompts, and hand over configuration and documentation your team can operate.

How we scope

  • Confirm which NeMo Guardrails release and Python version (3.11, 3.12 or 3.13) your environment will run.
  • Decide hosted versus self-hosted Nemotron Safety Guard serving, including GPU capacity and where traffic may flow.
  • Agree in writing which input and output rails, languages and policy categories the engagement covers.

How we build

  • Write the config.yml, Colang files and content_safety model entry against your agreed serving endpoint.
  • Build the prompt and output parsing so unsafe and safe verdicts map to the refusal behavior you approved.
  • Wire the rails into your Python application or the guardrails server image, with configuration kept in version control.

How we hand over

  • Deliver the test set of safe and unsafe prompts, with results and the policy each case checks.
  • Document the configuration, deployment steps, model serving settings and known limits of the guard.
  • Record the decisions taken during scoping so your security and compliance teams can review them later.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after handover.
  • Plan retests when the NeMo Guardrails release, the safety model or your policy text changes.
  • Confirm with your account team how the NeMo Microservices sunset affects any existing deployment before you commit.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.