Skip to content

MAINT: declare PromptInject templates as required data - #3546

Draft
Utkarsh Bahuguna (u7k4rs6) wants to merge 16 commits into
microsoft:mainfrom
u7k4rs6:feat/required-data-prompt-inject
Draft

Utkarsh Bahuguna (u7k4rs6) wants to merge 16 commits into
microsoft:mainfrom
u7k4rs6:feat/required-data-prompt-inject

Conversation

@u7k4rs6

Copy link
Copy Markdown
Contributor

Second scenario for #3336, on top of #3464 so only the last commit is new here. PromptInject's context and technique templates move to get_required_data, and PromptInjectDatasetConfiguration keeps just goal_texts and max_total with the per-goal coverage sampling. Its own uncapped and exact-datasets checks are gone, filters and fetch overrides still reach the templates, and the identity still lists both datasets so old runs resume. Passing the templates as sources still works with a deprecation warning.

Part of #3336

Comment thread pyrit/scenario/core/scenario.py Resolved
…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.
Comment thread pyrit/scenario/core/scenario.py Resolved
Comment thread pyrit/scenario/core/scenario.py Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…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.

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