Repository navigation
FIX: Record a judge's declined verdict as undetermined instead of an objective error - #4828
Open
Behnam (behnam-o) wants to merge 1 commit into
Open
Behnam (behnam-o) wants to merge 1 commit into
Behnam (behnam-o) wants to merge 1 commit into
Conversation
…objective error A scenario's default objective scorer raised ScorerLLMResponseBlockedException when the provider behind its judge blocked a scoring request, so one declined verdict errored the objective and failed the run. The message also always blamed content filtering and dropped the provider's reason, such as a cyber_policy block. - Default Scenario.RAISE_IF_DEFAULT_SCORER_BLOCKS to False, drop the AdversarialBenchmark override it makes redundant, and apply the policy to Psychosocial's own default scorers. - Carry the provider's response in the exception and the undetermined rationale, without the scorer-name prefixes added as the exception propagates. Only suggest disabling content filters when a content filter blocked the request. - Rebuild the same reason when replaying a stored blocked judgment, and log an unreachable verdict at warning level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes that treat declined judgments as undetermined while preserving provider explanations.
No open issues 🎉
What changed in this PR
Changes default scenario scoring so declined judgments produce an UNDETERMINED verdict rather than an objective error, preserving the provider’s reason.
Changes:
- Applies the non-raising default policy across scenarios, including Psychosocial.
- Preserves blocked-judgment explanations through wrappers and replay, with content-filter-specific advice.
- Updates regression tests and scenario documentation.
| File | Description |
|---|---|
tests/unit/score/test_scorer.py |
Tests provider reasons, refusals, truncation, and fallback scores. |
tests/unit/score/test_judgment_observation.py |
Checks live and replayed rationale consistency. |
tests/unit/score/test_conversation_source.py |
Checks wrapper error prefixes are omitted from rationales. |
tests/unit/scenario/core/test_scenario_refusals.py |
Tests scenario completion after a declined judgment. |
tests/unit/scenario/core/test_scenario_readiness.py |
Accommodates copied default scorers. |
tests/unit/scenario/airt/test_psychosocial.py |
Tests Psychosocial’s blocked-judgment fallback. |
tests/unit/build_scripts/test_evaluate_scorers.py |
Checks provider-specific rationale text. |
pyrit/score/message_scorer.py |
Preserves reasons in live and replayed undetermined scores. |
pyrit/score/llm_scoring.py |
Formats bounded provider explanations and filter-specific advice. |
pyrit/scenario/scenarios/benchmark/adversarial.py |
Removes the redundant block-policy override. |
pyrit/scenario/scenarios/airt/psychosocial.py |
Applies scenario policy to harm-specific scorers. |
pyrit/scenario/core/scenario.py |
Defaults blocked judgments to non-raising handling. |
pyrit/exceptions/exception_classes.py |
Retains the original reason independently of wrapper prefixes. |
doc/code/scenarios/0_scenarios.py |
Documents undetermined scoring outcomes. |
doc/code/scenarios/0_scenarios.ipynb |
Mirrors the scenario documentation update. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When the provider behind a scenario's default objective scorer declines to score a response (for example HTTP 400
cyber_policy), the objective was recorded as an error and the run failed. The error also blamed content filtering and dropped the provider's reason. This PR records the declined judgment as an undetermined verdict that keeps the provider's reason.Scenario.RAISE_IF_DEFAULT_SCORER_BLOCKS(added in FEAT: Improve adversarial benchmark dataset and scoring #2551) toFalse, and drop theAdversarialBenchmarkoverride this makes redundant.Psychosocial, which builds its own default scorers, now applies the policy too.ScorerLLMResponseBlockedExceptionand the undetermined rationale now carry the provider's response: the error payload or the model's refusal, capped in length. Only a content-filter block gets the advice to use an endpoint with content filtering disabled (Fix crash when scorer LLM response is blocked by content filter #2072).UNDETERMINED.Before / After.
Cyberscenario, 3 objectives. The scoring target rejects the judgment for one of them with HTTP 400cyber_policy.Before:
After:
To keep the old behavior, set
RAISE_IF_DEFAULT_SCORER_BLOCKS = Trueon a scenario subclass or pass your own objective scorer. The raised exception now names the provider's reason.Related: #2551, #2072.
🤖 Generated with Claude Code