Skip to content

FEAT: Add WildJailbreak dataset loader - #4535

Merged
Roman Lutz (romanlutz) merged 25 commits into
microsoft:mainfrom
WaqarAnwar:feat/wildjailbreak-dataset-loader
Nov 26, 2026
Merged

Roman Lutz (romanlutz) merged 25 commits into
microsoft:mainfrom
WaqarAnwar:feat/wildjailbreak-dataset-loader

Conversation

@WaqarAnwar

Copy link
Copy Markdown
Contributor

Description

Adds a seed dataset loader for WildJailbreak (Jiang et al., 2024), AI2's synthetic set of jailbreak prompts built from tactics observed in real user chats. Closes #4511.

  • _WildJailbreakDataset subclasses _RemoteDatasetLoader and returns SeedPrompts, because the adversarial rows are literal messages to send.
  • Two filters: WildJailbreakSplit (EVAL, TRAIN) and WildJailbreakDataType (the four data_type values).
  • By default it loads the eval config's adversarial_harmful rows (2,000 prompts). The train config (~530 MB) is only loaded when requested.
  • For adversarial rows the seed value is the adversarial text; for vanilla rows it is the vanilla text. split and data_type go in the metadata, plus vanilla (train adversarial rows) and label (eval rows) when present. The completion column is never loaded.
  • The dataset is gated: the loader takes a token argument, falls back to HUGGINGFACE_TOKEN, and says so in its docstring. It is added to _HF_GATED_PROVIDERS in the end-to-end dataset test.
  • The paper is cited in references.bib and bibliography.md, and the dataset is listed in 1_loading_datasets.

Differences between the issue and the real dataset

I ran the loader against the real dataset. Four things differ from the schema in the issue, which came from the dataset card:

  1. No tactics column. Neither config has one, so tactics can't be stored in the metadata.
  2. Different eval columns. eval has only adversarial, label and data_type, with no vanilla column. train has vanilla, adversarial, completion and data_type.
  3. HF split named train in both configs. Each config ships its rows under one HuggingFace split called train, including the eval config, so the loader always requests split="train" and picks the config with split.
  4. Empty train rows. 21 adversarial_benign rows have an empty adversarial text, and the loader skips them. The train config has 261,559 rows, so the loader returns 261,538.

The dataset has no harm-category column, so seeds carry no harm_categories.

Real-data counts (eval: 2,210 rows; train: 261,559 rows):

Selection Seeds
Default (eval, adversarial_harmful) 2,000
eval, adversarial_benign 210
train, adversarial_harmful 82,728
train, adversarial_benign 78,710
train, vanilla_harmful 50,050
train, vanilla_benign 50,050

Add a gated HuggingFace loader for AI2's WildJailbreak dataset with
WildJailbreakSplit and WildJailbreakDataType filters. Defaults to the eval
config's 2,000 adversarial_harmful prompts; the ~530 MB train config is opt-in.

Closes microsoft#4511
Copilot AI balanced review requested due to automatic review settings November 21, 2026 13:56

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

The new async tests in tests/unit/datasets/test_wildjailbreak_dataset.py omit the mandatory _async suffix required by the repository style guide.

1 open issue
What changed in this PR

Adds WildJailbreak to PyRIT’s remote seed datasets, addressing #4511 with a gated loader that defaults to 2,000 adversarial harmful evaluation prompts.

Changes:

  • Adds config and data-type filters, token handling, and prompt metadata preservation.
  • Registers the loader and enums, adds mocked unit tests, and marks the dataset as gated in end-to-end tests.
  • Updates dataset documentation and adds the paper citation.
File Description
tests/​unit/​datasets/​test_wildjailbreak_dataset.py Tests filtering, prompt mapping, validation, and token handling.
tests/​end_to_end/​test_all_datasets.py Adds WildJailbreak to the gated-provider set.
pyrit/​datasets/​seed_datasets/​remote/​wildjailbreak_dataset.py Implements the loader and filter enums.
pyrit/​datasets/​seed_datasets/​remote/​__init__.py Exposes the loader and enums through lazy exports.
doc/​references.bib Adds the WildTeaming paper reference.
doc/​code/​datasets/​1_loading_datasets.py Lists WildJailbreak in the documentation source.
doc/​code/​datasets/​1_loading_datasets.ipynb Updates the dataset list and displayed discovery output.
doc/​bibliography.md Includes the new citation key.

Review effort: Balanced

@WaqarAnwar

Copy link
Copy Markdown
Contributor Author

Hi Roman Lutz (@romanlutz) ,

Kindly review this PR

Thanks

Roman Lutz (romanlutz) and others added 23 commits November 21, 2026 10:58
…ilbreak loader

Gated HF loaders (HarmEval, HiXSTest, MASK, SG-XSTest) declare
required_environment_variables and access_url so the dataset catalog
descriptor surfaces the gating requirement; mirror that here.

Co-Authored-By: Claude Fable 5 <[email protected]>
…dataset-loader' into feat/wildjailbreak-dataset-loader
…nwar/PyRIT into feat/wildjailbreak-dataset-loader
…nwar/PyRIT into feat/wildjailbreak-dataset-loader
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 26, 2026
Merged via the queue into microsoft:main with commit 4d32cda Nov 26, 2026
72 checks passed
Siddhant Rajhans (siddhant-rajhans) added a commit to siddhant-rajhans/PyRIT that referenced this pull request Nov 26, 2026
Main's WildJailbreak loader (microsoft#4535) added @jiang2024wildteaming to the
hidden-citations block in doc/bibliography.md, the same line where this
branch adds @bhatt2024cyberseceval2. The resolution keeps both keys in
alphabetical order; doc/references.bib merged cleanly with both entries.
Siddhant Rajhans (siddhant-rajhans) added a commit to siddhant-rajhans/PyRIT that referenced this pull request Nov 27, 2026
Main's CyberSecEval prompt injection scorer (microsoft#4440) and WildJailbreak loader
(microsoft#4535) touched the same files as this branch:

- THIRD_PARTY_NOTICES.txt: both notices are kept, main's CyberSecEval notice
  first.
- doc/bibliography.md: the citation keys are the sorted union of both sides.
- tests/unit/score/test_target_judge.py: both scorers are in the judge list.
- doc/code/scoring/0_scoring.ipynb: main's notebook, with the scorer table
  printed again from the merged code, so it adds the NemotronSafetyGuardScorer
  row at main's column widths.
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.

FEAT: Add WildJailbreak dataset loader (gated; tactic-based jailbreak prompts)

3 participants