Skip to content

FEAT: Adding Expectations to Attacks (Scorer Generalization Phase 4) - #2692

Merged
Richard Lundeen (richlundeen) merged 5 commits into
microsoft:mainfrom
richlundeen:richlundeen-pyrit-scorer-design
Sep 18, 2026
Merged

Richard Lundeen (richlundeen) merged 5 commits into
microsoft:mainfrom
richlundeen:richlundeen-pyrit-scorer-design

Conversation

@richlundeen

Copy link
Copy Markdown
Contributor

This implements phase 4 of the scorer generalization design by adding a per-execution ScoringExpectation to the shared attack contract. Attacks now resolve and forward the effective expectation to objective and auxiliary scorers while preserving attack-specific refusal and preparation criteria. The change also validates condition routing before execution, preserves scoring context through compound attacks, and documents the updated behavior. See the design proposal for the full phase model.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread pyrit/score/scorer.py
Comment thread pyrit/score/scorer.py
Comment thread pyrit/executor/attack/multi_turn/tree_of_attacks.py
Comment thread doc/code/executor/4_compound.ipynb Outdated
Comment thread pyrit/score/message_scorer.py
Validate wrapped scorers before attack execution, preserve component context across async failures, and clarify scoring compatibility and compound outcomes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread doc/code/executor/3_attack_configuration.ipynb Outdated
Exclude function-local scorer classes from automatic discovery while preserving instance registration. Add regression coverage and clarify the attack configuration example.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread pyrit/executor/attack/multi_turn/tree_of_attacks.py Outdated
Require nodes to use the resolved execution expectation and remove the per-turn fallback. Update direct node fixtures and cover default and explicit expectations through branching.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Sep 18, 2026
Merged via the queue into microsoft:main with commit b8cab0a Sep 18, 2026
49 checks passed
@richlundeen
Richard Lundeen (richlundeen) deleted the richlundeen-pyrit-scorer-design branch September 18, 2026 22:41
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.

4 participants