Garak (Generative AI Red-teaming & Assessment Kit) is a free, open-source command-line vulnerability scanner and red-teaming tool developed by NVIDIA to test large language models (LLMs). [1, 2]
Often described as Nmap or Metasploit for artificial intelligence, Garak automates adversarial testing to find security flaws before malicious actors can exploit them. [1, 2]
What Garak Does
Garak assesses AI models and chat systems by firing specialized test suites ("probes") at a target model, analyzing the responses ("detectors"), and logging the results. [3, 4]
- Prompt Injection Testing: Checks whether a model can be hijacked by malicious user inputs that override original system instructions to leak data or execute unauthorized actions. [5, 6]
- Jailbreak Detection: Tests safety guardrails using techniques like encoded payloads, persona adoption, and "DAN" (Do Anything Now) style attacks. [7, 8]
- Data Leakage: Probes whether the model accidentally regurgitates sensitive training data, private user info, or restricted system prompts. [7, 8]
- Toxicity and Hallucination: Evaluates if the model generates hateful content, dangerous instructions, or confident falsehoods. [7, 8]
Core Components
- Probes: Collections of test prompts and attack templates (over 150 different attacks and thousands of prompts) targeting specific vulnerabilities. [4]
- Generators: The interface that connects Garak to the target backend—supporting platforms like OpenAI, Hugging Face, Ollama, AWS Bedrock, and NVIDIA NIM. [1, 4]
- Detectors: The evaluation layer (using string matching, classifiers, or secondary LLM judges) that grades whether the model failed or resisted the probe. [4]
- Reporting: Outputs detailed logs, console summaries, and JSONL / HTML hitlogs for review or integration into CI/CD pipelines. [3, 6]
How to Run It
You install Garak via Python and run scans directly from your terminal: [8]
(You can explore official documentation and updates on the garak website or the NVIDIA/garak GitHub repository). [1, 9]
If you're looking to use Garak, let me know:
- What type of model or platform you are testing (e.g., local Ollama, Hugging Face, OpenAI API)
- Which specific vulnerability you are most concerned about (prompt injection, data leakage, jailbreaking)
I can help you build the right command or interpret the scan results.
No comments:
Post a Comment