garak, LLM vulnerability scanner
Generative AI Red-teaming & Assessment Kit
garak checks if an LLM can be made to fail in a way we don't want. garak probes for 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 to them, but for LLMs.
garak focuses on ways of making an LLM or dialog system fail. It combines static, dynamic, and adaptive probes to explore this.
garak's a free tool. We love developing it and are always interested in adding functionality to support applications.
Get started
> See our user guide! docs.garak.ai
> Join our Discord!
> Project links & home: garak.ai
> Twitter: @garak_llm
> DEF CON slides!
LLM support
currently supports:
- hugging face hub generative models
- replicate text models
- openai api chat & continuation models
- aws bedrock foundation models
- litellm
- pretty much anything accessible via REST
- gguf models like llama.cpp version >= 1046
- .. and many more LLMs!
Install:
garak is a command-line tool. It's developed in Linux and OSX.
Standard install with pip
Just grab it from PyPI and you should be good to go:
python -m pip install -U garak
Install development version with pip
The 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
Clone from source
garak has its own dependencies. You can to install garak in its own Conda environment:
conda create --name garak "python>=3.10,<=3.12"
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
Getting started
The general syntax is:
garak <options>
garak needs to know what mode