|
74 | 74 | " - `version`: Integer version number\n", |
75 | 75 | " - `strategy_class`: The strategy enum class for this scenario\n", |
76 | 76 | " - `objective_scorer_identifier`: Identifier dict for the scoring mechanism (optional)\n", |
77 | | - " - `include_default_baseline`: Whether to include a baseline attack (default: True)\n", |
78 | 77 | " - `scenario_result_id`: Optional ID to resume an existing scenario (optional)\n", |
79 | 78 | "\n", |
80 | 79 | "5. **Initialization**: Call `await scenario.initialize_async()` to populate atomic attacks:\n", |
|
83 | 82 | " - `max_concurrency`: Number of concurrent operations (default: 1)\n", |
84 | 83 | " - `max_retries`: Number of retry attempts on failure (default: 0)\n", |
85 | 84 | " - `memory_labels`: Optional labels for tracking (optional)\n", |
| 85 | + " - `include_baseline`: Whether to prepend a baseline attack (defaults to the scenario type's\n", |
| 86 | + " `BASELINE_POLICY`; most scenarios default it on, `Jailbreak` defaults it off)\n", |
86 | 87 | "\n", |
87 | 88 | "### Example Structure\n", |
88 | 89 | "\n", |
|
101 | 102 | "name": "stdout", |
102 | 103 | "output_type": "stream", |
103 | 104 | "text": [ |
104 | | - "Found default environment files: ['./.pyrit/.env', './.pyrit/.env.local']\n", |
105 | | - "Loaded environment file: ./.pyrit/.env\n", |
106 | | - "Loaded environment file: ./.pyrit/.env.local\n" |
| 105 | + "Found default environment files: ['./.pyrit/.env']\n", |
| 106 | + "Loaded environment file: ./.pyrit/.env\n" |
| 107 | + ] |
| 108 | + }, |
| 109 | + { |
| 110 | + "name": "stdout", |
| 111 | + "output_type": "stream", |
| 112 | + "text": [ |
| 113 | + "No new upgrade operations detected.\n" |
107 | 114 | ] |
108 | 115 | } |
109 | 116 | ], |
|
193 | 200 | "name": "stdout", |
194 | 201 | "output_type": "stream", |
195 | 202 | "text": [ |
196 | | - "Found default environment files: ['./.pyrit/.env', './.pyrit/.env.local']\n", |
| 203 | + "Loading default configuration file: ./.pyrit/.pyrit_conf\n", |
| 204 | + "Found default environment files: ['./.pyrit/.env']\n", |
197 | 205 | "Loaded environment file: ./.pyrit/.env\n", |
198 | | - "Loaded environment file: ./.pyrit/.env.local\n" |
199 | | - ] |
200 | | - }, |
201 | | - { |
202 | | - "name": "stdout", |
203 | | - "output_type": "stream", |
204 | | - "text": [ |
205 | 206 | "\n", |
206 | 207 | "Available Scenarios:\n", |
207 | 208 | "================================================================================\n", |
208 | 209 | "\u001b[1m\u001b[36m\n", |
209 | | - " airt.content_harms\u001b[0m\n", |
210 | | - " Class: ContentHarms\n", |
211 | | - " Description:\n", |
212 | | - " Content Harms Scenario implementation for PyRIT. This scenario contains\n", |
213 | | - " various harm-based checks that you can run to get a quick idea about\n", |
214 | | - " model behavior with respect to certain harm categories.\n", |
215 | | - " Aggregate Strategies:\n", |
216 | | - " - all\n", |
217 | | - " Available Strategies (7):\n", |
218 | | - " hate, fairness, violence, sexual, harassment, misinformation, leakage\n", |
219 | | - " Default Strategy: all\n", |
220 | | - " Default Datasets (7, max 4 per dataset):\n", |
221 | | - " airt_hate, airt_fairness, airt_violence, airt_sexual, airt_harassment,\n", |
222 | | - " airt_misinformation, airt_leakage\n", |
223 | | - "\u001b[1m\u001b[36m\n", |
224 | 210 | " airt.cyber\u001b[0m\n", |
225 | 211 | " Class: Cyber\n", |
226 | 212 | " Description:\n", |
|
229 | 215 | " Cyber class contains different variations of the malware generation\n", |
230 | 216 | " techniques.\n", |
231 | 217 | " Aggregate Strategies:\n", |
232 | | - " - all\n", |
| 218 | + " - all, single_turn, multi_turn\n", |
233 | 219 | " Available Strategies (2):\n", |
234 | | - " single_turn, multi_turn\n", |
| 220 | + " prompt_sending, red_teaming\n", |
235 | 221 | " Default Strategy: all\n", |
236 | 222 | " Default Datasets (1, max 4 per dataset):\n", |
237 | 223 | " airt_malware\n", |
|
256 | 242 | " Description:\n", |
257 | 243 | " Leakage scenario implementation for PyRIT. This scenario tests how\n", |
258 | 244 | " susceptible models are to leaking training data, PII, intellectual\n", |
259 | | - " property, or other confidential information. The Leakage class\n", |
260 | | - " contains different attack variations designed to extract sensitive\n", |
261 | | - " information from models.\n", |
| 245 | + " property, or other confidential information. Uses the registry/factory\n", |
| 246 | + " pattern to construct attack techniques.\n", |
262 | 247 | " Aggregate Strategies:\n", |
263 | | - " - all, single_turn, multi_turn, ip, sensitive_data\n", |
264 | | - " Available Strategies (4):\n", |
265 | | - " first_letter, image, role_play, crescendo\n", |
266 | | - " Default Strategy: all\n", |
| 248 | + " - all, default, single_turn, multi_turn\n", |
| 249 | + " Available Strategies (9):\n", |
| 250 | + " prompt_sending, role_play, many_shot, tap, crescendo_simulated,\n", |
| 251 | + " red_teaming, context_compliance, first_letter, image\n", |
| 252 | + " Default Strategy: default\n", |
267 | 253 | " Default Datasets (1, max 4 per dataset):\n", |
268 | 254 | " airt_leakage\n", |
269 | 255 | "\u001b[1m\u001b[36m\n", |
|
296 | 282 | " Default Datasets (1, max 4 per dataset):\n", |
297 | 283 | " airt_imminent_crisis\n", |
298 | 284 | "\u001b[1m\u001b[36m\n", |
| 285 | + " airt.rapid_response\u001b[0m\n", |
| 286 | + " Class: RapidResponse\n", |
| 287 | + " Description:\n", |
| 288 | + " Rapid Response scenario for content-harms testing. Tests model behavior\n", |
| 289 | + " across multiple harm categories using selectable attack techniques.\n", |
| 290 | + " Aggregate Strategies:\n", |
| 291 | + " - all, default, single_turn, multi_turn\n", |
| 292 | + " Available Strategies (7):\n", |
| 293 | + " prompt_sending, role_play, many_shot, tap, crescendo_simulated,\n", |
| 294 | + " red_teaming, context_compliance\n", |
| 295 | + " Default Strategy: default\n", |
| 296 | + " Default Datasets (7, max 4 per dataset):\n", |
| 297 | + " airt_hate, airt_fairness, airt_violence, airt_sexual, airt_harassment,\n", |
| 298 | + " airt_misinformation, airt_leakage\n", |
| 299 | + "\u001b[1m\u001b[36m\n", |
299 | 300 | " airt.scam\u001b[0m\n", |
300 | 301 | " Class: Scam\n", |
301 | 302 | " Description:\n", |
|
309 | 310 | " Default Strategy: all\n", |
310 | 311 | " Default Datasets (1, max 4 per dataset):\n", |
311 | 312 | " airt_scams\n", |
| 313 | + " Supported Parameters:\n", |
| 314 | + " - max_turns (int) [default: 5]: Maximum conversation turns for the persuasive_rta strategy.\n", |
| 315 | + "\u001b[1m\u001b[36m\n", |
| 316 | + " benchmark.adversarial\u001b[0m\n", |
| 317 | + " Class: AdversarialBenchmark\n", |
| 318 | + " Description:\n", |
| 319 | + " Benchmarking scenario that compares the attack success rate (ASR) of\n", |
| 320 | + " several different adversarial models.\n", |
| 321 | + " Aggregate Strategies:\n", |
| 322 | + " - all, default, single_turn, multi_turn, light\n", |
| 323 | + " Available Strategies (4):\n", |
| 324 | + " role_play, tap, red_teaming, context_compliance\n", |
| 325 | + " Default Strategy: light\n", |
| 326 | + " Default Datasets (1, max 8 per dataset):\n", |
| 327 | + " harmbench\n", |
312 | 328 | "\u001b[1m\u001b[36m\n", |
313 | 329 | " foundry.red_team_agent\u001b[0m\n", |
314 | 330 | " Class: RedTeamAgent\n", |
|
359 | 375 | "\n", |
360 | 376 | "================================================================================\n", |
361 | 377 | "\n", |
362 | | - "Total scenarios: 8\n" |
| 378 | + "Total scenarios: 9\n" |
363 | 379 | ] |
364 | 380 | }, |
365 | 381 | { |
|
389 | 405 | "\n", |
390 | 406 | "Every scenario can optionally include a **baseline attack** — a `PromptSendingAttack` that sends\n", |
391 | 407 | "each objective directly to the target without any converters or multi-turn techniques. This is\n", |
392 | | - "controlled by the `include_default_baseline` parameter (default: `True` for most scenarios).\n", |
393 | | - "\n", |
394 | | - "To run *only* the baseline (no attack strategies), create a `RedTeamAgent` with\n", |
395 | | - "`include_baseline=True` (the default) and pass `scenario_strategies=None`. See\n", |
396 | | - "[Common Scenario Parameters](./1_common_scenario_parameters.ipynb) for a working example." |
| 408 | + "controlled by the `include_baseline` parameter on `initialize_async`; when omitted, each\n", |
| 409 | + "scenario falls back to its own `BASELINE_POLICY` class attribute (most scenarios default\n", |
| 410 | + "it on; `Jailbreak` defaults it off). See\n", |
| 411 | + "[Common Scenario Parameters](./1_common_scenario_parameters.ipynb) for a worked example.\n", |
| 412 | + "\n", |
| 413 | + "Custom scenarios should choose their `BASELINE_POLICY` based on whether an unmodified\n", |
| 414 | + "prompt is a meaningful comparator for the scenario's strategies:\n", |
| 415 | + "\n", |
| 416 | + "- **`Enabled`** — the baseline is prepended by default and the caller can opt out. Use when an\n", |
| 417 | + " unmodified-prompt run is a meaningful comparison point (most scenarios).\n", |
| 418 | + "- **`Disabled`** — the baseline is supported but omitted by default; the caller must opt in. Use\n", |
| 419 | + " when the scenario is already dominated by a large set of templates/strategies that already\n", |
| 420 | + " exercise the unmodified surface (e.g., `Jailbreak`).\n", |
| 421 | + "- **`Forbidden`** — the baseline is unavailable and passing `include_baseline=True` raises. Use\n", |
| 422 | + " when the scenario's semantics make a single-shot unmodified prompt meaningless as a comparator\n", |
| 423 | + " (e.g., benchmarks comparing across adversarial models, or multi-turn-only scenarios)." |
397 | 424 | ] |
398 | 425 | }, |
399 | 426 | { |
|
436 | 463 | "name": "python", |
437 | 464 | "nbconvert_exporter": "python", |
438 | 465 | "pygments_lexer": "ipython3", |
439 | | - "version": "3.11.15" |
| 466 | + "version": "3.12.13" |
440 | 467 | } |
441 | 468 | }, |
442 | 469 | "nbformat": 4, |
|
0 commit comments