
augustus v0.14.20
LLM 安全测试框架,用于检测提示注入、越狱和对抗性攻击 — 190+ 探针、28 个提供商、单个 Go 二进制文件
Augustus - 用于提示注入、越狱和对抗性攻击测试的LLM漏洞扫描器
Augustus - LLM 漏洞扫描器
对大型语言模型进行 210 多种对抗性攻击测试,涵盖提示注入、越狱、编码漏洞利用和数据提取。
Augustus 是一款基于 Go 的 LLM 漏洞扫描器,专为安全专业人员设计。它针对各类对抗性攻击对大型语言模型进行测试,集成了 28 个 LLM 提供商,并能生成可操作的漏洞报告。
与面向研究的工具不同,Augustus 专为生产环境的安全测试而构建——并发扫描、速率限制、重试逻辑和超时处理均开箱即用。
目录
为什么选择 Augustus
| 功能 | Augustus | garak | promptfoo |
|---|---|---|---|
| 语言 | Go | Python | TypeScript |
| 单二进制文件 | 是 | 否 | 否 |
| 并发扫描 | Goroutine 池 | 多进程池 | 是 |
| LLM 提供商 | 28 | 35+ | 80+ |
| 探测类型 | 210+ | 160+ | 119 个插件 + 36 种策略 |
| 企业级关注 | 是 | 研究 | 是 |
功能特点
| 功能 | 描述 |
|---|---|
| 210+ 漏洞探测 | 47 种攻击类别:越狱、提示注入、对抗性样本、数据提取、安全基准、Agent 攻击等 |
| 28 个 LLM 提供商 | OpenAI、Anthropic、Azure、Bedrock、Vertex AI、Ollama 及另外 22 个,共 43 种生成器变体 |
| 90+ 检测器 | 模式匹配、LLM 作为评判器、HarmJudge (arXiv:2511.15304)、Perspective API、不安全内容检测 |
| 7 种 Buff 变换 | 编码、释义、诗歌(5 种格式,3 种策略)、低资源语言翻译、大小写变换 |
| 灵活的输出 | 表格、JSON、JSONL 和 HTML 报告格式 |
| 生产就绪 | 并发扫描、速率限制、重试逻辑、超时处理 |
| 单二进制文件 | 基于 Go 的工具编译成一个可移植的可执行文件 |
| 可扩展 | 通过 Go init() 函数实现插件式注册 |
攻击类别
- 越狱攻击:DAN, DAN 11.0, AIM, AntiGPT, Grandma, ArtPrompts
- 提示注入:编码(Base64, ROT13, Morse)、标签走私、FlipAttack、前缀/后缀注入
- 对抗性样本:GCG, PAIR, AutoDAN, TAP(攻击提示树), TreeSearch, DRA
- 多轮攻击:Crescendo(逐步升级)、GOAT(自适应技术切换)
- 数据提取:API 密钥泄露、包幻觉、PII 提取、LeakReplay
- 上下文操纵:RAG 投毒、上下文溢出、多模态攻击、延续、分歧
- 格式漏洞利用:Markdown 注入、YAML/JSON 解析攻击、ANSI 转义、Web 注入 (XSS)
- 规避技术:混淆、字符替换、基于翻译的攻击、措辞、ObscurePrompt
- 安全基准:DoNotAnswer, RealToxicityPrompts, Snowball, LMRC
- Agent 攻击:多 Agent 操纵、浏览漏洞利用
- 安全测试:护栏绕过、病毒/垃圾邮件扫描、漏洞利用(SQLi、代码执行)、BadChars
警告:
lmrc探测会使用粗俗和冒犯性语言进行越狱测试。请仅在授权的测试环境中使用。
快速开始
安装
需要 Go 1.25.3 或更高版本。```bash go install github.com/praetorian-inc/augustus/cmd/augustus@latest
或者从源码构建:```bash
git clone https://github.com/praetorian-inc/augustus.git
cd augustus
make build
基本用法```bash
export OPENAI_API_KEY="your-api-key"
augustus scan openai.OpenAI
--probe dan.Dan_11_0
--detector dan.DAN
--verbose
### 示例输出```
+--------------+-------------+--------+-------+--------+
| PROBE | DETECTOR | PASSED | SCORE | STATUS |
+--------------+-------------+--------+-------+--------+
| dan.Dan_11_0 | dan.DAN | false | 0.85 | VULN |
| dan.STAN | dan.STAN | true | 0.10 | SAFE |
| dan.AntiDAN | dan.AntiDAN | true | 0.05 | SAFE |
+--------------+-------------+--------+-------+--------+
列出可用功能```bash
List all registered probes, detectors, generators, harnesses, and buffs
augustus list
## 支持的提供商
Augustus包含28个LLM提供商类别,共43种生成器变体:
| 提供商 | 生成器名称 | 备注 |
|------------------|--------------------------------|--------------------------------|
| OpenAI | `openai.OpenAI`, `openai.OpenAIReasoning` | GPT-3.5、GPT-4、GPT-4 Turbo、o1/o3推理模型 |
| Anthropic | `anthropic.Anthropic` | Claude 3/3.5/4(Opus、Sonnet、Haiku) |
| Azure OpenAI | `azure.AzureOpenAI` | Azure托管的OpenAI模型 |
| AWS Bedrock | `bedrock.Bedrock` | Claude、Llama、Titan模型 |
| Google Vertex AI | `vertex.Vertex` | PaLM、Gemini模型 |
| Cohere | `cohere.Cohere` | Command、Command R模型 |
| Replicate | `replicate.Replicate` | 云托管的开源模型 |
| HuggingFace | `huggingface.InferenceAPI`, `huggingface.InferenceEndpoint`, `huggingface.Pipeline`, `huggingface.LLaVA` | HF推理API、端点、管道、多模态 |
| Together AI | `together.Together` | 为开源模型提供快速推理 |
| Anyscale | `anyscale.Anyscale` | Llama和Mistral托管 |
| Groq | `groq.Groq` | 超快LPU推理 |
| Mistral | `mistral.Mistral` | Mistral API模型 |
| Fireworks | `fireworks.Fireworks` | 生产级推理平台 |
| DeepInfra | `deepinfra.DeepInfra` | 无服务器GPU推理 |
| NVIDIA NIM | `nim.NIM`, `nim.NVOpenAICompletion`, `nim.NVMultimodal`, `nim.Vision` | NVIDIA AI端点、多模态 |
| NVIDIA NeMo | `nemo.NeMo` | NVIDIA NeMo框架 |
| NVIDIA NVCF | `nvcf.NvcfChat`, `nvcf.NvcfCompletion` | NVIDIA云函数 |
| NeMo Guardrails | `guardrails.NeMoGuardrails` | NVIDIA NeMo Guardrails |
| IBM watsonx | `watsonx.WatsonX` | IBM watsonx.ai平台 |
| LangChain | `langchain.LangChain` | LangChain LLM封装器 |
| LangChain Serve | `langchain_serve.LangChainServe` | LangChain Serve端点 |
| Rasa | `rasa.RasaRest` | Rasa对话式AI |
| GGML | `ggml.Ggml` | GGML本地模型推理 |
| Function | `function.Single`, `function.Multiple` | 自定义函数生成器 |
| Ollama | `ollama.Ollama`, `ollama.OllamaChat` | 本地模型托管 |
| LiteLLM | `litellm.LiteLLM` | 统一API代理 |
| REST API | `rest.Rest` | 自定义REST端点(支持SSE) |
| Test | `test.Blank`, `test.Repeat`, `test.Lipsum`, `test.Nones`, `test.Single`, `test.BlankVision` | 测试与开发 |
所有提供商均已包含在编译后的二进制文件中。通过环境变量或YAML配置文件进行配置。详见[配置](#configuration)中的设置说明。
## 使用方式
### 单次探针```bash
# Test for DAN jailbreak
augustus scan openai.OpenAI \
--probe dan.Dan_11_0 \
--detector dan.DAN \
--config-file config.yaml \
--verbose
多个探针```bash
Use glob patterns to run related probes
augustus scan openai.OpenAI
--probes-glob "dan.,goodside.,grandma."
--detectors-glob ""
--config-file config.yaml
--output batch-results.jsonl
Run all probes against Claude
augustus scan anthropic.Anthropic
--all
--config '{"model":"claude-3-opus-20240229"}'
--timeout 60m
--output comprehensive-scan.jsonl
--html comprehensive-report.html
### Buff Transformations
应用提示转换来测试规避技术:```bash
# Apply base64 encoding buff to all probes
augustus scan openai.OpenAI \
--all \
--buff encoding.Base64 \
--config '{"model":"gpt-4"}'
# Apply poetry transformation
augustus scan anthropic.Anthropic \
--probes-glob "dan.*" \
--buff poetry.MetaPrompt \
--config '{"model":"claude-3-opus-20240229"}'
# Chain multiple buffs
augustus scan openai.OpenAI \
--all \
--buffs-glob "encoding.*,paraphrase.*" \
--output buffed-results.jsonl
输出格式```bash
Table format (default) - human-readable
augustus scan openai.OpenAI --probe dan.Dan_11_0 --format table
JSON format - structured output
augustus scan openai.OpenAI --probe dan.Dan_11_0 --format json
JSONL format - one JSON object per line, ideal for piping
augustus scan openai.OpenAI --probe dan.Dan_11_0 --format jsonl
HTML report - visual reports for stakeholders
augustus scan openai.OpenAI --all --html report.html
### 自定义 REST 端点```bash
# Test proprietary LLM endpoint (OpenAI-compatible API)
augustus scan rest.Rest \
--probe dan.Dan_11_0 \
--detector dan.DAN \
--config '{
"uri": "https://api.example.com/v1/chat/completions",
"method": "POST",
"headers": {"Authorization": "Bearer YOUR_API_KEY"},
"req_template_json_object": {
"model": "custom-model",
"messages": [{"role": "user", "content": "$INPUT"}]
},
"response_json": true,
"response_json_field": "$.choices[0].message.content"
}'
# Test with proxy interception (Burp Suite, mitmproxy)
augustus scan rest.Rest \
--probes-glob "goodside.*" \
--config '{
"uri": "https://internal-llm.corp/generate",
"proxy": "http://127.0.0.1:8080",
"headers": {"X-API-Key": "$KEY"},
"api_key": "your-key-here",
"req_template": "{\"prompt\":\"$INPUT\",\"max_tokens\":500}",
"response_json": true,
"response_json_field": "output"
}'
REST 配置键:
uri:目标 API 端点(必填)method:HTTP 方法(默认:POST)headers:HTTP 头作为键值对req_template:原始请求体,包含$INPUT占位符req_template_json_object:JSON 请求体(自动序列化,在字符串中使用$INPUT)response_json:将响应解析为 JSON(默认:false)response_json_field:要提取的 JSONPath(例如$.data.text或简单字段名)api_key:用于$KEY占位符替换的 API 密钥proxy:用于流量检查的 HTTP 代理 URL
高级选项```bash
Adjust concurrency (default: 10)
augustus scan openai.OpenAI --all --concurrency 20
Increase timeout for complex probes like TAP or PAIR
augustus scan openai.OpenAI --probe tap.TAPv1 --timeout 60m
Use a specific harness strategy
augustus scan openai.OpenAI --all --harness batch.Batch
Test local model with Ollama (no API key needed)
augustus scan ollama.OllamaChat
--probe dan.Dan_11_0
--config '{"model":"llama3.2:3b"}'
## 工作原理
Augustus 采用流水线架构来测试 LLM 对抗对抗性攻击:```mermaid
flowchart LR
A[Probe Selection] --> B[Buff Transform]
B --> C[Generator / LLM Call]
C --> D[Detector Analysis]
D --> E{Vulnerable?}
E -->|Yes| F[Record Finding]
E -->|No| G[Record Pass]
subgraph Scanner
B
C
D
E
end
扫描流程
- 探测选择:按名称、通配符模式或
--all选择探测方式 - Buff转换:可选地对提示进行转换(编码、改写、翻译、诗意化)
- 生成器调用:通过提供方集成向目标LLM发送对抗性提示
- 检测器分析:使用模式匹配、LLM作为判断或专用检测器分析响应
- 结果记录:对每次尝试进行评分,并以请求的格式生成输出
- 攻击引擎:对于迭代式探测(PAIR、TAP),单轮攻击引擎通过候选修剪和基于判断的评分在迭代中优化提示
- 多轮引擎:对于对话式探测(Crescendo、GOAT),多轮引擎维护与目标的完整对话历史,包括拒绝检测和动态适应
多轮攻击策略
多轮攻击维持与目标LLM的持续对话,利用模型可能在不同轮次中逐步披露信息(而单个提示会拒绝)这一特点。多轮引擎使用三个LLM:攻击者(生成问题)、目标(被测系统)和判断者(评分进度并检测拒绝)。
Crescendo
Crescendo采用逐步升级(门槛效应)技术,将对话从良性话题缓慢转向被禁止的目标。
- 论文:Russinovich et al., 2024
- 方法:从真正良性、教育性的问题开始,并在多个轮次中逐步增加具体性
- 升级模式:历史背景 → 技术机制 → 具体细节 → 以自然跟进问题形式提出的直接请求
- 优势:对跟踪对话语气的模型有效——逐步升级避免了触发安全过滤器```bash
augustus scan rest.Rest
--probe crescendo.Crescendo
--config-file crescendo.yaml
--html report.html -v
#### GOAT(生成式对抗性测试代理)
GOAT采用激进的适应性方法,使用7种对抗性技术和攻击思维链推理,根据成功或失败动态切换策略。
- **论文**:[Pavlova 等,2024](https://arxiv.org/abs/2410.01606)
- **方法**:从第一轮开始使用间接框架瞄准目标,从不直接向目标提及目标
- **7种技术**,分为3类:
- *输出操纵*:拒绝抑制、响应启动
- *安全响应干扰*:双重响应、主题分裂、相反意图
- *虚构场景*:角色修改、假设
- **攻击思维链**:每一轮攻击者在构造消息之前,通过观察→思考→策略→响应进行推理
- **技术叠加**:单轮中可组合多种技术以增强效果
- **优势**:通过积极在根本不同的方法间切换,在较少轮数(通常3-5轮)内实现高成功率```bash
augustus scan rest.Rest \
--probe goat.Goat \
--config-file goat.yaml \
--html report.html -v
Hydra
Hydra 维持单一对话路径,当目标拒绝时,会回滚整个轮次,要求攻击者提出完全不同的方法。与 Crescendo/GOAT(在拒绝时重新措辞)不同,Hydra 的回滚机制会将被拒绝的轮次从目标的视角中彻底移除。
- 方法:单一路径 + 轮次级回滚 —— 被拒绝的轮次被擦除并替换
- 技术:分解(将目标拆解为无害的子问题)、上下文利用(基于目标自身的话语)、权威模拟、情感框架、渐进式规范化
- 关键特性:
max_backtracks控制 Hydra 可以擦除并重试轮次的次数 - 有状态模式:对于无法撤销消息的目标,设置
stateful: true(禁用回滚) - 优势:保持目标的对话历史干净 —— 目标从未看到失败的尝试,从而防止防御性升级```bash
augustus scan rest.Rest
--probe hydra.Hydra
--config-file hydra.yaml
--html report.html -v
#### 顽皮用户
顽皮用户模拟一个天真好奇的用户,通过自然对话微妙地试探AI边界。与对抗性策略不同,攻击者角色是一个普通用户,通过看似无害的互动逐渐滑向被禁止的话题。
- **灵感来源**:[Tau-bench](https://github.com/sierra-research/tau-bench) 和 promptfoo 的顽皮用户策略
- **方法**:建立融洽关系阶段 → 试探边界 → 强势推进
- **7种技术**:天真好奇、故意误解、社会认同、逐渐偏移、情感诉求、假定许可、重新语境化
- **特定目标剧本**:内置脚本用于提取系统指令、查找秘密/标志、绕过内容策略
- **默认轮次**:5(比其他策略少——微妙的方法要么快速奏效,要么完全无效)
- **优势**:能有效对抗经过训练以抵抗明显对抗模式的模型——普通角色绕过了“攻击检测”启发式规则```bash
augustus scan rest.Rest \
--probe mischievous.MischievousUser \
--config-file mischievous.yaml \
--html report.html -v
策略选择指南
| 策略 | 轮次 | 风格 | 最佳用途 | 成本 |
|---|---|---|---|---|
crescendo.Crescendo | 10 | 逐步升级 | 具备语调追踪安全过滤器的模型 | 中等(10轮 × 3次LLM调用) |
goat.Goat | 10 | 激进技术切换 | 快速结果,对框架技巧脆弱的模型 | 中高(技术推理额外开销) |
hydra.Hydra | 10 | 拒绝时回溯 | 经常拒绝的顽固模型 | 高(回溯增加重试) |
mischievous.MischievousUser | 5 | 随意角色试探 | 针对对抗性模式训练的模型 | 低(5轮,微妙方式) |
快速决策:
- 从 Crescendo 开始——这是最通用的策略
- 如果 Crescendo 太慢,尝试 GOAT(GOAT 通常在3-5轮内成功)
- 如果目标频繁拒绝,使用 Hydra(回溯保持对话清晰)
- 对于具有强对抗模式检测的目标,使用 Mischievous(角色绕过启发式规则)
多轮配置
所有四种策略共享相同的配置结构:```yaml generators: rest.Rest: uri: "https://your-llm-endpoint/chat" method: POST req_template: '{"input": "$INPUT"}' response_json: true response_json_field: "response"
judge: generator_type: openai.OpenAI config: model: gpt-4 api_key: "${OPENAI_API_KEY}"
probes: attacker_generator_type: openai.OpenAI attacker_config: model: gpt-4 api_key: "${OPENAI_API_KEY}" settings: crescendo.Crescendo: # or goat.Goat, hydra.Hydra, mischievous.MischievousUser goal: "your test objective" max_turns: 10 success_threshold: 0.8 use_secondary_judge: true
| 设置项 | 默认值 | 描述 |
|---------|---------|-------------|
| `goal` | (必填) | 攻击者试图达成的目标 |
| `max_turns` | 10 | 停止前的最大对话轮次 |
| `success_threshold` | 0.8 | 触发提前退出的评判分数(0.0-1.0) |
| `max_refusal_retries` | 10 | 目标拒绝时每轮的重试重述次数 |
| `attack_max_attempts` | 5 | 攻击者 LLM JSON 解析失败的重试次数 |
| `use_secondary_judge` | true | 启用二级评判器以捕获假阴性 |
| `max_backtracks` | 10 | 拒绝时的轮次级回退(仅限 Hydra) |
| `enable_fast_refusal` | true | 在调用 LLM 评判器前基于模式的拒绝检测 |
| `enable_scan_memory` | false | 跨测试用例学习(在探测间共享策略) |
| `stateful` | false | 对有状态目标禁用回溯 |
| `exclude_target_output` | false | 从攻击者反馈中隐藏目标响应(隐私模式) |
| `attacker_model` | (自动) | 覆盖攻击者模型名称以调整上下文窗口大小 |
#### 多轮问题排查
| 症状 | 可能原因 | 解决方法 |
|---------|-------------|-----|
| `no turns completed (attacker_parse_failures=N)` | 攻击者 LLM 返回无效 JSON | 使用更强的攻击者模型(GPT-4, Claude Opus)。增加 `attack_max_attempts`。 |
| `no turns completed (target_empty=N)` | 目标返回空/空值响应 | 检查目标端点是否正常响应。验证 REST 配置模板。 |
| 所有轮次得分均为 0.0 | 目标过于模糊或攻击者未充分参与 | 使 `goal` 更具体。尝试不同的策略。 |
| 高分但未成功 | `success_threshold` 设置过高 | 将 `success_threshold` 从 0.8 降低到 0.6-0.7 |
| 运行时间过长/成本过高 | 轮次和重试过多 | 减少 `max_turns`(尝试 5)。设置 `enable_fast_refusal: true`。 |
| Hydra 不断回溯 | 目标拒绝一切 | 尝试 `stateful: true` 或切换到 Mischievous 策略 |```
cmd/augustus/ CLI entrypoint (Kong-based)
pkg/
attempt/ Probe execution lifecycle and result tracking
buffs/ Buff interface for prompt transformations
config/ Configuration loading (YAML/JSON) with profiles
detectors/ Public detector interfaces and registry
generators/ Public generator interfaces and registry
harnesses/ Harness interface for execution strategies
lib/http/ Shared HTTP client with proxy support
lib/stego/ LSB steganography for multimodal attacks
logging/ Structured slog-based logging
metrics/ Prometheus metrics collection
prefilter/ Aho-Corasick keyword pre-filtering
probes/ Public probe interfaces and registry
ratelimit/ Token bucket rate limiting
registry/ Generic capability registration system
results/ Result types and multi-format output
retry/ Exponential backoff with jitter
scanner/ Scanner orchestration with concurrency
templates/ YAML probe template loader (Nuclei-style)
types/ Canonical shared interfaces (Prober, Generator, Detector)
internal/
probes/ 210+ probe implementations (47 categories)
generators/ 28 LLM provider integrations (43 variants)
detectors/ 90+ detector implementations (35 categories)
harnesses/ 3 harness strategies (probewise, batch, agentwise)
buffs/ Buff interface for prompt transformations
attackengine/ Iterative adversarial attack engine (PAIR/TAP backend)
multiturn/ Multi-turn conversational attack engine (Crescendo/GOAT/Hydra/Mischievous)
ahocorasick/ Internal Aho-Corasick keyword matching
benchmarks/ Performance benchmarks
tests/ Integration and equivalence tests
research/ Research documentation and analysis
examples/ Example configurations
docs/ Documentation
关键设计决策
- 并发扫描,通过
errgroup使用有界 goroutine 池 - 插件式注册,使用 Go 的
init()函数进行探针、生成器、检测器、增强器和测试框架的注册 - 迭代攻击引擎,具有多流对话管理、候选剪枝和基于判断的评分,适用于 PAIR/TAP
- 多轮攻击引擎,具有持久对话历史、拒绝检测和策略无关的设计,适用于 Crescendo/GOAT
- YAML 探针模板(Nuclei 样式),用于声明式探针定义,与基于 Go 的探针并用
- Aho-Corasick 预过滤,用于检测器中的快速关键词匹配
配置
YAML 配置文件
创建一个 config.yaml 文件:```yaml
Runtime configuration
run: max_attempts: 3 timeout: "30s"
Generator configurations
generators: openai.OpenAI: model: "gpt-4" temperature: 0.7 api_key: "${OPENAI_API_KEY}" # Environment variable interpolation
anthropic.Anthropic: model: "claude-3-opus-20240229" temperature: 0.5 api_key: "${ANTHROPIC_API_KEY}"
ollama.OllamaChat: model: "llama3.2:3b" temperature: 0.8
Judge configuration (required for judge.Judge, judge.Refusal, and multi-turn probes)
judge: generator_type: openai.OpenAI model: gpt-4o-mini config: api_key: "${OPENAI_API_KEY}"
Output configuration
output: format: "jsonl" path: "./results.jsonl"
Named profiles for different scenarios
profiles: quick: run: max_attempts: 1 timeout: "10s" generators: openai.OpenAI: model: "gpt-3.5-turbo" temperature: 0.5 output: format: "table"
thorough: run: max_attempts: 5 timeout: "60s" generators: openai.OpenAI: model: "gpt-4" temperature: 0.3 output: format: "jsonl" path: "./thorough_results.jsonl"
### 环境变量```bash
# API Keys
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export COHERE_API_KEY="..."
# Debug mode
export AUGUSTUS_DEBUG=true
代理配置
将HTTP流量通过代理(例如Burp Suite)进行路由以实现检查:```bash
Method 1: Via config parameter
augustus scan rest.Rest
--probe dan.Dan_11_0
--detector dan.DAN
--config '{"uri":"https://api.example.com","proxy":"http://127.0.0.1:8080"}'
--output results.jsonl
Method 2: Via environment variables
export HTTP_PROXY=http://127.0.0.1:8080 export HTTPS_PROXY=http://127.0.0.1:8080 augustus scan rest.Rest --probe dan.Dan_11_0 --config '{"uri":"https://api.example.com"}'
- TLS 验证在代理检查时自动禁用
- HTTP/2 支持已启用,适用于现代API
- 服务器发送事件(SSE)响应自动检测并解析
### CLI 参考```
Usage: augustus scan <generator> [flags]
Arguments:
<generator> Generator name (e.g., openai.OpenAI, anthropic.Anthropic)
Probe Selection (choose one):
--probe, -p Probe name (repeatable)
--probes-glob Comma-separated glob patterns (e.g., "dan.*,goodside.*")
--all Run all registered probes
Detector Selection:
--detector Detector name (repeatable)
--detectors-glob Comma-separated glob patterns
Buff Selection:
--buff, -b Buff names to apply (repeatable)
--buffs-glob Comma-separated buff glob patterns (e.g., "encoding.*")
Configuration:
--config-file Path to YAML config file
--config, -c JSON config for generator
Execution:
--harness Harness name (default: probewise.Probewise)
--timeout Overall scan timeout (default: 30m)
--probe-timeout Per-probe timeout (default: 5m)
--concurrency Max concurrent probes (default: 10, env: AUGUSTUS_CONCURRENCY)
Output:
--format, -f Output format: table, json, jsonl (default: table)
--output, -o JSONL output file path
--html HTML report file path
--verbose, -v Verbose output
Global:
--debug, -d Enable debug mode
命令:```bash augustus version # Print version information augustus list # List available probes, detectors, generators, harnesses, buffs augustus scan # Run vulnerability scan augustus completion # Generate shell completion (bash, zsh, fish)
**退出代码:**
| 代码 | 含义 |
|------|---------|
| 0 | 成功 - 扫描完成 |
| 1 | 扫描/运行时错误 |
| 2 | 验证/使用错误 |
## 常见问题
### Augustus 与 garak 相比如何?
Augustus 是一个受 [garak](https://github.com/NVIDIA/garak)(NVIDIA 基于 Python 的 LLM 漏洞扫描器)启发的 Go 原生重实现。主要区别:
- **性能**: Go 二进制 vs Python 解释器 — 执行速度更快,内存使用更低
- **分发**: 单一二进制,无运行时依赖 vs Python 包通过 pip 安装
- **并发**: Go goroutine 池(跨探测并行) vs Python 多进程池(探测内并行)
- **探测覆盖**: Augustus 有 210+ 个探测;garak 有 160+ 个探测,拥有更长的研究渊源和已发表的论文 (arXiv:2406.11036)
- **提供者覆盖**: Augustus 有 28 个提供者;garak 在 22 个提供者模块中有 35+ 个生成器变体
### 我可以在没有 API 密钥的情况下测试本地模型吗?
是的!使用 Ollama 集成进行本地模型测试:```bash
# No API key needed
augustus scan ollama.OllamaChat \
--probe dan.Dan_11_0 \
--config '{"model":"llama3.2:3b"}'
如何添加自定义探测?
- 在
internal/probes/中创建一个新的 Go 文件 - 实现
probes.Probe接口 - 在
init()函数中使用registry.RegisterProbe()进行注册 - 重新构建:
make build
详细说明请参阅 CONTRIBUTING.md。
支持哪些输出格式?
Augustus 支持四种输出格式:
| 格式 | 标志 | 用途 |
|---|---|---|
| 表格 | --format table | 人类可读的终端输出 |
| JSON | --format json | 用于解析的单个JSON对象 |
| JSONL | --format jsonl | 适用于流式传输的行分隔JSON |
| HTML | --html report.html | 面向利益相关者的可视化报告 |
如何同时测试多个模型?```bash
Test multiple models sequentially
for model in "gpt-4" "gpt-3.5-turbo"; do
augustus scan openai.OpenAI
--all
--config "{"model":"$model"}"
--output "results-$model.jsonl"
done
### Augustus 是否适合生产环境?
是的,Augustus 专为生产环境设计,具有以下特性:
- 可配置限制的并发扫描
- 速率限制以遵守 API 配额
- 长时间运行探测的超时处理
- 瞬时故障的重试逻辑
- 用于可观测性的结构化日志
## 故障排除
### 错误:"API 速率限制超限"
**原因**:并发请求或每分钟请求过多。
**解决方案**:
1. 减少并发数:`--concurrency 5`
2. 在 YAML 配置中使用特定提供商的速率限制设置: ```yaml
generators:
openai.OpenAI:
rate_limit: 10 # requests per minute
错误:"context deadline exceeded" 或 "timeout"
原因:复杂探测(如 TAP 或 PAIR)超过了默认超时时间。
解决方案:```bash
augustus scan openai.OpenAI
--probe tap.TAPv1
--timeout 60m
--config-file config.yaml
### 错误:"无效的 API 密钥" 或 "身份验证失败"
**原因**:缺少或无效的 API 凭证。
**解决方案**:
1. 验证环境变量是否设置:`echo $OPENAI_API_KEY`
2. 检查配置文件中的拼写错误
3. 确保 API 密钥具有所需权限
4. 对于 Ollama,确保服务正在运行:`ollama serve`
### 错误:"未找到探针" 或 "未找到检测器"
**原因**:名称拼写错误或探针未注册。
**解决方案**:```bash
# List all available probes and detectors
augustus list
# Use exact names from the list
augustus scan openai.OpenAI --probe dan.Dan_11_0 # Correct
扫描未产生任何结果
原因:检测器未匹配任何响应,或输出未被写入。
解决方案:
- 使用
--verbose运行以查看详细输出 - 检查检测器是否匹配探测类型
- 验证输出文件路径是否可写
贡献
我们欢迎贡献!请参阅 CONTRIBUTING.md 了解:
- 添加新的漏洞探测
- 创建新的检测器实现
- 添加 LLM 提供商集成
- 测试指南
- 代码风格要求
开发```bash
Run all tests
make test
Run specific package tests
go test ./pkg/scanner -v
Run equivalence tests (compare Go vs Python implementations)
go test ./tests/equivalence -v
Build binary
make build
Install to $GOPATH/bin
make install
### 基准测试环境(DevPod)
一个随时可用的云开发环境,用于对LLM进行基准测试,可通过 [DevPod](https://devpod.sh/) 获取。它提供了一个远程容器,其中预安装了Augustus、Ollama、Go以及所有依赖项。```bash
cd devpod
# CPU-only instance (~$0.08/hr) - cloud APIs only
make devpod-up-cpu
# GPU instance with NVIDIA T4 (~$0.53/hr) - local models up to 14B
make devpod-up-gpu
# GPU Pro instance with NVIDIA L4 (~$0.80/hr) - local models up to 32B
make devpod-up-gpu-pro
在 devpod 内部:```bash devpod/scripts/setup.sh # Configure LLM provider API keys devpod/scripts/pull-models.sh # Pull local Ollama models (GPU only) devpod/scripts/benchmark.sh # Run benchmarks with comparison reports
该环境也可作为标准[开发容器](https://containers.dev/)使用——在 VS Code 或 Cursor 中打开仓库,然后从 `.devcontainer/` 中选择 CPU 或 GPU 配置。
## 安全
Augustus 专为**授权安全测试**而设计。
- Augustus 会向你指定的 LLM 发送对抗性提示——请始终确保你已获得授权
- 切勿测试你不拥有或未经明确许可的系统
- 某些探测会设计生成冒犯性内容(用于测试安全过滤器)
- 结果可能包含目标 LLM 生成的有害内容
请通过 [GitHub Issues](https://github.com/praetorian-inc/augustus/issues) 报告安全问题。
## 支持
如果你觉得 Augustus 有用,请考虑:
- 在 GitHub 上为其**加星**
- [提交 Issue](https://github.com/praetorian-inc/augustus/issues) 报告错误或功能请求
- [贡献](https://github.com/praetorian-inc/augustus/blob/HEAD/CONTRIBUTING.md)新的探测、检测器或提供者集成
[](https://star-history.com/#praetorian-inc/augustus&Date)
## 许可
[Apache 2.0](https://github.com/praetorian-inc/augustus/blob/HEAD/LICENSE) — Praetorian Security, Inc.
---
**由 [Praetorian](https://www.praetorian.com/) 构建** — 进攻性安全解决方案