Skip to content

[BREAKING] FEAT: Add scenario dataset controls to CLI, REST, and GUI - #3143

Open
Richard Lundeen (richlundeen) wants to merge 3 commits into
microsoft:mainfrom
richlundeen:richlundeen-scenario-dataset-plan
Open

Richard Lundeen (richlundeen) wants to merge 3 commits into
microsoft:mainfrom
richlundeen:richlundeen-scenario-dataset-plan

Conversation

@richlundeen

@richlundeen Richard Lundeen (richlundeen) commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implements PR 2 of the scenario dataset proposal, using the preparation and limit APIs merged in #2956.

Adds scenario-owned dataset options and one dataset override path for Python, REST, scanner, and shell. The GUI dataset table shows source limits, fetch policies, stored origins, counts, and provider availability. Estimates remain read-only. Resume uses the existing launch record and stored run plan; there is no v2 format or separate settings snapshot.

Breaking: dataset overrides that a scenario cannot apply now fail instead of being ignored. This includes total limits on web injection and system-prompt extraction. Existing dataset defaults and inline data paths remain unchanged. Deprecated request fields and CLI flags remain supported; incompatible combinations fail. Generator configuration and refresh are out of scope.

Review fixes make SystemPromptExtraction, WebInjection, and PromptInject build from filtered seeds. A scenario-wide contract test rejects direct memory seed reads that bypass dataset configuration. GUI validation derives from the visible field drafts: resetting or removing sources cannot clear unrelated limit errors, and removed rows no longer block launch.

Dataset table screenshots

These show the real controls with synthetic metadata, without external model calls.

Default sources:

Default dataset table

Edited selection with source and total limits and a per-source fetch policy:

Edited dataset table

Invalid total remains visible and blocks launch after resetting sources:

Invalid dataset limit after source reset

Tests and Documentation

Added mixed matching/nonmatching seed cases, a scenario seed-read boundary test, field-reset/removal regressions, and browser coverage for the new dataset inputs. Updated affected mock API fixtures and scenario guidance.

  • $env:UV_NO_SYNC='1'; uv run --no-sync pre-commit run --all-files — passed all hooks.
  • uv run --no-sync pytest tests\unit\scenario tests\unit\backend\test_scenario_configuration_resolver.py tests\unit\backend\test_scenario_run_service.py tests\unit\backend\test_scenario_service.py tests\unit\backend\test_scenario_resume.py tests\unit\backend\test_dataset_service.py tests\unit\registry\test_scenario_registry.py tests\unit\models\test_scenario_request.py tests\unit\memory\memory_interface\test_interface_seed_dataset_summary_query.py -q -n4 --tb=short --disable-warnings — 2,223 passed.
  • From frontend: npm test -- --runInBand --silent src\components\Scenarios\ScenarioDatasetTable.test.tsx src\components\Scenarios\ScenarioDetail.test.tsx src\components\Scenarios\ScenarioFlow.test.tsx src\components\Scenarios\ScenarioCatalog.test.tsx src\hooks\useScenarioDatasets.test.tsx src\hooks\useLoadedDatasets.test.tsx src\services\api.test.ts — 178 passed.
  • From frontend: npm run type-check -- --pretty false and npm run build — passed.
  • From frontend, with E2E_FRONTEND_PORT=3932 and PYRIT_PYTHON pointing to this worktree's interpreter: npx --no-install playwright test 'numeric-controls.spec.ts' 'scenario-history.spec.ts' --project=mock --workers=2 --reporter=list --output=<session artifacts> — 15 passed. The final numeric-control screenshot run also passed all 9 tests.

Paired documentation was checked during the initial implementation. Notebooks were not executed; stored outputs were retained. No notebook changes are part of these review fixes.

…faces

Expose scenario-owned dataset options, shared requests, and source-level controls in Python, REST, CLI, shell, and GUI. Preserve read-only estimates and resume behavior.

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

Copilot-Session: 16cbdc1b-2bf6-4286-be66-c9f30c7ed72b
Retain the dataset controls and current backend-loop preparation. Adapt ProPILE and responsiveness tests to the shared dataset request path.

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

Copilot-Session: 16cbdc1b-2bf6-4286-be66-c9f30c7ed72b
Comment thread pyrit/scenario/scenarios/garak/system_prompt_extraction.py
Comment thread frontend/src/components/Scenarios/ScenarioDatasetTable.tsx Outdated
Comment thread frontend/src/hooks/useScenarioDatasets.ts
Comment thread frontend/src/components/Scenarios/ScenarioDatasetTable.tsx
Build synthesized scenarios from filtered seed reads, guard the scenario read boundary, derive field validation from visible drafts, and update browser fixtures and regression coverage.

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

Copilot-Session: 16cbdc1b-2bf6-4286-be66-c9f30c7ed72b

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.

2 participants