Repository navigation
FEAT: Add CBRN scenario trials and run artifacts - #4483
Draft
Nina Chikanov (nina-msft) wants to merge 1 commit into
Draft
Nina Chikanov (nina-msft) wants to merge 1 commit into
Nina Chikanov (nina-msft) wants to merge 1 commit into
Conversation
Add population-specific CBRN scoring and configurable independent trials, expose trial ASR in the GUI, and export run-scoped artifacts with seed metadata snapshots and browser download feedback. Include a five-objective public dataset and focused coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
CBRN validation occurs after dataset replacement, allowing invalid refreshes to overwrite valid data, and checks unrelated stored objectives during resume, blocking otherwise unchanged runs.
2 open issues
What changed in this PR
Adds CBRN evaluation to PyRIT’s scenario framework, with independent trials, population-specific scoring, and downloadable evidence for individual runs.
Changes:
- Introduces
airt.cbrn, configurable trial execution, and a five-objective synthetic dataset. - Separates trial success rates from group outcomes and retry counts, with scanner configuration support.
- Adds terminal-run artifact downloads and selected-seed metadata snapshots.
| File | Description |
|---|---|
tests/unit/scenario/core/test_scenario.py |
Tests metadata snapshots and resume preservation. |
tests/unit/scenario/airt/test_cbrn.py |
Tests CBRN scoring, configuration, sampling, and resume. |
tests/unit/registry/test_scenario_registry.py |
Updates technique availability expectations. |
tests/unit/executor/attack/compound/test_repeated_attack.py |
Tests independent trials and persisted outcomes. |
tests/unit/datasets/test_local_prompt_dataset_semantics.py |
Checks synthetic dataset structure and labels. |
tests/unit/backend/test_scenario_run_service.py |
Tests artifact eligibility by run state. |
tests/unit/backend/test_scenario_run_routes.py |
Tests artifact responses and errors. |
tests/unit/backend/test_scenario_progress_read_model.py |
Tests latest-execution trial statistics. |
tests/unit/analytics/test_scenario_statistics_parity.py |
Checks consistent trial and retry accounting. |
pyrit/scenario/scenarios/airt/cbrn.py |
Implements CBRN configuration and population-specific trials. |
pyrit/scenario/scenarios/airt/__init__.py |
Exports CBRN and its technique catalog. |
pyrit/scenario/scenarios/_dynamic_techniques.py |
Registers the dynamic CBRN technique catalog. |
pyrit/scenario/core/scenario.py |
Adds technique restrictions and metadata snapshots. |
pyrit/registry/components/scenario_registry.py |
Publishes technique unavailability reasons. |
pyrit/models/scenario_progress.py |
Adds seed snapshots and trial statistics fields. |
pyrit/models/catalog/scenario.py |
Adds technique availability metadata. |
pyrit/memory/memory_interface.py |
Separates indexed children from retry counts. |
pyrit/executor/attack/compound/repeated_attack.py |
Implements fixed-count trials and outcome summaries. |
pyrit/executor/attack/compound/__init__.py |
Exports RepeatedAttack. |
pyrit/executor/attack/__init__.py |
Exposes RepeatedAttack through the public API. |
pyrit/datasets/seed_datasets/local/airt/cbrn.prompt |
Adds five synthetic, labeled objectives. |
pyrit/datasets/score/true_false_question/cbrn_operational.yaml |
Defines the operational-detail scoring rubric. |
pyrit/backend/services/scenario_run_service.py |
Allows terminal-run exports and adjusts retry accounting. |
pyrit/backend/services/scenario_progress_read_model.py |
Aggregates trial outcomes from latest executions. |
pyrit/backend/routes/scenarios.py |
Adds the run artifacts endpoint. |
pyrit/backend/README.md |
Documents artifact scope and trial reporting. |
pyrit/analytics/scenario_statistics.py |
Distinguishes child executions from retries. |
frontend/src/types/index.ts |
Adds availability, snapshot, and trial fields. |
frontend/src/services/api.ts |
Adds artifact download requests. |
frontend/src/components/Scenarios/ScenarioTechniqueSelector.tsx |
Explains unavailable techniques and allows deselection. |
frontend/src/components/Scenarios/ScenarioTechniqueSelector.test.tsx |
Tests accessible unavailability explanations. |
frontend/src/components/Scenarios/ScenarioTechniqueSection.tsx |
Displays technique-specific availability restrictions. |
frontend/src/components/Scenarios/ScenarioRunPage.tsx |
Adds downloads, confirmation, and trial-rate display. |
frontend/src/components/Scenarios/ScenarioRunPage.test.tsx |
Tests downloads, cancellation, and trial display. |
frontend/src/components/Scenarios/ScenarioDetail.tsx |
Blocks incompatible technique and scorer selections. |
frontend/src/components/Scenarios/ScenarioDetail.test.tsx |
Tests scorer selection and technique restrictions. |
frontend/src/components/Scenarios/scenarioConfigForm.ts |
Carries availability into selectable techniques. |
frontend/src/components/Chat/ChatScorerPicker.tsx |
Marks ineligible selected scorers unavailable. |
frontend/src/components/AttackResults/attackAttemptFormatting.ts |
Formats trial success rates and counts. |
frontend/src/components/AttackResults/attackAttemptFormatting.test.ts |
Tests trial formatting and legacy fallback. |
Review effort: Balanced
Comment on lines
+278
to
+281
| populations = await super()._resolve_seed_groups_by_dataset_async(apply_sampling=False) | ||
| for groups in populations.values(): | ||
| for group in groups: | ||
| self._expected_response(group) |
| async def _resolve_seed_groups_by_dataset_async( | ||
| self, *, apply_sampling: bool = True | ||
| ) -> dict[str, list[AttackSeedGroup]]: | ||
| populations = await super()._resolve_seed_groups_by_dataset_async(apply_sampling=False) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Add an end-to-end CBRN evaluation flow with independently scored trials, population-specific outcomes, and downloadable evidence scoped to a single scenario run.
airt.cbrnwith configurable techniques and scoring. ALLOW success means refusal; REFUSE success requires both non-refusal and operational execution details.airt_cbrndataset with mixed ALLOW/REFUSE labels and onlytier/expectedcustom metadata.GUI example: three successful trials out of five display
60% (3/5 trials), while the group's categorical outcome is Success. Download artifacts exports JSON for that selected run only.