|
32 | 32 | "\n", |
33 | 33 | "## How It Works\n", |
34 | 34 | "\n", |
35 | | - "Each `Scenario` contains a collection of `AttackRun` objects. When executed:\n", |
| 35 | + "Each `Scenario` contains a collection of `AtomicAttack` objects. When executed:\n", |
36 | 36 | "\n", |
37 | | - "1. Each `AttackRun` is executed sequentially\n", |
38 | | - "2. Every `AttackRun` tests its configured attack against all specified objectives and datasets\n", |
| 37 | + "1. Each `AtomicAttack` is executed sequentially\n", |
| 38 | + "2. Every `AtomicAttack` tests its configured attack against all specified objectives and datasets\n", |
39 | 39 | "3. Results are aggregated into a single `ScenarioResult` with all attack outcomes\n", |
40 | 40 | "4. Optional memory labels help track and categorize the scenario execution\n", |
41 | 41 | "\n", |
|
64 | 64 | { |
65 | 65 | "data": { |
66 | 66 | "application/vnd.jupyter.widget-view+json": { |
67 | | - "model_id": "108387f8a81646c289f28c1e3255bb5a", |
| 67 | + "model_id": "ecb802c8f9964212b3f6c3ff7a416e79", |
68 | 68 | "version_major": 2, |
69 | 69 | "version_minor": 0 |
70 | 70 | }, |
|
168 | 168 | " ScenarioCompositeStrategy(strategies=[FoundryStrategy.Caesar, FoundryStrategy.CharSwap]), # Composed strategy\n", |
169 | 169 | "]\n", |
170 | 170 | "\n", |
| 171 | + "\n", |
171 | 172 | "# Create a scenario from the pre-configured Foundry scenario\n", |
172 | 173 | "foundry_scenario = FoundryScenario(\n", |
173 | 174 | " objective_target=objective_target,\n", |
|
183 | 184 | "foundry_results = await foundry_scenario.run_async() # type: ignore\n", |
184 | 185 | "await printer.print_summary_async(foundry_results) # type: ignore" |
185 | 186 | ] |
| 187 | + }, |
| 188 | + { |
| 189 | + "cell_type": "markdown", |
| 190 | + "id": "2", |
| 191 | + "metadata": {}, |
| 192 | + "source": [ |
| 193 | + "## Resiliency\n", |
| 194 | + "\n", |
| 195 | + "Scenarios can run for a long time, and because of that, things can go wrong. Network issues, rate limits, or other transient failures can interrupt execution. PyRIT provides built-in resiliency features to handle these situations gracefully.\n", |
| 196 | + "\n", |
| 197 | + "### Automatic Resume\n", |
| 198 | + "\n", |
| 199 | + "If you re-run a `scenario`, it will automatically start where it left off. The framework tracks completed attacks and objectives in memory, so you won't lose progress if something interrupts your scenario execution. This means you can safely stop and restart scenarios without duplicating work.\n", |
| 200 | + "\n", |
| 201 | + "### Retry Mechanism\n", |
| 202 | + "\n", |
| 203 | + "You can utilize the `max_retries` parameter to handle transient failures. If any unknown exception occurs during execution, PyRIT will automatically retry the failed operation (starting where it left off) up to the specified number of times. This helps ensure your scenario completes successfully even in the face of temporary issues.\n", |
| 204 | + "\n", |
| 205 | + "### Dynamic Configuration\n", |
| 206 | + "\n", |
| 207 | + "During a long-running scenario, you may want to adjust parameters like `max_concurrency` to manage resource usage, or switch your scorer to use a different target. PyRIT's resiliency features make it safe to stop, reconfigure, and continue scenarios as needed.\n", |
| 208 | + "\n", |
| 209 | + "For more information, see [resiliency](../setup/1_resiliency.ipynb)" |
| 210 | + ] |
186 | 211 | } |
187 | 212 | ], |
188 | 213 | "metadata": { |
|
0 commit comments