Modular LLM vulnerability scanner that probes for hallucination, data leakage, prompt injection, jailbreaks, and toxicity using static, dynamic, and adaptive probes across multiple model providers.

Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

This repository contains the scanner component for Greenbone Community Edition.
Generative AI Red-teaming & Assessment Kit
garak checks if an LLM-backed application can be made to fail in a way we don't want. It has more than 190 probes and growing, covering hallucination, data leakage, prompt injection, misinformation, toxicity generation, jailbreaks, and many other weaknesses. If you know nmap or msf / Metasploit Framework, garak does somewhat similar things.
garak works with anything from a bare model to a full application with guardrails and tools around it. It combines static, dynamic, and adaptive probes.
garak's a free tool. We love developing it and are always interested in adding functionality to support applications.
garak is built from a few kinds of plugins:
garak to the system you're testingcurrently supports:
llmgarak is a command-line tool. It runs on Linux, macOS and Windows.
pipJust grab it from PyPI and you should be good to go:
python -m pip install -U garak
pipThe standard pip version of garak is updated periodically. To get a fresher version from GitHub, try:
python -m pip install -U git+https://github.com/NVIDIA/garak.git@main
garak has its own dependencies. You can to install garak in its own Conda 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 .
OK, if that went fine, you're probably good to go!
Note: if you cloned before the move to the NVIDIA GitHub organisation, but you're reading this at the github.com/NVIDIA URI, please update your remotes as follows:
git remote set-url origin https://github.com/NVIDIA/garak.git
The general syntax is:
garak <options>
garak needs to know what target to scan, and by default, it'll try all the active probes it knows on that target, using the vulnerability detectors recommended by each probe. You can see a list of probes, with inactive ones marked 💤, using:
garak --list_probes
To specify a generator, use the --target_type and, optionally, the --target_name options. Target type specifies a generator family/interface; target name specifies the exact model or endpoint to be used. The "Intro to generators" section below describes some of the generators supported. A straightforward generator family is Hugging Face models; to load one of these, set --target_type to huggingface and --target_name to the model's name on Hub (e.g. "RWKV/rwkv-4-169m-pile"). Some generators might need an API key to be set as an environment variable, and they'll let you know if they need that.
garak runs all active probes by default, but you can be specific about that too. --spec probes.promptinject will use only the PromptInject framework's methods, for example. You can also specify one specific plugin instead of a plugin family by adding the plugin name after a .; for example, --spec probes.lmrc.SlurUsage will use an implementation of checking for models generating slurs based on the Language Model Risk Cards framework.
For help and inspiration, find us on Twitter or discord!
Probe a commercial model for encoding-based prompt injection (macOS/Linux) (replace example value with a real OpenAI API key)
export OPENAI_API_KEY="sk-123XXXXXXXXXXXX"
python3 -m garak --target_type openai --target_name gpt-5-nano --spec probes.encoding
See if the Hugging Face version of GPT2 is vulnerable to DAN 11.0
python3 -m garak --target_type huggingface --target_name gpt2 --spec probes.dan.Dan_11_0
For each probe loaded, garak will print a progress bar as it generates. Once generation is complete, a row evaluating that probe's results on each detector is given. If any of the prompt attempts yielded an undesirable behavior, the response will be marked as FAIL, and the failure rate given.
Here are the results with the encoding module on a GPT-3 variant:

And the same results for ChatGPT:

We can see that the more recent model is much more susceptible to encoding-based injection attacks, where text-babbage-001 was only found to be vulnerable to quoted-printable and MIME encoding injections. The figures at the end of each row, e.g. 840/840, indicate how many text generations seemed to behave OK, and then the total. The figure can be quite high because more than one generation is made per prompt - by default, 5.