Skip to content

FEAT: Presets as sets of scenarios in the Scanner and Registry - #4615

Open
Richard Lundeen (richlundeen) wants to merge 8 commits into
microsoft:mainfrom
richlundeen:gui/scanner-launch-tabs-1
Open

Richard Lundeen (richlundeen) wants to merge 8 commits into
microsoft:mainfrom
richlundeen:gui/scanner-launch-tabs-1

Conversation

@richlundeen

@richlundeen Richard Lundeen (richlundeen) commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Make a preset one clear thing in the GUI: a saved set of scenarios you launch together. The Scanner gets a Presets tab for launching them, and the Registry's Scenario presets page manages them, so presets and suites no longer appear as two parallel lists.

In GUI terms, a preset is what the backend stores as a scenario suite, and each scenario inside it is a stored scenario preset. The backend, API, and storage are unchanged.

  • Scanner tabs: Launch | Presets | History. /scanner/presets (previously a redirect to the Registry) lists presets that can launch as cards: name, scenario count, description, and Launch. A disabled Launch says why in a tooltip. Opening a card lists its scenarios with their own datasets, techniques, and run size, led by the scenario (airt.jailbreak) with the stored name as secondary text. Presets with a problem never appear here.
  • Launch lists scenarios only. Suites and standalone presets no longer mix into its table.
  • Registry > Scenario presets uses the same cards:
    • New preset (name, description, first scenario), Add scenario, Edit description, and Delete per preset.
    • Edit and Remove per scenario. Editing a scenario other presets also use warns first.
    • Presets that need attention sort first, under a banner, with the fix for each problem.
    • Actions use the existing suite and preset endpoints. If a scenario saves but adding it to the preset fails, the dialog says so and offers Retry.
  • Copy and routes:
    • GUI text says "preset" and "scenario", never "suite".
    • /scanner redirects to Launch.
    • Old /registry/scenario-suites/* links redirect to the Scenario presets page.
  • Removed: the separate suite and preset libraries, the suite editor, the Scanner's suite section, and the "Add to scanner" switch. The preset editor is now the scenario editor. Stored show_in_scanner values are kept but no longer used by the GUI.
  • Docs: doc/gui/0_gui.md explains the GUI vocabulary.

Scenario presets that belong to no preset are no longer listed on their own in the GUI; they remain in storage and the API, and New preset and Add scenario can add one to a preset as it is.

This is step 1 of 2. Step 2 groups the Launch tab's scenarios into collapsible modules.

Screenshots

Scanner Presets tab: presets as collapsed cards with name, scenario count, description, and Launch; an empty preset's Launch is disabled

Scanner Presets tab with a preset open: its scenarios in the shared scenario table, each naming its scenario configuration, with datasets, techniques, and run size

Scanner Presets tab when presets exist but none can launch: a message pointing to the Registry

Scanner Presets tab when one preset needs attention and others can launch: a notice that it is hidden here, with Fix in Registry

Registry Scenario presets page: presets as cards with Add scenario, Edit, and Delete, under a banner for presets that need attention

Registry preset open: its scenarios with Datasets, Techniques, and Run size columns, Edit and Remove on each row, and which other presets share a scenario

Registry preset that needs attention: listed first under the banner, with the broken scenario first and only Remove offered for it

Registry Scenario presets at 390 px on a touch device: the needs-attention banner wraps onto two lines with Show fully visible

Editing a scenario that other presets also use: a warning naming those presets before the edit applies to all of them

Scenario editor for a preset's scenario: the subtitle names the scenario configuration being edited

New preset dialog: name, description, and the first scenario, either a new scenario with its defaults or a saved scenario configuration

The Scanner gets Launch | Presets | History tabs. Presets (backend scenario
suites) leave the Launch table and get their own tab, where each launchable
preset is a card with its scenarios, run sizes, an exact total when every
estimate is exact, and Launch with a reason tooltip when unavailable.

The Registry's Scenario presets page lists the same presets as cards and
manages them at the preset level: New preset with its first scenario, Add
scenario, Edit description, Delete, and per-scenario Edit and Remove on the
existing suite and preset endpoints. Two-write actions say plainly when the
scenario was saved but not added, with Retry. Presets that need attention
sort first behind a banner and stay out of the Scanner; editing a scenario
other presets share warns first.

The preset editor becomes the scenario editor. The old suite and preset
libraries, suite editor, scanner visibility switch, and ScannerSuiteSection
are removed; /scanner redirects to Launch and old suite routes redirect to
the Registry page. GUI copy no longer says "suite".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add scenario and Edit description read the preset from the latest load,
  and an Add scenario retry re-reads the preset, so a retry after a 409
  sends the current version and scenarios instead of failing again.
- Scenario issue hints follow the issue: edit or remove for settings the
  editor can fix, remove for an unregistered scenario, and only the server
  message for a scenario that is missing or unreadable.
- Focus moves to the card's Add scenario after Remove, and in-flight row
  and card buttons stay focusable.
- Edit and Remove share one line; the scenario picker's list opens under
  the field; Registry cards are h2 under the page's h1.
- ScenarioCatalogTable, SuiteCard, ScannerPresetsPage, and ScenarioPicker
  use their own co-located styles. Drop the unused testId prop, the unused
  ScannerTab export, and the seeded Playwright storage change no test needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Registry dialog triggers (New preset, Add scenario, Edit, Delete, and
  each scenario's Edit) are focus restore targets, so closing a dialog
  returns focus to the button that opened it. Deleting the last preset
  focuses the New preset button the reload renders.
- New preset rejects a name another loaded preset has, as a field error,
  before saving anything. A conflict that still happens (another user)
  says so without "suite", and the saved-but-not-added notice reads as
  full sentences.
- When presets exist but none can launch, the Presets tab says none is
  ready and links to the Registry instead of "No presets yet".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved defects can duplicate scenarios on retry and launch settings different from those displayed, while technique counts and touch targets also need correction.

5 open issues
What changed in this PR

This PR gives presets one meaning in the GUI: saved sets of scenarios launched together. It separates launching from Registry management while preserving the existing backend APIs and storage model.

Changes:

  • Adds the Scanner’s Presets tab with expandable cards, per-scenario settings, and launch controls.
  • Replaces separate preset and suite management with Registry cards and dialogs, including shared-scenario warnings and partial-save retries.
  • Updates navigation, terminology, documentation, and automated coverage for the revised workflows.
File Description
frontend/​src/​types/​index.ts Documents GUI terminology without changing API types.
frontend/​src/​test-utils/​scenarioSuiteFixtures.ts Adds shared preset, suite, and estimate fixtures.
frontend/​src/​hooks/​useScenarioSuiteMutations.ts Implements preset management and partial-save recovery.
frontend/​src/​hooks/​useScenarioSuiteMutations.test.tsx Covers mutations, conflicts, and retries.
frontend/​src/​hooks/​useScenarioSuiteLibrary.ts Loads suites, scenarios, and run estimates.
frontend/​src/​hooks/​useScenarioSuiteLibrary.test.tsx Covers loading, refresh, estimates, and cancellation.
frontend/​src/​hooks/​useScenarioSuiteExecution.ts Renames execution error text to preset terminology.
frontend/​src/​components/​ScenarioSuites/​suiteRoutes.ts Defines Scanner preset and execution routes.
frontend/​src/​components/​ScenarioSuites/​suiteRoutes.test.ts Updates route assertions.
frontend/​src/​components/​ScenarioSuites/​suiteMembers.ts Resolves member details, counts, and shared references.
frontend/​src/​components/​ScenarioSuites/​suiteMembers.test.ts Covers member summaries and aggregate counts.
frontend/​src/​components/​ScenarioSuites/​SuiteCard.tsx Adds expandable Scanner preset cards.
frontend/​src/​components/​ScenarioSuites/​SuiteCard.test.tsx Covers card details and launch controls.
frontend/​src/​components/​ScenarioSuites/​SuiteCard.styles.ts Styles preset card content and controls.
frontend/​src/​components/​ScenarioSuites/​ScenarioSuiteLibrary.tsx Removes the separate suite library.
frontend/​src/​components/​ScenarioSuites/​ScenarioSuiteLibrary.styles.ts Removes obsolete suite-library styles.
frontend/​src/​components/​ScenarioSuites/​ScenarioSuiteExecutionPage.tsx Updates execution labels and back navigation.
frontend/​src/​components/​ScenarioSuites/​ScenarioSuiteExecutionPage.test.tsx Updates execution-page expectations.
frontend/​src/​components/​ScenarioSuites/​ScenarioSuiteEditor.styles.ts Removes obsolete suite-editor styles.
frontend/​src/​components/​ScenarioSuites/​LaunchSuiteDialog.tsx Updates launch-dialog terminology.
frontend/​src/​components/​ScenarioSuites/​LaunchSuiteDialog.test.tsx Updates launch-button assertions.
frontend/​src/​components/​Scenarios/​scenarioRunNavigation.ts Uses preset-run wording in back links.
frontend/​src/​components/​Scenarios/​scenarioRunNavigation.test.ts Updates back-link expectations.
frontend/​src/​components/​Scenarios/​ScenarioPicker.tsx Adds a reusable scenario selector.
frontend/​src/​components/​Scenarios/​ScenarioPicker.styles.ts Constrains the selector’s dropdown height.
frontend/​src/​components/​Scenarios/​scenarioConfigForm.ts Makes the dataset-empty helper internal.
frontend/​src/​components/​Scenarios/​ScenarioCatalogTable.tsx Extracts reusable scenario rows and summaries.
frontend/​src/​components/​Scenarios/​ScenarioCatalogTable.styles.ts Provides shared responsive table styles.
frontend/​src/​components/​Scenarios/​ScenarioCatalog.styles.ts Removes extracted table and retired section styles.
frontend/​src/​components/​Scenarios/​ScannerSuiteSection.tsx Removes suites from the Launch catalog.
frontend/​src/​components/​Scenarios/​ScannerSuiteSection.test.tsx Removes tests for the retired suite section.
frontend/​src/​components/​Scenarios/​ScannerSuiteSection.styles.ts Removes retired suite-section styles.
frontend/​src/​components/​Scenarios/​ScannerPresetsPage.tsx Adds preset browsing, filtering, and launching.
frontend/​src/​components/​Scenarios/​ScannerPresetsPage.test.tsx Covers browsing, launch, and empty/error states.
frontend/​src/​components/​Scenarios/​ScannerPresetsPage.styles.ts Styles the Scanner Presets page.
frontend/​src/​components/​ScenarioPresets/​scenarioPresetForm.ts Preserves stored visibility without exposing a control.
frontend/​src/​components/​ScenarioPresets/​scenarioPresetForm.test.ts Verifies visibility preservation.
frontend/​src/​components/​ScenarioPresets/​ScannerVisibilityLabel.tsx Removes the “Add to scanner” label.
frontend/​src/​components/​ScenarioPresets/​presetRoutes.ts Clarifies Registry and scenario-editor routes.
frontend/​src/​components/​ScenarioPresets/​presetRoutes.test.ts Removes obsolete redirect assertions.
frontend/​src/​components/​Registry/​SuiteDialogs.styles.ts Adds shared preset-dialog styles.
frontend/​src/​components/​Registry/​ScenarioPresetRegistry.styles.ts Adapts Registry layout for cards.
frontend/​src/​components/​Registry/​RegistrySuiteMemberTable.tsx Shows scenario details, issues, and member actions.
frontend/​src/​components/​Registry/​RegistrySuiteMemberTable.styles.ts Styles responsive Registry member tables.
frontend/​src/​components/​Registry/​RegistrySuiteCard.tsx Adds preset management cards.
frontend/​src/​components/​Registry/​RegistrySuiteCard.styles.ts Sizes Registry card controls for touch.
frontend/​src/​components/​Registry/​RegistryLayout.tsx Updates preset tab help and route selection.
frontend/​src/​components/​Registry/​RegistryLayout.test.tsx Updates Registry navigation coverage.
frontend/​src/​components/​Registry/​PartialSaveNotice.tsx Explains incomplete saves and retry recovery.
frontend/​src/​components/​Registry/​NewSuiteDialog.tsx Creates a preset with its first scenario.
frontend/​src/​components/​Registry/​EditSuiteDialog.tsx Edits a preset’s description.
frontend/​src/​components/​Registry/​AddSuiteScenarioDialog.tsx Adds scenarios with partial-save retry support.
frontend/​src/​components/​Layout/​FeatureNavigation.tsx Adds the Scanner Presets tab.
frontend/​src/​components/​CollapsibleCard.tsx Adds a reusable expandable card component.
frontend/​src/​components/​CollapsibleCard.test.tsx Covers card expansion and accessible headings.
frontend/​src/​components/​CollapsibleCard.styles.ts Styles shared card layout and attention indicators.
frontend/​src/​App.tsx Wires new pages and legacy redirects.
frontend/​src/​App.test.tsx Covers new routes, tabs, and launch defaults.
frontend/​e2e/​touch-targets.spec.ts Checks preset controls on touch devices.
frontend/​e2e/​themes.spec.ts Extends theme coverage to preset pages.
frontend/​e2e/​scenario-techniques.spec.ts Adapts scenario editing and adds management workflows.
frontend/​e2e/​scenario-history.spec.ts Updates the Launch table’s accessible name.
frontend/​e2e/​scenario-datasets.spec.ts Adapts dataset editing to preset-first creation.
frontend/​e2e/​scan-launch.seeded.spec.ts Launches seeded presets from the Presets tab.
frontend/​e2e/​fixtures/​scenario_techniques_backend.py Isolates suite storage in the techniques fixture.
frontend/​e2e/​fixtures/​scenario_dataset_backend.py Isolates suite storage in the dataset fixture.
frontend/​e2e/​accessibility.spec.ts Checks heading structure on preset pages.
doc/​gui/​0_gui.md Explains preset vocabulary and revised workflows.

Review effort: Balanced

Comment on lines +63 to +64
const members = scenario ? techniqueSetMembers(scenario, name) : []
return members.length > 0 ? members : [name]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline:4688999017

Fixed in 8eca699. Technique sets are now matched by their base token, so a modifier selection such as all:converter.translation_spanish expands to its concrete techniques in both the Scanner and the Registry. Added a suiteMembers test for a set with a modifier.

Verified on published commit 8eca69949e0af8b5a39b08c50110ab914cdc957a.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline:4688999017

Correction to my earlier reply: this is only partly fixed, not fully fixed. At 4b44e92 the count is right. memberTechniqueNames (frontend/src/components/ScenarioSuites/suiteMembers.ts:66-77) resolves a selector such as all:converter.translation_spanish by its base set and deduplicates the concrete techniques, so the Scanner and the Registry show as many techniques as run. The converter is still missing: the expansion returns only the base technique names, so SuiteMemberRow displays the modifier selection as plain prompt_sending, skeleton_key, and so on, and the test at suiteMembers.test.ts:93 asserts that output. Keeping the converter in the display is still open, so I'm leaving this thread open.

Verified on published commit 4b44e9260d97bc69b6c2b9cd7aa12fa36b169b4f.

Resolve conflicts with main's lazy-loaded screens, exactOptionalPropertyTypes,
and type-aware ESLint. Keep the PR's unified Scanner Presets tab and Registry
scenario presets page, port main's preset-editor leave guard into the PR's
edit-only editor, and adapt PR-added code to main's stricter checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Add a saved scenario configuration to a preset as it is, so a removed
  scenario can be added back (CR-1).
- Save a description against the version the editor opened with (CR-2).
- Report a taken scenario name as a name conflict (CR-3).
- Give the real reason Launch is unavailable on the Presets tab (CR-4).
- Make create/add retries idempotent after a lost response (CR-5).
- Launch the scenario versions the card showed (CR-6).
- Count all: technique selectors by base token (CR-7).
- Give the row details toggle a 44px touch target (CR-8).
- Update stale preset docs and the show_in_scanner description (CR-9).
- Share the scenario table between Scanner and Registry, with Datasets (CR-10).
- Drop the attack total computed in React (CR-11).
- Clear an estimate failure once nothing is left to estimate (CR-12).
- Say when presets needing attention are hidden (CR-13).
- Name the preset and its scenario configuration distinctly (CR-14).
- Wrap the Registry attention banner at narrow widths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

Comment thread doc/gui/0_gui.md
chosen at launch. **Suites** maintain ordered collections of preset definitions.
They are stored separately from live component instances.
Suite launch dialogs apply arriving target defaults only to untouched selections.
**Scenario presets** are saved sets of scenarios that the Scanner launches

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe just me but i think this is confusing (and also maybe a little long / verbose)

Scenario presets are saved sets of scenarios that the Scanner launches
together. Each scenario keeps its own techniques, datasets, and limits.

  • New preset asks for a name, a description, and a first scenario;
    Add scenario adds more. A scenario starts from its defaults or from a
    configuration you already saved.
  • Edit on a scenario changes it in every preset that uses it, and warns you
    first if other presets share it.
  • Remove takes a scenario out of one preset but keeps its configuration, so
    you can add it back.
  • A preset with a problem, such as a missing scenario, is listed first and is
    hidden from the Scanner until it's fixed. The Scanner shows how many are hidden.

In the API and storage, a preset is a scenario suite and each of its scenarios
is a scenario preset.

The launch dialog fills in target defaults only for fields you haven't changed.
A target you chose, including a cleared adversarial target that falls back to
the server default, stays when the registry refreshes.


just a suggestion, I would probably shorten it since I don't think we need that level of descriptino but i'll leave that to you

}

/** A preset with issues cannot launch here, so only the Registry lists it. */
export function suiteNeedsAttention(item: ScenarioSuiteResponse): boolean {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suiteNeedsAttention is true only when a scenario has issues, so a preset with no scenarios never needs attention. On the Registry it gets no badge, isn't sorted first and isn't counted in the banner; it only shows "0 scenarios" and, when expanded, "This preset has no scenarios yet." The Scanner's Presets tab still lists it, with Launch disabled by NO_SCENARIOS_REASON. Other presets that can't launch are flagged in the Registry and hidden from the Scanner, so an empty one is the only unlaunchable preset handled differently.

A preset can become empty: New preset always adds a first scenario, but Remove on a preset's last scenario is allowed (RegistrySuiteMemberTable.tsx:111, useScenarioSuiteMutations.removeEntry).

Two ways to make it consistent:

  1. Treat an empty preset as needing attention: return true from suiteNeedsAttention when item.suite.entries.length === 0. It's then flagged, sorted first, counted in the banner and hidden from the Scanner, and NO_SCENARIOS_REASON can go. The banner and card would need a reason for it, since there's no scenario issue to show, for example "Add a scenario to launch this preset."
  2. Don't let a preset become empty: disable Remove on the last scenario, with a hint to delete the preset instead.

Option 1 also covers empty presets that already exist, such as one defined in code with no entries. Option 2 alone doesn't.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants