Skip to content

FIX: Include adversarial config in attack and eval identity - #1959

Merged
rlundeen2 merged 6 commits into
microsoft:mainfrom
rlundeen2:rlundeen2/adversarial-config-eval-identifier
Jun 9, 2026
Merged

FIX: Include adversarial config in attack and eval identity#1959
rlundeen2 merged 6 commits into
microsoft:mainfrom
rlundeen2:rlundeen2/adversarial-config-eval-identifier

Conversation

@rlundeen2

Copy link
Copy Markdown
Contributor

Add a get_attack_adversarial_config() hook (mirroring get_attack_scoring_config()) so the adversarial chat target plus its system/seed prompts flow into both the component identity hash and the atomic-attack eval hash. Previously the adversarial_chat eval rule existed but nothing ever emitted an adversarial_chat child, so it was dead config.

So before this fix, two attacks that differed only by adversarial model, adversarial system prompt, or adversarial seed prompt produced identical eval hashes (and identical component hashes). Now, any changes to these values produces different eval hashes and identity hashes.

Add a get_attack_adversarial_config() hook (mirroring get_attack_scoring_config())
so the adversarial chat target plus its system/seed prompts flow into both the
component identity hash and the atomic-attack eval hash. Previously the
adversarial_chat eval rule existed but nothing ever emitted an adversarial_chat
child, so it was dead config.

- Add inline system_prompt support to AttackAdversarialConfig and deprecate
  system_prompt_path (removed_in 0.17.0); add resolve_adversarial_system_prompt.
- Emit adversarial_chat child + adversarial_system_prompt/adversarial_seed_prompt
  params from the base attack strategy identity.
- Wire the hook through RedTeaming, Crescendo, TAP/PAIR, RolePlay, and
  ContextCompliance.
- Update AttackTechniqueFactory to take adversarial_system_prompt (not path).
- Migrate internal callsites off the deprecated system_prompt_path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hannahwestra25
hannahwestra25 self-requested a review June 9, 2026 15:25
Comment thread pyrit/executor/attack/multi_turn/tree_of_attacks.py
Comment thread pyrit/scenario/core/attack_technique_factory.py
Comment thread pyrit/executor/attack/core/attack_config.py Outdated

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

some small nits

…mpts

Inline system-prompt strings are trusted and declare the required parameters
themselves, so the missing-parameter check was a no-op for them. Restructure
resolve_adversarial_system_prompt so validation runs only for explicitly
provided SeedPrompts, making the trust-vs-validate split explicit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rlundeen2
rlundeen2 enabled auto-merge June 9, 2026 20:45
rlundeen2 and others added 4 commits June 9, 2026 14:18
Covers the previously-untested branches flagged by diff coverage: the both-set

deprecation warning and explicit-SeedPrompt validation in resolve_adversarial_system_prompt;

the hook return-None guards across the five adversarial strategies; RedTeaming's default

seed-prompt fallback; and the factory's YAML system_prompt_path resolution, baked-prompt

conflict, and SeedPrompt serialization paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace a :class: reST role with double-backticks in attack_config (MyST renders

docstrings, not Sphinx), and apply ruff format + import sorting to feature files

flagged by the CI pre-commit run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
main dropped the MessagePiece.scores attribute in favor of

CentralMemory.get_prompt_scores(). Update TAP's _get_score_for_response to

use the new API so ty type-checks and scores resolve correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rlundeen2
rlundeen2 added this pull request to the merge queue Jun 9, 2026
Merged via the queue into microsoft:main with commit 2e47bf3 Jun 9, 2026
47 checks passed
@rlundeen2
rlundeen2 deleted the rlundeen2/adversarial-config-eval-identifier branch June 9, 2026 22:08
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