经 AI Skill Hub 精选评估,LLM漏洞扫描器 获评「强烈推荐」。已获得 7.9k 颗 GitHub Star,这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.5 分,适合有一定技术背景的用户使用。
LLM漏洞扫描器 是一款基于 Python 开发的开源工具,专注于 ai、llm-evaluation、security-scanners 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
LLM漏洞扫描器 是一款基于 Python 开发的开源工具,专注于 ai、llm-evaluation、security-scanners 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install garak
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install garak
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/NVIDIA/garak
cd garak
pip install -e .
# 验证安装
python -c "import garak; print('安装成功')"
# 命令行使用
garak --help
# 基本用法
garak input_file -o output_file
# Python 代码中调用
import garak
# 示例
result = garak.process("input")
print(result)
# garak 配置文件示例(config.yml) app: name: "garak" debug: false log_level: "INFO" # 运行时指定配置文件 garak --config config.yml # 或通过环境变量配置 export GARAK_API_KEY="your-key" export GARAK_OUTPUT_DIR="./output"
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.
garak is a command-line tool. It's developed in Linux and OSX.
Just grab it from PyPI and you should be good to go:
python -m pip install -U garak
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
The general syntax is:
garak <options>
garak needs to know what model to scan, and by default, it'll try all the probes it knows on that model, using the vulnerability detectors recommended by each probe. You can see a list of probes using:
garak --list_probes
To specify a generator, use the --target_type and, optionally, the --target_name options. Model type specifies a model family/interface; model name specifies the exact model 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 the probes by default, but you can be specific about that too. --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, --probes lmrc.SlurUsage will use an implementation of checking for models generating slurs based on the Language Model Risk Cards framework.
Probe a commercial model for encoding-based prompt injection (OSX/\*nix) (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 --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 --probes dan.Dan_11_0
garak.probes.base.TextProbeimport garak.probes.mymodulep = garak.probes.mymodule.MyProbe()python3 -m garak -m test.Blank -p mymodule -d always.Passpython3 -m garak -m test.Blank -p test.Blank -d mymodulepython3 -m garak -m mymodule -p test.Blank -d always.Passgarak to list all the plugins of the type you're writing, with --list_probes, --list_detectors, or --list_generatorsWe have an FAQ here. Reach out if you have any more questions! garak@nvidia.com
Code reference documentation is at garak.readthedocs.io.
高质量的LLM漏洞扫描工具,易于使用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
AI Skill Hub 点评:LLM漏洞扫描器 的核心功能完整,质量优秀。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | garak |
| Topics | aillm-evaluationsecurity-scanners |
| GitHub | https://github.com/NVIDIA/garak |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-27 · 更新时间:2026-05-27 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。