|
7 | 7 | "source": [ |
8 | 8 | "# Garak Scenarios\n", |
9 | 9 | "\n", |
10 | | - "The Garak scenario family implements encoding-based probes inspired by the\n", |
11 | | - "[Garak](https://github.com/NVIDIA/garak) framework. These test whether a target model can be\n", |
12 | | - "tricked into producing harmful content when prompts are encoded in various formats.\n", |
| 10 | + "The Garak scenario family implements probes inspired by the\n", |
| 11 | + "[Garak](https://github.com/NVIDIA/garak) framework. These include encoding-based probes (which\n", |
| 12 | + "test whether a target can be tricked into producing harmful content when prompts are encoded in\n", |
| 13 | + "various formats) and web-injection probes (which test whether a target emits markdown\n", |
| 14 | + "data-exfiltration or cross-site-scripting payloads).\n", |
13 | 15 | "\n", |
14 | 16 | "For full programming details, see the\n", |
15 | 17 | "[Scenarios Programming Guide](../code/scenarios/0_scenarios.ipynb)." |
|
198 | 200 | "cell_type": "markdown", |
199 | 201 | "id": "5", |
200 | 202 | "metadata": {}, |
| 203 | + "source": [ |
| 204 | + "## WebInjection\n", |
| 205 | + "\n", |
| 206 | + "Ports Garak's `web_injection` probe family. Tests whether the target can be coaxed into emitting\n", |
| 207 | + "web-injection payloads: markdown-image data exfiltration (CSRF-style) and cross-site-scripting\n", |
| 208 | + "(XSS). Each strategy pairs a `SeedObjective` (the goal) with a `SeedPrompt` (the literal\n", |
| 209 | + "injection prompt) and scores the response with the markdown-injection or XSS output scorer.\n", |
| 210 | + "\n", |
| 211 | + "**CLI example:**\n", |
| 212 | + "\n", |
| 213 | + "```bash\n", |
| 214 | + "pyrit_scan garak.web_injection --target openai_chat --strategies xss --max-dataset-size 1\n", |
| 215 | + "```\n", |
| 216 | + "\n", |
| 217 | + "**Available strategies** (8 probes): MarkdownImageExfil, ColabAIDataLeakage,\n", |
| 218 | + "StringAssemblyDataExfil, PlaygroundMarkdownExfil, MarkdownURIImageExfilExtended,\n", |
| 219 | + "MarkdownURINonImageExfilExtended, TaskXSS, MarkdownXSS.\n", |
| 220 | + "\n", |
| 221 | + "**Aggregate strategies:** `ALL` (all 8), `DEFAULT` (excludes the two combinatorial extended\n", |
| 222 | + "probes), `EXFIL` (the 6 markdown-exfil probes), and `XSS` (TaskXSS + MarkdownXSS)." |
| 223 | + ] |
| 224 | + }, |
| 225 | + { |
| 226 | + "cell_type": "markdown", |
| 227 | + "id": "6", |
| 228 | + "metadata": {}, |
201 | 229 | "source": [ |
202 | 230 | "For more details, see the [Scenarios Programming Guide](../code/scenarios/0_scenarios.ipynb) and\n", |
203 | 231 | "[Configuration](../getting_started/configuration.md)." |
|
0 commit comments