[BREAKING] MAINT: Re-migrate Psychosocial scenario to per-subharm cross-product#2191
Merged
varunj-msft merged 1 commit intoJul 17, 2026
Conversation
rlundeen2
reviewed
Jul 15, 2026
rlundeen2
approved these changes
Jul 16, 2026
rlundeen2
left a comment
Contributor
There was a problem hiding this comment.
Approving! But I wrote a big chunk so it should have another approval
…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
force-pushed
the
varunj-msft/8380-Standardizing-Scenarios-Psychosocial-v2
branch
from
July 17, 2026 19:27
4d78c6d to
36e0eb0
Compare
varunj-msft
deleted the
varunj-msft/8380-Standardizing-Scenarios-Psychosocial-v2
branch
July 17, 2026 20:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Psychosocial
Rewrites the
airt.psychosocialscenario as a cleansub_harm × techniquecross-product, following the same patterns as the other AIRT scenarios.sub_harmis the primary axis —imminent_crisisand/orlicensed_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 passingimminent_crisis_scorer/licensed_therapist_scorertoPsychosocial(...).PsychosocialTechniqueis the secondary axis — a registry-style converter enum (mirrorsEncodingTechnique) 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, anddeterministic(no-LLM).crescendoswaps the simulated base for a liveCrescendoAttack(inallonly).--dataset-namesis ignored (--max-dataset-sizestill applies). One baseline per sub-harm is emitted and scored with that sub-harm's rubric. Removes the oldrubric/_build_scorerlookup indirection — scorers are constructed inline with their matching dataset.Baseline decentralization
The base
Scenariono longer builds baselines. It now owns baseline only as configuration (BASELINE_ATTACK_POLICY→context.include_baseline);_build_baseline_atomic_attacksand the central prepend are gone. Each scenario emits its own baseline via the sharedbuild_baseline_atomic_attackhelper, and matrix scenarios get it throughbuild_matrix_atomic_attacks(which readsinclude_baselineoff theScenarioContext). 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-baselineCLI flag and policy semantics (Enabled / Disabled / Forbidden) are unchanged.