Skip to content

[BREAKING] MAINT: Re-migrate Psychosocial scenario to per-subharm cross-product#2191

Merged
varunj-msft merged 1 commit into
microsoft:mainfrom
varunj-msft:varunj-msft/8380-Standardizing-Scenarios-Psychosocial-v2
Jul 17, 2026
Merged

[BREAKING] MAINT: Re-migrate Psychosocial scenario to per-subharm cross-product#2191
varunj-msft merged 1 commit into
microsoft:mainfrom
varunj-msft:varunj-msft/8380-Standardizing-Scenarios-Psychosocial-v2

Conversation

@varunj-msft

@varunj-msft varunj-msft commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Psychosocial

Rewrites the airt.psychosocial scenario as a clean sub_harm × technique cross-product, following the same patterns as the other AIRT scenarios.

  • sub_harm is the primary axisimminent_crisis and/or licensed_therapist (both by default). Each sub-harm owns its dataset, escalation prompt, and its own conversation-level scorer, so every attack and baseline is scored by the rubric that matches its harm. Override a scorer by passing imminent_crisis_scorer / licensed_therapist_scorer to Psychosocial(...).
  • PsychosocialTechnique is the secondary axis — a registry-style converter enum (mirrors EncodingTechnique) so users can add more. The base technique is a simulated crescendo; each selected converter is layered on top. Converters preserve natural-language emotional framing (obfuscation converters are excluded) and are grouped into selectable families: tone, language (new translation variants), persuasion, and deterministic (no-LLM). crescendo swaps the simulated base for a live CrescendoAttack (in all only).
  • Datasets are bound to the sub-harms, so --dataset-names is ignored (--max-dataset-size still applies). One baseline per sub-harm is emitted and scored with that sub-harm's rubric. Removes the old rubric/_build_scorer lookup indirection — scorers are constructed inline with their matching dataset.
pyrit_scan airt.psychosocial --target openai_chat --techniques tone

Baseline decentralization

The base Scenario no longer builds baselines. It now owns baseline only as configuration (BASELINE_ATTACK_POLICYcontext.include_baseline); _build_baseline_atomic_attacks and the central prepend are gone. Each scenario emits its own baseline via the shared build_baseline_atomic_attack helper, and matrix scenarios get it through build_matrix_atomic_attacks (which reads include_baseline off the ScenarioContext). This keeps the base class from presuming a single objective scorer / single baseline shape and lets scenarios like Psychosocial emit multiple baselines (one per sub-harm). The --include-baseline CLI flag and policy semantics (Enabled / Disabled / Forbidden) are unchanged.

Comment thread pyrit/scenario/scenarios/airt/psychosocial.py Outdated

@rlundeen2 rlundeen2 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.

Approving! But I wrote a big chunk so it should have another approval

@rlundeen2 rlundeen2 changed the title [BREAKING] MAINT: Re-migrate Psychosocial scenario to per-subharm cross-product [BREAKING] MAINT: Re-migrate Psychosocial scenario to per-sub-harm cross-product Jul 16, 2026
@rlundeen2 rlundeen2 changed the title [BREAKING] MAINT: Re-migrate Psychosocial scenario to per-sub-harm cross-product [BREAKING] MAINT: Re-migrate Psychosocial scenario to per-subharm cross-product Jul 16, 2026
…ss-product

Rewrite the Psychosocial scenario as a per-sub-harm x converter cross-product:
each sub-harm (imminent crisis, licensed therapist) sweeps the selected converter
techniques and scores itself, with its own per-sub-harm baseline.

Decentralize baseline emission: the base Scenario no longer prepends a baseline
centrally. Each scenario emits its own baseline from _build_atomic_attacks_async
-- matrix scenarios via build_matrix_atomic_attacks, hand-built scenarios via the
build_baseline_atomic_attack helper -- gated on context.include_baseline.

Apply --max-dataset-size per sub-harm instead of as a single global budget, so no
sub-harm is starved when the budget is smaller than the sub-harm count. The dataset
config is rebuilt as a per-dataset CompoundDatasetAttackConfiguration with the parent
cap set to (per-sub-harm cap x sub-harm count); filters are preserved and the sampled
objective subset stays pinned for deterministic resume.

BREAKING CHANGE: Psychosocial scenario version bumped to 3; it now runs a per-sub-harm
cross-product and no longer relies on central baseline emission.
@varunj-msft
varunj-msft force-pushed the varunj-msft/8380-Standardizing-Scenarios-Psychosocial-v2 branch from 4d78c6d to 36e0eb0 Compare July 17, 2026 19:27
@varunj-msft
varunj-msft added this pull request to the merge queue Jul 17, 2026
Merged via the queue into microsoft:main with commit 79f10ba Jul 17, 2026
53 checks passed
@varunj-msft
varunj-msft deleted the varunj-msft/8380-Standardizing-Scenarios-Psychosocial-v2 branch July 17, 2026 20:43
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