Garak red teaming: test AI systems safely

Garak red teaming is a free, open-source vulnerability scanner from NVIDIA that checks whether an LLM-backed application can be made to fail in a way you do not want, so a security engineer can find weaknesses before an attacker does. It probes for hallucination, data leakage, prompt injection, misinformation, toxicity and jailbreaks, and it is the most practical way I have seen to study the standing theme of fully automated, agentic AI-driven cyber attacks from the defender’s side.
That theme is not theoretical. Our briefing on fully automated, AI-driven attacks explains how attacks that no longer need a human at the keyboard are moving from experiment to real intrusions, and our earlier look at how ransomware groups use AI agents shows ransomware groups automating entire attacks. Before an attacker points an agent at a target, defenders need the same class of capability pointed at a system they control.
What Garak red teaming does
Garak is short for generative AI red-teaming and assessment kit. It was created by Leon Derczynski and is now maintained by NVIDIA as an open-source project with long-term support. The project is released under the Apache License 2.0.
Garak combines static, dynamic and adaptive probes, so it does not just try one fixed attack. The project compares it to nmap or Metasploit for language models: you point it at a target, it runs a battery of probes, and it reports every failing prompt and response it finds. Probe families cover hallucination, data leakage, prompt injection, misinformation, toxicity generation and jailbreaks, among many other weaknesses.
A run prints PASS and FAIL lines for each probe and detector, and produces a full report with the exact prompt, goal and response for every hit. If a detector registers a hit, that attempt is recorded as failing. The hit log can also be used to train the project’s auto red-team feature, which searches for more effective strategies, and the community adds and sharpens probes over time so coverage keeps growing.
Garak supports a wide range of targets: Hugging Face Hub generative models, Replicate text models, OpenAI API chat and continuation models, AWS Bedrock foundation models, LiteLLM, anything accessible over REST, and GGUF models such as llama.cpp. It is a command-line tool developed on Linux and macOS, and its documentation is published under the same Apache 2.0 licence.
The licence
Garak is released under the Apache License 2.0, which you can read in the licence file on the repository. Apache 2.0 is permissive: it allows use, modification and distribution, including commercially, provided the copyright and licence notices are kept and modified files carry a notice. It also grants an express patent licence from contributors, which matters for security tooling used in production, and it provides no warranty.
Installing it on Linux
Garak is a Python package on PyPI. The official documentation recommends a simple pip install:
python -m pip install -U garak
To get a fresher build from GitHub:
python -m pip install -U git+https://github.com/NVIDIA/garak.git@main
Or clone it into a dedicated environment:
conda create --name garak "python>=3.11,<=3.14"
conda activate garak
gh repo clone NVIDIA/garak
cd garak
python -m pip install -e .
Once it is installed, confirm it runs and list the probes:
python -m garak --help
python -m garak --list_probes
A concrete authorised lab use case
Run this only against a target you own or have written permission to test. The documentation warns that garak performs an exhaustive scan with some strong prompts that might be misinterpreted, so keep the target on an isolated lab network.
A good first scan is a local or lab-hosted model. The official guide uses a Hugging Face gpt2 model and a single toxicity probe:
python -m garak --model_type huggingface --model_name gpt2 --probes lmrc.Profanity
Watch the PASS and FAIL lines, then open the report and read each failing prompt and response yourself before it reaches a report or a ticket. The same idea scales up: point it at the chatbot or agent your organisation runs, work through one probe family at a time, and record what actually failed. Our guide to building a lab with Parrot OS and Kali Linux covers the network side if you need a lab first.
Risks and limits
- Data leakage. Anything you send to a target can reach the provider behind it. Keep customer data and production secrets out of prompts, and use a test account rather than a production one.
- Prompt injection. Probes inject adversarial content by design. Treat every probe prompt and model response as untrusted input.
- Hallucinated findings. A reported hit may not match the real state of the target. Check each claimed finding against the raw responses before it reaches a report.
- Licence limits. Apache 2.0 permits reuse and commercial use with notice retention, and provides no warranty. Garak moves quickly, so pin the version you tested.
- What not to send it. No production credentials, customer data, real domain contents, or systems you are not authorised to test.
Use Garak only against systems you own or have written permission to test. Using it against systems you do not have permission to test is unlawful.







