Skip to content

FIX Validate the jailbreak goal and success threshold in FuzzerGenerator - #3396

Merged
Richard Lundeen (richlundeen) merged 2 commits into
microsoft:mainfrom
ShivamSharma43:fix/fuzzer-goal-threshold-validation
Oct 25, 2026
Merged

Richard Lundeen (richlundeen) merged 2 commits into
microsoft:mainfrom
ShivamSharma43:fix/fuzzer-goal-threshold-validation

Conversation

@ShivamSharma43

@ShivamSharma43 Shivam Sharma (ShivamSharma43) commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #3394.

Validate the two FuzzerGenerator settings that control success and completion:

  • Reject target_jailbreak_goal_count values below 1. Such values stop the run before it sends a prompt.
  • Reject scoring_success_threshold values outside the closed interval [0.0, 1.0], including NaN.

Use simple bounds checks within the declared int/float API. Do not add runtime type or bool checks. Keep valid values and threshold endpoints unchanged. The constructor docstring states both bounds.

Tests and Documentation

Tests cover goal counts 0 and -1, thresholds -0.1, 1.5, and NaN, and valid threshold endpoints 0, 0.0, 1, and 1.0. Existing initialization tests cover the valid default goal count of 1 and a larger goal count.

Validation for commit e87c89b:

  • uv sync --frozen --extra all: passed; uv.lock unchanged.
  • uv run --no-sync pytest tests\unit\executor\promptgen\fuzzer -q: passed, 102 tests; one existing deprecation warning.
  • uv run --no-sync pre-commit run --all-files with UV_NO_SYNC=1: passed after environment setup completed.
  • git diff --check: passed.

Documentation changes are limited to the constructor docstring. JupyText was not run because no notebook or documentation example changed.

A target_jailbreak_goal_count below 1 is already met before the first
iteration, so the fuzzer returned without sending a prompt. A
scoring_success_threshold outside [0, 1] made every float score a jailbreak
(below 0) or none of them (above 1, which runs until the query limit). Both
are now rejected at construction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 12:09

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

The value bounds are useful: a non-positive goal can stop the run before it sends a prompt, and an invalid threshold can make success impossible. Please simplify this to those domain checks: target_jailbreak_goal_count < 1 and not 0.0 <= scoring_success_threshold <= 1.0. The latter also rejects NaN.

The parameters already declare int and float types. The extra isinstance/bool checks and the strings/None test cases add defensive complexity outside that contract. I would keep the boundary tests and approve the smaller change.

Reviewed with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 25, 2026
Merged via the queue into microsoft:main with commit 4669402 Oct 25, 2026
65 checks passed
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.

BUG: FuzzerGenerator accepts a jailbreak goal below 1 and a success threshold outside [0, 1]

3 participants