Skip to content

MAINT: declare scenario required data apart from dataset_config - #3464

Open
Utkarsh Bahuguna (u7k4rs6) wants to merge 9 commits into
microsoft:mainfrom
u7k4rs6:feat/scenario-required-data
Open

Utkarsh Bahuguna (u7k4rs6) wants to merge 9 commits into
microsoft:mainfrom
u7k4rs6:feat/scenario-required-data

Conversation

@u7k4rs6

@u7k4rs6 Utkarsh Bahuguna (u7k4rs6) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

ApiKey listed its corpus as dataset_config sources and then had to check they were uncapped and exactly those four. This adds ScenarioRequiredData for datasets a scenario reads in full. ApiKey declares its corpus in get_required_data, and ApiKeyDatasetConfiguration now only limits the assembled requests through select_assembled_groups. Required data uses the normal fetch and refresh path, only gets prepared on fresh runs and explicit loads, and can't be capped or deselected. When the config has no sources of its own, its fetch policy and filters apply to the required data, so those settings keep working. Settings and the scenario identity still list the corpus, so the CLI, GUI and old resumes don't change, and passing the corpus as sources still works with a deprecation warning.

PromptInject (#3546) and LatentInjection (#3547) are up as drafts on top of this. ProPILE is the interesting next one since its record datasets stay user-selectable, so I'll wait for feedback here before doing that.

Part of #3336

…d-data

# Conflicts:
#	tests/unit/scenario/garak/test_api_key.py
…s to selected techniques

A required-data refresh committed before the scenario assembled its population, so a
refresh that the assembly or the population validators would reject had already replaced
the stored datasets, breaking resume of earlier runs. The refresh now runs the scenario's
full unsampled assembly against the candidates first, so a rejected refresh changes nothing.

Legacy dataset_config validators wrote against the raw template seeds, so they move onto
the required data when an old configuration migrates, instead of receiving the assembled
objectives. ApiKey now requires a prompt template only for the techniques a run selects.
…work

A validator can be any callable, including an unhashable instance such as a plain
dataclass, so the migration can't collect them in a set. Remove the moved validators
by object identity instead.
@romanlutz Roman Lutz (romanlutz) self-assigned this Nov 2, 2026
Comment thread pyrit/scenario/core/scenario.py Resolved
Comment thread pyrit/scenario/core/required_data.py Resolved
Comment thread pyrit/scenario/core/scenario.py Resolved
…ject empty population

Required data and the population configuration are now fetched first and validated as one
batch: when either half refreshes, each configuration and the scenario's full unsampled
assembly run against all candidates before anything is written. A refresh of templates now
sees records fetched in the same run, a valid joint refresh is accepted, and a records-only
refresh that the assembly rejects leaves the stored rows and ids unchanged.

A global fetch override now reaches required sources without their own policy even when the
population has sources, and a source selection that names only required datasets is rejected
instead of silently restoring the default population.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 09:04

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Comment thread pyrit/scenario/core/scenario.py Resolved
…ataset names

A compound population names its datasets through its children, so its own sources are empty
and its parent fetch is not the requested one. Required data now keeps its resolved fetch
policy whenever the population names any dataset, so fetch=never and fetch=always reach the
required sources for compound populations too.

Preparing required data and the population together now rejects a dataset named by both
before anything is fetched. Candidates are keyed by name, so a shared name validated one
batch and then committed both.

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