Repository navigation
DOC: Add capability columns to the scorer reference table - #4358
Merged
Richard Lundeen (richlundeen) merged 27 commits intoNov 23, 2026
Merged
Richard Lundeen (richlundeen) merged 27 commits into
Richard Lundeen (richlundeen) merged 27 commits into
Conversation
Scenarios that opt in (RapidResponse, Cyber, Leakage) accept a CompatibleScorers pool in place of one objective scorer. Each candidate can be bound to an evaluation key, datasets name the key they need on DatasetSource, and techniques state algorithm needs such as a float value on true/false results. The matrix builder selects once per technique and dataset, without calling a judge model. A candidate qualifies when it accepts the attack's evidence, carries the required key, meets the technique's needs, and accepts every objective's conditions. Pool order breaks ties. When nothing qualifies, the existing incompatible technique policy skips or raises, naming each candidate's reason and the keys the pool has. Scorer validation now raises typed errors (UnsupportedConditionError, MissingConditionError, AmbiguousConditionError) that subclass ValueError and keep their messages, so selection tells a scorer mismatch apart from malformed input. Scorer.capabilities exposes what a scorer accepts, derived from its contracts. Pool runs record each selection in the run plan with the fingerprints of the prepared expectations. Resume re-selects and refuses to continue on drift. Each dataset gets its own baseline judged by the same scorer as its attacks. Runs with one scorer keep their plan shape, group ids, baseline, and identity.
…loat feedback TAP no longer requires a FloatScaleThresholdScorer or reads a threshold. Any true/false objective scorer that guarantees a float value on each complete verdict qualifies, which FloatScaleThresholdScorer does and a TrueFalseFallbackScorer does when both of its scorers do. Inverters clear the guarantee. FloatFeedback in pyrit.models owns the existing original_float_value key and its readers and writers, so stored scores need no migration. Ordinary reads treat missing or unusable data as unset; strict reads reject it. A scorer that promises the value is held to it at the public, nested, and reused result boundaries. TAP ranks a true verdict first, then complete scores by their kept value, so a successful branch at 0.60 is never pruned for a failed one at 0.65. Undetermined results keep their outcomes. TAPAttackScoringConfig.threshold is deprecated and works only for threshold-backed scorers. TAP declares the requirement on the attack class, and scenarios check it before building TAP: the matrix builder selects a scorer that keeps the value and passes it in TAP's own config type, the adaptive scenario skips TAP with the reason, and Execute raises. A scorer without the value is no longer replaced with TAP's default judge.
A new page lists every public scorer class with its result family, the evidence it accepts, the condition type it evaluates, and whether a true/false result keeps float feedback, which TAP requires. The table is generated from class-level contracts by build_scripts/generate_scorer_capability_table.py, which constructs no scorer and needs no credentials. Where a contract depends on configuration, the page says so and points to scorer.capabilities on a configured scorer. Tests keep the page current with the generator, prove that no scorer is constructed, require every true/false class that overrides the float feedback hook to be described, and check the table against configured scorers.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Source scoring requirements are silently ignored by non-matrix scenarios, and inconsistent group IDs cause running pool-backed groups to appear pending.
2 open issues
What changed in this PR
Adds a generated scorer-capability reference to PyRIT’s scoring documentation. The reviewed diff also includes the stacked scorer-pool and TAP float-feedback changes that the page documents.
Changes:
- Generate the capability table from class contracts without constructing scorers, with freshness and contract checks.
- Expose configured scorer capabilities and enforce float-feedback guarantees for TAP.
- Add per-dataset scorer selection and record pool bindings for readiness and resume validation.
| File | Description |
|---|---|
tests/unit/score/test_scorer_selection.py |
Tests scorer requirements, selection, and diagnostics. |
tests/unit/score/test_scorer_catalog.py |
Checks table freshness and capability descriptions. |
tests/unit/score/test_float_feedback_guarantee.py |
Tests feedback guarantees and stored-score reuse. |
tests/unit/scenario/scenarios/technique/test_execute.py |
Tests TAP feedback compatibility checks. |
tests/unit/scenario/scenarios/adaptive/test_text_adaptive.py |
Tests skipping techniques without required feedback. |
tests/unit/scenario/scenarios/adaptive/test_image_technique_adaptive.py |
Sets explicit feedback capability on mocks. |
tests/unit/scenario/core/test_matrix_scorer_pool.py |
Tests pool selection, policies, and baselines. |
tests/unit/scenario/airt/test_rapid_response_scorer_pool.py |
Tests pool readiness, identity, and resume checks. |
tests/unit/models/test_float_feedback.py |
Tests feedback metadata validation and helpers. |
tests/unit/executor/attack/test_attack_parameter_consistency.py |
Adds float feedback to TAP mock results. |
tests/unit/executor/attack/multi_turn/test_tree_of_attacks.py |
Tests verdict-first ranking and feedback requirements. |
tests/unit/executor/attack/multi_turn/test_pair.py |
Marks plain scorer mocks as lacking feedback. |
pyrit/score/true_false/true_false_inverter_scorer.py |
Uses the shared feedback-removal helper. |
pyrit/score/true_false/float_scale_threshold_scorer.py |
Declares and writes guaranteed float feedback. |
pyrit/score/scorer.py |
Exposes capabilities and validates feedback guarantees. |
pyrit/score/scorer_selection.py |
Implements ordered, compatibility-based scorer selection. |
pyrit/score/scorer_catalog.py |
Discovers and describes public scorer classes. |
pyrit/score/score_utils.py |
Retains the metadata key’s compatibility alias. |
pyrit/score/message_scorer.py |
Raises typed missing-condition errors. |
pyrit/score/fallback_scorer.py |
Derives feedback guarantees from both children. |
pyrit/score/expectation_errors.py |
Defines typed expectation-validation errors. |
pyrit/score/__init__.py |
Exports selection APIs and validation errors. |
pyrit/scenario/scenarios/technique/execute.py |
Checks technique float-feedback requirements. |
pyrit/scenario/scenarios/airt/rapid_response.py |
Enables objective scorer pools. |
pyrit/scenario/scenarios/airt/leakage.py |
Enables objective scorer pools. |
pyrit/scenario/scenarios/airt/cyber.py |
Enables objective scorer pools. |
pyrit/scenario/scenarios/adaptive/adaptive_scenario.py |
Handles scorer compatibility during technique selection. |
pyrit/scenario/core/technique_requirements.py |
Combines attack and technique scorer requirements. |
pyrit/scenario/core/scenario.py |
Adds pool readiness, identity, and resume handling. |
pyrit/scenario/core/matrix_atomic_attack_builder.py |
Selects scorers per cell and builds matching baselines. |
pyrit/scenario/core/dataset_configuration.py |
Adds dataset-level scorer requirements. |
pyrit/scenario/core/atomic_attack.py |
Stores selected objective-scorer bindings. |
pyrit/models/score/scorer_capabilities.py |
Defines the immutable capability view. |
pyrit/models/score/float_feedback.py |
Centralizes feedback metadata access and validation. |
pyrit/models/score/__init__.py |
Exports capability and feedback models. |
pyrit/models/scenario_progress.py |
Adds scorer bindings to run-plan groups. |
pyrit/models/__init__.py |
Exports new shared models. |
pyrit/executor/attack/multi_turn/tree_of_attacks.py |
Uses verdict-first ranking and requires float feedback. |
pyrit/executor/attack/multi_turn/pair.py |
Updates the scorer-contract docstring only. |
pyrit/executor/attack/core/attack_strategy.py |
Declares the base objective-scorer requirements contract. |
doc/myst.yml |
Adds the capability page to navigation. |
doc/code/scoring/scorer_capabilities.md |
Publishes the generated capability reference. |
doc/code/scenarios/1_common_scenario_parameters.py |
Documents per-dataset scorer pools. |
doc/code/scenarios/1_common_scenario_parameters.ipynb |
Adds the matching scorer-pool notebook explanation. |
doc/code/executor/2_multi_turn.py |
Documents TAP verdict and feedback semantics. |
doc/code/executor/2_multi_turn.ipynb |
Adds the matching TAP notebook explanation. |
build_scripts/generate_scorer_capability_table.py |
Generates the page and supports freshness checks. |
Review effort: Balanced
…d group ids A technique whose scoring config cannot carry the pool's selected scorer is now skipped or raised instead of silently keeping its default judge. The single-scorer baseline leaves out datasets the scorer cannot judge. A technique with no scorer requirements keeps the identity it had before the field existed. Selection fingerprints the expectations the candidate prepared, and the plan and AtomicAttack share one group id. Scenarios that do not check dataset scorer requirements reject datasets that declare them.
…nested float feedback Execute passed a plain scoring config, which a technique that narrows its config type drops, so TAP judged with its own default scorer. It now builds the type the attack accepts around the scenario's scorer. A scorer that promises float feedback is also held to it when a wrapper scores an in-hand message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pass over pool candidates a technique's narrowed scoring config cannot carry (its declared objective_scorer type, as AdaptiveScenario decides it), so a later fitting candidate is chosen; config construction errors now propagate - Skip the single-scorer baseline when no dataset remains instead of failing on an empty seed list - Count any pool candidate's score as the objective score in conversation output - Reject a required evaluation no candidate is bound to when the run is configured - Fold ENFORCES_DATASET_SCORER_REQUIREMENTS into SUPPORTS_OBJECTIVE_SCORER_POOL, drop two unread run-plan binding fields, and reuse fingerprint_expectations - Test resume through _apply_persisted_run_plan, the Cyber and Leakage opt-in, compound requirements, and the requirement guards Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion, and slim the run plan - Check each dataset once against the scorer, before any technique, and raise when no allowed scorer can judge its objectives, whatever the incompatible technique policy; technique needs (TAP's threshold scorer, float feedback) keep the policy - A candidate bound to an evaluation judges only datasets that require it; a dataset that requires none needs an unbound candidate, checked at configuration - Drop expectation fingerprints from the run-plan binding and the resume drift check: group ids already key the selection and resume replays the stored seeds - Build one pool baseline per dataset and judge, named by candidate index - Record a pool as its own identity child instead of the run's objective scorer, and show each attack's recorded judge in conversation output - Trim the scorer-pool doc section to usage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ut call sites - ScorerSelection keeps only the candidate and its pool index; nothing read its requirements or skipped reasons, and the narrowed-config pre-filter no longer remaps them - Docstrings no longer describe recorded inputs or a single scenario objective scorer - Conversation output and both CLI conversation views are tested with a pool run's per-attack judges Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pool's identity is its ordered candidates and their evaluation keys. Run scorer requirements no longer feed it: a requirement that changes a selection already changes the run plan's group ids, and one that keeps the same judge is the same work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example now builds real per-harm judges (Azure Content Safety's hate and violence categories behind threshold scorers) in a code cell instead of a fenced block in markdown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integrate the predecessor before fixed main, keeping both sides' behavior: - attack_strategy.py: combine imports (CapabilityName and AttemptObserver). - matrix_atomic_attack_builder.py: keep microsoft#4353's dataset guard (_check_datasets_can_be_judged), per-candidate baselines, and the annotation-based carried scorer filter; keep the PR's module-level build_technique_scoring_config (single-scorer narrowing, None on a ValueError refusal) and restore _reject for that path. Other config construction errors propagate, as microsoft#4353 required. - test_matrix_scorer_pool.py: keep both sides' tests; point microsoft#4353's annotation-filter tests at a config that still narrows its annotation, since TAP's config now carries any TrueFalseScorer; keep the PR's single-scorer narrowing tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Main is the squash of microsoft#4353 and its tree equals microsoft#4353 head 9fb6507, which the previous merge already integrated. The five conflicted files (models/__init__.py, technique_requirements.py, score/scorer.py, matrix_atomic_attack_builder.py, test_matrix_scorer_pool.py) resolve to that merge result; this merge changes no content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Brings the branch onto main after microsoft#4353 merged, keeping this PR's own changes and fitting them to the updated scorer selection.
The table now takes true/false and float scale from CAPABILITIES, the same declaration main uses for the scorer type, and the configured-scorer test checks float feedback through capabilities.includes.
Brings the branch up to date with microsoft/PyRIT main before the repair. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…econd page Keep one scorer reference table and one helper that lists scorer classes. get_scorer_info() now describes every concrete public scorer (67 classes, up from the 54 Message* subclasses) from its declared contracts: the result family from CAPABILITIES, the accepted evidence, the condition type, and float feedback from the _preserves_float_scale_value overrides. Wrappers report "Uses LLM?" as their wrapped scorers' answer instead of a false "no". The scoring overview's reference table gains the evidence, conditions and float-feedback columns, regenerated by executing the notebook. The no-construction, hook-coverage and configured-scorer agreement tests move to test_scorer_info.py. The separate scorer_capabilities.md page, its generator, scorer_catalog.py and their test are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Richard Lundeen (richlundeen)
approved these changes
Nov 21, 2026
Richard Lundeen (richlundeen)
left a comment
Contributor
There was a problem hiding this comment.
Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.
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
The scorer reference table on the scoring overview page now lists every public scorer class with its result family, the evidence it accepts, the condition type it evaluates, and whether a true/false result keeps float feedback.
get_scorer_info(), which constructs no scorer and needs no credentials. It now covers all 67 concrete scorers, not only the 54Message*subclasses, and a wrapper's "Uses LLM?" is its wrapped scorers' answerscorer.capabilitiesThis builds on the original commits. A follow-up commit folds the new columns and tests into the existing table and
get_scorer_info(), so the docs keep one scorer table, and removes the separatescorer_capabilities.mdpage, its generator, andscorer_catalog.py.