As large language models (LLMs) increasingly enable agentic AI systems capable of autonomous reasoning and tool use, they also introduce critical safety risks, including goal misalignment, hallucinations, and prompt injections. Enterprises are challenged to harness open-weight models' flexibility without compromising on trust, security, or compliance. As regulations tighten across regions and industries, non-compliance becomes a persistent challenge.
With this safety recipe, enterprises can now confidently adopt open models, aligned to their policy. Start with model evaluation using garak vulnerability scanning with curated risk prompts, benchmarking against enterprise thresholds. Then, post-train using recipes and safety datasets to close critical safety and security gaps. Deploy the hardened model as a trusted NVIDIA NIM and then add inference run-time safety protection with NVIDIA NeMo Guardrails that actively block unsafe model behavior. With continuous monitoring, and collaboration between AI and risk teams, model safety becomes enforceable, not aspirational.
For guidelines and suggestions about the process, refer to Best Practices for Developing a Model Behavior Guide.
This repository is what powers the build experience, helping you harden security at every stage of the AI development lifecycle.
You can deploy this blueprint in a ready-to-use hardware and software environment as a Brev launchable by going to the build experience page and clicking Deploy on Cloud. Alternatively, refer to the notebooks README for deployment instructions.
- Contents
- Architecture
- Key Features
- Minimum System Requirements
- Software Used in This Blueprint
- Target Audience
- Prerequisites
- Quickstart Guide
- Ethical Considerations
- License
- Terms of Use
This safety recipe is broken down into four steps, which map to a typical agentic workflow environment:
- Safety, security, and accuracy evaluation of models and systems
- Post-training with NVIDIA curated datasets
- Deploying the trusted model as a NIM
- Running the trusted model with NVIDIA NeMo Guardrails at inference
- Evaluation pipelines for content safety with Nemotron Content Safety Dataset V2 and WildGuardMix Dataset utilizing NeMo Eval
- Security evaluation pipeline with NVIDIA garak
- Dataset blend with 4 datasets and on-policy prompt generation with the target model
- Post-training (SFT) with NeMo Framework RL
- Easy-to-understand safety and security reports
- Packaging and deploying the trusted model with NIM
- Integrating with NeMo Guardrails for inference-time safety
- Self-hosted Main LLM: 8 × (NVIDIA H100 or A100 GPUs 80GB)
- Storage: 300GB
- Minimum System Memory: 128GB
- Python 3.12
- Docker Container: nvcr.io/nvidia/nemo:25.04
- Docker Engine
- NVIDIA NeMo Framework RL - Post-training library for models ranging from 1 GPU to 100B+ parameters
- NVIDIA NeMo Framework Eval - Scalable, cloud-native framework to create, customize, and deploy the latest AI models
- NVIDIA NIM - Microservices for accelerating the deployment of foundation models agnostic of cloud or datacenter
- NVIDIA NeMo Guardrails - Programmable logic at inference runtime to safeguard agentic AI applications
- NVIDIA NemoGuard Content Safety - Multilingual model that detects unsafe interactions between humans and LLMs
- NVIDIA Garak - Open-source red teaming tool to scan vulnerabilities like hallucination, prompt injection, and jailbreaks
- Nemotron Content Safety Dataset V2
- Gretel Synthetic Safety Alignment Dataset
- HarmfulTasks
- Llama Nemotron Post Training Dataset
- JaiBreakV-28k/ReadTeam 2k
- WildGuardMix
- AI developers and engineers
- Research teams focused on AI safety and security
- Product managers overseeing model deployment
- Compliance and regulatory teams
- A personal NVIDIA API key with the
NGC catalog
andPublic API Endpoints
services selected. - A Hugging Face token so that you can download models and datasets from the hub.
Run the following notebooks:
- Setup
- Evaluating the Base Model for Safety and Accuracy
- Fine-tuning for Safety and Accuracy
- Evaluating the Fine-tuned Model
Optionally, you can Run Inference with the Fine-Tuned Model and NeMo Guardrails
NVIDIA believes Trustworthy AI is a shared responsibility, and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their supporting model team to ensure the models meet requirements for the relevant industry and use case and address unforeseen product misuse. For more detailed information on ethical considerations for the models, please see the Model Card++, Explainability, Bias, Safety & Security, and Privacy Subcards. Please report security vulnerabilities or NVIDIA AI concerns.
Use of this developer example notebook is governed by the Apache 2.0 License.
The software and materials are governed by the NVIDIA Software License Agreement and the Product-Specific Terms for NVIDIA AI Products, except that models are governed by the AI Foundation Models Community License Agreement and the NVIDIA RAG dataset is governed by the NVIDIA Asset License Agreement. ADDITIONAL INFORMATION: for Meta/llama-3.1-70b-instruct model, the Llama 3.1 Community License Agreement, for nvidia/llama-3.2-nv-embedqa-1b-v2 model, the Llama 3.2 Community License Agreement. Built with Llama.