Skip to content

FEAT: Adversarial Benchmark Scenario#1662

Merged
ValbuenaVC merged 35 commits into
microsoft:mainfrom
ValbuenaVC:benchmark
May 7, 2026
Merged

FEAT: Adversarial Benchmark Scenario#1662
ValbuenaVC merged 35 commits into
microsoft:mainfrom
ValbuenaVC:benchmark

Conversation

@ValbuenaVC
Copy link
Copy Markdown
Contributor

@ValbuenaVC ValbuenaVC commented Apr 27, 2026

Description

Adds a benchmarking scenario (AdversarialBenchmark) to PyRIT to compare the performance between adversarial targets. Measurement of success uses attack success rate (ASR). The benchmarking scenario is unique in that it takes models as a runtime argument, so we override _get_atomic_attacks_async to patch in live adversarial targets while using the AttackTechniqueRegistry to build AdversarialBenchmarkStrategy. The scenario takes list[PromptTarget] in its constructor.

Includes minor changes to SCENARIO_TECHNIQUES (including adding another attack technique) and a small change to test_rapid_response.py because of said change. Also adds a light aggregate for faster attacks that are benchmark friendly.

Also includes limited parameter support from #1680.

Tests and Documentation

Added tests/unit/scenario/test_benchmark.py.
Updated tests/unit/scenario/test_rapid_response.py.

Victor Valbuena added 2 commits April 23, 2026 17:33
@ValbuenaVC ValbuenaVC changed the title Benchmark [DRAFT] FEAT: Benchmark Scenario Apr 27, 2026
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
@ValbuenaVC ValbuenaVC marked this pull request as ready for review May 1, 2026 23:40
@ValbuenaVC ValbuenaVC changed the title [DRAFT] FEAT: Benchmark Scenario FEAT: Benchmark Scenario May 1, 2026
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py
@rlundeen2 rlundeen2 self-assigned this May 4, 2026
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py
Comment thread pyrit/scenario/scenarios/benchmark/benchmark.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py
@ValbuenaVC ValbuenaVC enabled auto-merge May 6, 2026 16:48
Comment thread doc/scanner/0_scanner.md Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py Outdated
Comment thread doc/scanner/adversarial.py Outdated
Comment thread doc/scanner/0_scanner.md Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py Outdated
Comment thread doc/scanner/adversarial.py Outdated
Comment thread doc/scanner/adversarial.py Outdated
Comment thread doc/scanner/adversarial.py Outdated
Comment thread doc/scanner/adversarial.py Outdated
Comment thread doc/scanner/adversarial.py Outdated
Comment thread pyrit/scenario/scenarios/benchmark/adversarial.py Outdated
@romanlutz romanlutz changed the title FEAT: Benchmark Scenario FEAT: Adversarial Benchmark Scenario May 7, 2026
@ValbuenaVC ValbuenaVC added this pull request to the merge queue May 7, 2026
Merged via the queue into microsoft:main with commit b86bc5c May 7, 2026
48 checks passed
@ValbuenaVC ValbuenaVC deleted the benchmark branch May 7, 2026 13:45
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.

6 participants