You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 893404f
Browse filesBrowse the repository at this point in the historyBrowse files
# Set optional OPENAI_CHAT_ADDITIONAL_REQUEST_HEADERS to include additional HTTP headers in a dictionary format for API requests, e.g., {'key1': 'value1'}.
Copy file name to clipboardExpand all lines: doc/code/executor/3_attack_configuration.py
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
# | `objective` | What you are trying to get the **objective target** to do. Drives attack prompts and supplies the default scoring context. |
23
23
# | `expectation` | A per-execution `ScoringExpectation` for outcome scoring. Its objective may differ from the attack objective. |
24
24
# | `memory_labels` | A `dict[str, str]` tagged onto every prompt/response, so you can filter this run later in memory. |
25
+
# | `operation_id` | ID of a saved Operation to group this attack with related activity and findings. |
25
26
# | `prepended_conversation` | A list of `Message`s to seed the conversation before the attack's own turns. This is also where the objective target's **system prompt** goes — `Message.from_system_prompt(...)` builds one (see below). |
26
27
# | `next_message` | The exact next message to send, instead of letting the attack derive it from the objective. Useful for multimodal or pre-built seeds. |
27
28
#
@@ -80,14 +81,33 @@
80
81
# ## Memory labels
81
82
#
82
83
# `memory_labels` tag every prompt and response this run produces. They don't change what is sent;
83
-
# they make the run easy to find and group later in memory (e.g. by operation or operator).
84
+
# they make the run easy to find and group later in memory (e.g. by campaign or operator).
84
85
# `AtomicAttack.run_async(memory_labels=...)` merges labels with its constructor labels.
| Operation name (`operation`) | Label for new attacks and scanner runs |
139
+
|Selected Operation | Groups new attacks and scanner runs by its saved ID|
140
140
| Custom run labels | Additional labels for new attacks and scanner runs |
141
141
| Theme | System, Light, Dark, or a named preset |
142
142
| Chat display mode | Raw text or rendered Markdown |
143
143
144
-
The GUI uses `operation` and `operator` as its label names, not `op_name` and `username`.
145
144
For signed-in users, `operator` is the lowercase username before `@`. It is derived
146
145
from the account, cannot be edited, and is not saved as a user preference. With
147
146
authentication disabled, the local profile can save an operator label.
148
147
149
148
All six preferences use `pyrit.userPreferences.v1.<tenant>:<homeAccountId>` in
150
149
browser local storage. Authentication-disabled use has a separate `local` profile.
151
150
These settings do not follow you to another browser or device. Changes to labels
152
-
apply to future runs, not stored attacks. Backend label defaults still apply when
153
-
there is no user override. Removing a custom default label is also saved.
151
+
apply to future runs, not stored attacks. Backend configuration supplies initial
152
+
defaults. Removing a custom default label is also saved.
154
153
Open tabs synchronize preferences for the same account. Each edit is merged with
155
154
the latest saved values. On HTTPS and localhost, browser locks also serialize
156
155
concurrent saves so edits to different defaults do not overwrite each other.
@@ -450,13 +449,20 @@ Export stays available for read-only historical conversations, and is disabled w
450
449
451
450
#### Labels
452
451
453
-
The labels bar above the page content is available across the GUI, including scanner setup, Home, Chat, and History. It shows the active labels for future attacks and scans, not the attribution of a historical run you are viewing. Click the labels icon to open **Default Labels** and add, edit, or remove custom labels. The required `operator` and `operation` controls remain in the bar, outside this popover, and cannot be removed. A signed-in operator is read-only.
452
+
The labels bar above the page content is available across the GUI, including scanner setup, Home, Chat, and History. It shows the active labels for future attacks and scans, not the attribution of a historical run you are viewing. Click the labels icon to open **Default Labels** and add, edit, or remove custom labels. **Operator:** is an always-visible text input; **Operation:** is an always-visible searchable dropdown outside this popover. Operator is required; an operation is optional and removable. A signed-in operator is read-only.
454
453
455
454
In Chat, the active target, Markdown toggle, export menu, conversations panel toggle, and **New Attack** button share the right side of this bar. They wrap below the labels on narrow screens.
456
455
457
-
Clicking the `operation` label opens a picker listing the operations already recorded in memory, so you can choose one without typing it from memory. Typing a name that doesn't exist yet offers to create it. Very long lists show the first 200 and say how many are left, so type to narrow them. On narrow screens, use the labels icon to view or edit labels that do not fit inline.
456
+
Open the **Operation** dropdown to choose a saved operation. **New operation…** stays first, including while searching, and opens the creation dialog. Typing alone never selects an unsaved name. Very long lists show up to 200 saved choices and say how many match, so type to narrow them. The compact metadata controls wrap on narrow screens; custom labels that do not fit remain available through the labels icon.
458
457
459
-
Your choices persist in this browser across navigation and refreshes. Backend configuration supplies defaults for labels you have not chosen, and the signed-in account alias takes precedence over the default or remembered operator during initialization. Scanner launches receive the active labels from this bar.
458
+
A configured or remembered name that isn't saved yet is highlighted in yellow,
459
+
like a placeholder operator, and screen readers announce it as not registered.
460
+
Choose **Register** to save it, pick a saved Operation from the **Operation**
461
+
dropdown, or choose **Clear** to run without one. New attacks and scans stay
462
+
blocked until the selection is resolved or cleared. Startup does not create
463
+
Operations.
464
+
465
+
Your choices persist in this browser across navigation and refreshes. Backend configuration supplies initial defaults, and the signed-in account alias takes precedence over the default or remembered operator during initialization. Scanner launches receive the active labels and selected Operation ID from this bar.
460
466
461
467
Changing these labels does not relabel existing attacks or scenario runs. History attribution and the **Run configuration** shown for a scenario run still describe that saved run. Operator and target restrictions on existing attacks remain in effect.
462
468
@@ -491,7 +497,7 @@ Filter attacks by:
491
497
-**Outcome:** Success, failure, or undetermined
492
498
-**Converter:** Which converters were applied
493
499
-**Operator:** Who ran the attack
494
-
-**Operation:**The operation label
500
+
-**Operation:**Saved Operation
495
501
-**Custom labels:** Free-form key:value label filtering with auto-complete
496
502
497
503
Click "Reset" to clear all filters.
@@ -506,7 +512,7 @@ The table displays:
506
512
| Attack Type | The attack class name |
507
513
| Target | Target type and model name |
508
514
| Operator | Who ran the attack |
509
-
| Operation | Operation label|
515
+
| Operation | Operation name|
510
516
| Msgs | Total message count |
511
517
| Convs | Number of conversations |
512
518
| Converters | Converter badges (truncated with tooltip) |
@@ -546,6 +552,78 @@ In active runs and saved scenario results, **Atomic attack groups** defaults to
546
552
547
553
Until you expand or collapse the section, its default follows the current group count as progress loads. Once you choose, the section keeps your choice during progress updates for the same run, even if the count crosses 20. Opening a different run resets to that run's count-based default.
548
554
555
+
### Operations and Findings
556
+
557
+
An operation groups related red-teaming work. Inside it you record findings:
558
+
human assessments, whether or not an attack produced them.
559
+
560
+
Open **Operations** in the sidebar and choose **New operation**. Names are unique,
561
+
ignoring case and surrounding spaces; if the name is taken, the dialog offers the
562
+
existing operation. An optional description records the engagement's purpose and
563
+
scope. The **Operation** dropdown in the labels bar applies the
564
+
selected operation to new attacks and scanner runs, and **New operation…** at the
565
+
top of that list creates one without leaving the page.
566
+
567
+
On an operation's page, **Add description** or **Edit description** changes the
568
+
description. Saving replaces it, so if two people edit at once, the last save wins.
569
+
Operations can't be renamed or deleted from the GUI.
570
+
571
+
#### Findings
572
+
573
+
Open an operation and choose **New finding**.
574
+
575
+
| Field | Required | Values |
576
+
| --- | --- | --- |
577
+
| Title | Yes | Free text |
578
+
| Severity | Yes | Critical, Important, Moderate, Low, Informational, or Other (your own text). Defaults to Moderate. |
579
+
| Harm-type | No | A PyRIT harm category, Other (your own text), or Not set |
580
+
| Description | No | Free text |
581
+
| Evidence attack ID | No | A saved attack to attach in the same save. Its ID is in the attack's address. |
582
+
583
+
Findings are sorted by severity in the order above, newest first within each
584
+
level, 20 per page. **Edit** changes any field; the operation and creation time
585
+
stay fixed. **Delete** asks for confirmation and can't be undone.
586
+
587
+
**All execution history** opens History filtered by the Operation's ID. The
588
+
filter stays when you switch between Attacks and Scanner.
589
+
590
+
#### Attack evidence
591
+
592
+
Evidence is a saved attack. To attach one, open it in Chat, select the outcome
593
+
badge to open **Attack Result Details**, and choose **Add as finding**. Choose
594
+
the finding's Operation, search by title, select a finding, and choose
595
+
**Attach**. The attack can come from any Operation or none.
596
+
597
+
**New finding** in that dialog opens the same form and saves the finding and its
598
+
evidence together, so neither is saved if the attack can't be attached. Saving
599
+
again after a lost response returns the finding that was already saved rather
600
+
than creating a second one.
601
+
602
+
Evidence points to the live attack, not a copy, so later messages and scores
603
+
show up too. An attack can support several findings, and attaching the same
604
+
attack to a finding again reports **Already attached**.
605
+
606
+
On the operation page, **Evidence (n)** under a finding opens a table of its
607
+
attacks. Each row shows the attack's objective, its outcome with the same badge
608
+
as Chat, and the score behind it: the human score if there is one, otherwise
609
+
the automated score. An attack without a score reads **Not scored**. Evidence
610
+
from another Operation shows its source; unassigned activity shows **Not in an
611
+
operation**. **Open attack** opens it in Chat at the conversation that holds the
612
+
score, or at its main conversation, so the transcript matches the result shown.
613
+
If an attack no longer exists, its entry stays, shows the attack's ID and
614
+
attachment time, and reads **Evidence unavailable**. **Remove link** removes only
615
+
the link, never the attack. Deleting a finding removes its links the same way.
616
+
617
+
#### Upgrading an existing database
618
+
619
+
One migration adds Operations, findings, evidence, and optional Operation IDs on
620
+
attacks and scanner runs. It registers legacy names without changing historical
621
+
attribution. Legacy activity remains in general history but does not appear in
622
+
Operation-ID filters. The backend applies it automatically when it starts, so
623
+
restart a running backend after upgrading. If you start memory with
624
+
`skip_schema_migration=True`, run the migration yourself. Downgrading refuses to
625
+
drop the tables while any operation exists.
626
+
549
627
### Technique Registry
550
628
551
629
Open **Registry > Techniques**, or go to `/registry/techniques`. Targets and
0 commit comments