[BREAKING] FEAT: Standardize Jailbreak scenario defaults#2045
[BREAKING] FEAT: Standardize Jailbreak scenario defaults#2045varunj-msft wants to merge 2 commits into
Conversation
|
I think this is easier to think about what we want it to do; and I think the goal is to see how effective various jailbreaks are (or find jailbreaks that work) To do this, let's look at end parameters what a user actually sets on the CLI since I think that's the clearest way to see whether the design hangs together. Roughly the run I'd want to work: pyrit_scan airt.jailbreak \
--initializers target load_default_datasets \
--target openai_chat \
--dataset-names harmbench \ # WHAT: harmful objectives
--jailbreak-names dan aim \ # WHICH jailbreaks (or --num-templates N)
--strategies system user variation \ # HOW: delivery methods
--num-attempts 1Getting the below to work are over-simplifications, and I could see us needing to think about each one, and some may need a PR pre-req. But I think they should be close to working. 1.
|
|
I think this should help: #2071 |
337ba17 to
968de3a
Compare
Standardize Jailbreak to select along three orthogonal axes, matching the
rapid-response scenario model:
- objectives: --dataset-names (default HarmBench)
- techniques: a dynamic strategy class over the shared core catalog, defaulting
to a scenario-local prompt_sending ("just send"); role_play / many_shot / tap /
crescendo etc. are selectable via --strategies
- jailbreaks: --num-templates (random sample, default 10) or --jailbreak-names
(specific), each applied to every (technique x objective) via a per-template
TextJailbreakConverter, grouped by template
Replaces the hand-written JailbreakStrategy enum + match block. VERSION 2 -> 3.
Keeps the selected-template persistence + --resume replay + templates-tried
visibility. Jailbreak templates are applied via TextJailbreakConverter (inline
render); the general-technique / role-delivery mechanism from the earlier design
sketch is intentionally deferred as a follow-up.
Rebuilt this around the 3 axes: harmbench objectives, techniques (default just-send + the core set), and jailbreak selection via num_templates/jailbreak_names on TextJailbreakConverter. I left the delivery-method/general-technique axis for a follow-up since the shape might shift if a refactor is in play. Mentioned in description also. |
|
Similar to the previous ones, this branch is really far behind main and has a bunch of conflicts. The contract has changed (and should be simpler) You likely will want to start from a branch off of main |
Description
Part of the Standardizing Scenarios effort. Redesigns the Jailbreak scenario around three orthogonal selection axes, matching the model Rich outlined and the pattern the rapid-response scenario already uses:
The selected template names are still persisted to ScenarioResult.metadata and replayed on --resume, and the chosen templates remain visible in the "Scenario Inputs" scenario output.
Jailbreak application uses the existing TextJailbreakConverter (which renders the objective into each template). The general-technique / role-based-delivery mechanism from the earlier review sketch (jailbreaks as is_general_technique seeds via with_technique, system/user delivery roles) is intentionally deferred: that path needs net-new infrastructure that doesn't exist yet, and the exact mechanism will change once the upcoming params refactor lands. This PR delivers the standardized 3-axis param structure now; the internal jailbreak-application mechanism can migrate later without changing the user-facing axes.
This is BREAKING because a default scan now produces different atomic attacks (new dataset, new default technique). VERSION is bumped to 3, so stored results from the old default raise cleanly on --resume instead of silently mixing. Constructor signatures and the public API are otherwise unchanged.
Naming note: the jailbreaks axis is exposed as jailbreak_names + num_templates, mirroring the dataset axis's dataset_names + max_dataset_size levers. Happy to consolidate to a single jailbreaks selector when the params refactor lands.
Tests and Documentation
Rewrote tests/unit/scenario/airt/test_jailbreak.py around the 3-axis shape: class-level properties (VERSION 3, harmbench default, param names), the dynamic strategy class (prompt_sending default, core techniques available), init validation (mutually-exclusive num_templates/jailbreak_names, unknown-name error), atomic-attack construction (default "just send" crosses templates x objectives, display_group = template, num_attempts multiplies with unique names, explicit strategy adds the technique axis, baseline prepended centrally), and resume (persisted names replayed). All pass; full scenario suite green; ruff, ruff-format, and ty clean.
Updated the AIRT scanner doc (doc/scanner/airt.py + .ipynb) to the 3-axis usage and fast path; jupytext .py/.ipynb pair in sync.