Thursday, December 3, 2026 | London 11°C · Drizzle
DailyGlimpse

AI

Build a Complete Defensive LLM Red-Teaming Workflow with NVIDIA garak

New tutorial: Build a complete defensive LLM red-teaming workflow using NVIDIA garak.

MarkTechPost 2 min read

Build a Complete Defensive LLM Red-Teaming Workflow with NVIDIA garak

Build a Complete Defensive LLM Red-Teaming Workflow with NVIDIA garak

In this tutorial, we explore NVIDIA garak as a practical framework for defensive LLM red-teaming. We guide you through setting up garak, discovering plugins, running dry runs and real-model scans, executing multi-probe evaluations, analyzing reports, creating custom probes and detectors, and exporting to AVID. Instead of just a single scan, we use garak end-to-end to understand how probes, detectors, generators, reports, and vulnerability scores work together in a complete LLM security testing workflow.

Setting Up NVIDIA garak and Defining Helper Functions

We begin by importing required libraries and creating a helper function to run shell commands directly from the notebook. We install garak, configure basic environment variables, and import the main garak modules. We also define a reusable function to run garak programmatically and capture the path to the generated report.

Listing garak Probes and Detectors and Running Model Scans

We inspect the garak plugin ecosystem by listing available probes, detectors, generators, and buffs. Then we run a quick dry run using the test generator to confirm garak is working without external models or API keys. After that, we scan a real Hugging Face model and run a multi-probe scan to generate a richer report for analysis.

Analyzing garak Reports: Safety Scores and Attack Success Rates

We load the generated garak report and prepare it for detailed analysis using pandas and NumPy. We first try to use garak's built-in report parser, and if unavailable, manually parse the JSONL report file. We then calculate safety scores and attack success rates, and visualize vulnerabilities across different probe-detector combinations.

Inspecting Flagged Outputs and Building a Custom garak Probe

We inspect sample hits where the detector score is high, showing which prompts triggered vulnerabilities. Finally, we demonstrate how to build a custom probe and detector to extend garak's capabilities for tailored security testing.

React