Skip to content

FIX: Apply Cyber's malware scoring question in its default scorer - #4179

Draft
Richard Lundeen (richlundeen) wants to merge 1 commit into
microsoft:mainfrom
richlundeen:richlundeen-cyber-scoring-questions
Draft

Richard Lundeen (richlundeen) wants to merge 1 commit into
microsoft:mainfrom
richlundeen:richlundeen-cyber-scoring-questions

Conversation

@richlundeen

Copy link
Copy Markdown
Contributor

Description

Cyber's default objective scorer never used its malware question. This PR connects it so that, by default, Cyber counts a response as a success only when it contains concrete malware and isn't a refusal.

  • The bug: Cyber defined get_override_composite_scorer_questions_path(), but Scenario._get_default_objective_scorer() only calls _get_additional_scoring_questions(). Nothing called Cyber's method, so the base hook returned () and malware.yaml was never loaded.
  • Origin: the names diverged in MAINT unify how default adversarial and scorer targets are set in scenarios #1695 (b0e91f8). That PR replaced Cyber's own _get_default_objective_scorer() override, which built malware AND not-refused, with the class-method hook. Leakage and Scam were converted to the hook's name; Cyber was not.
  • What users saw: no error. Cyber runs that relied on the default scorer were scored by the registered default objective scorer (a general "was the objective achieved" rubric). With no registered default, they fell back to the inverted refusal scorer, so any response that wasn't a refusal counted as a success.
  • Fix: rename Cyber's override to _get_additional_scoring_questions(). The base now builds TrueFalseCompositeScorer(AND, [malware question, inverted refusal]). Like every scenario that declares scoring questions, this takes precedence over a registered default objective scorer and reuses that scorer's chat target.
  • VERSION 3 → 4: default scoring changes, so use_cached won't match runs scored the old way.
  • Test: a new unit test builds Cyber's default scorer and checks it is the malware-plus-not-refused composite. It fails on main.

Other scenarios with scoring questions (Leakage, Scam, AdversarialBenchmark, FigStep) already use the correct name. Cyber is about to be held up as the model scenario in #4175, so this also stops the dead method from being copied.

🤖 Generated with Claude Code

Cyber defined get_override_composite_scorer_questions_path(), but the
Scenario base only calls _get_additional_scoring_questions(). The names
diverged in b0e91f8 (microsoft#1695), so Cyber's default objective scorer never
used malware.yaml and fell back to the registry default scorer or the
inverted refusal scorer.

Rename the override to the hook the base calls, bump VERSION to 4 since
default scoring changes, and test that the default scorer is the malware
question AND not-refused composite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 01:05

Copilot AI 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.

🟢 Approval recommended

No active review issues were reported for the change connecting Cyber’s malware scoring to the default scorer.

No open issues 🎉

What changed in this PR

This PR connects Cyber’s malware scoring question to the scenario base class’s default-scorer hook, so default success scoring requires malware content and no refusal.

Changes:

  • Rename Cyber’s hook to _get_additional_scoring_questions().
  • Bump VERSION from 3 to 4 to prevent reuse of cached results scored under the previous behavior.
  • Add a regression test checking the malware scorer and inverted-refusal composite.
File Description
tests/​unit/​scenario/​airt/​test_cyber.py Update the version assertion and verify the default scorer composition.
pyrit/​scenario/​scenarios/​airt/​cyber.py Correct the scoring hook name and bump the scenario version.

Review effort: Balanced

This branch has not been deployed

No deployments
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