Measuring PyRIT scorer accuracy with scorer metrics

Before you rely on a PyRIT scorer's verdicts, measure how well it agrees with human labels, track its identity hash and check inter-rater agreement.

On this page

Why measuring PyRIT scorer accuracy comes before trusting any verdict

Before a PyRIT red team run supports a release, audit or risk decision, you need evidence that the scorer deciding each verdict is accurate enough for that decision. A scorer is itself a model or rule, and it can be wrong, so a clean pass rate tells you about the scorer as much as the target. PyRIT's scorer metrics are the mechanism the project provides to check a scorer against known answers before you rely on its output. The page covers the approach described in the PyRIT documentation, not a guaranteed accuracy level for any scorer, judge model or harm category.

Teams need this check at three points. The first is before sign-off, when the verdicts will be cited as evidence. The second is after any change to a scorer, because PyRIT identifies a scorer by a hash of its full configuration, so even a changed setting produces a new identity with its own metrics. The third is when the judge model behind an LLM-based scorer changes, whether through a provider update or a deliberate switch. In each case, the metrics you hold for the old configuration do not automatically apply to the new one.

Ask your team to confirm three things before the review: which scorer identity produced each verdict you plan to report, whether that identity has metrics stored against human-labelled data, and who on your side owns the labelling. A verdict you cannot trace to a measured scorer is hard to defend to an auditor or risk committee. Confirm the exact version of PyRIT you run, since scorer behavior and metric support depend on the release, and check the current PyRIT documentation on scorer metrics against your installed version.

Which metrics apply to objective scorers and harm scorers

Objective scorers return a yes or no verdict, such as whether a target response met the attack objective. PyRIT evaluates them with classification metrics computed against human-labelled ground truth. Those metrics answer a specific question: when the scorer says the objective was met, how often is a person in agreement, and how often does it miss cases a person would flag? To run this evaluation, you need a labelled dataset of responses that reviewers have marked as meeting or not meeting the objective, using the same policy wording the scorer will apply in production.

  • Labelled responses: Collect responses that cover both outcomes, including borderline cases, since easy examples flatter the scorer.
  • Reviewer guidance: Write the labelling rule down so two reviewers can apply it the same way before you compare their labels with the scorer.
  • Precision questions: Precision shows how many positive verdicts were correct, which matters when false alarms trigger costly triage.
  • Recall questions: Recall shows how many real successes the scorer caught, which matters when a missed failure would be released.
  • Matched configuration: Evaluate the exact scorer configuration you plan to use, since the metrics are tied to that configuration.

Before relying on objective verdicts, confirm with your reviewers which error type carries more risk in your own process and set your review obligations around it.

Scorer metric options and when each fits

This table compares the four ways to measure a PyRIT scorer, plus re-measuring after a change, and states what each tells you, what labelled data it needs and its main trade-off. Use it to pick the measurement that matches the kind of scorer you rely on, then confirm the exact metric names and outputs in the Scorer Metrics documentation for your PyRIT version.

MeasurementWhat it tells youLabelled data it needsMain trade-off
Identity hash and stored metricsWhich exact scorer configuration produced a set of metrics, so results are not reused across changed settingsNo labels; the hash comes from the full scorer configurationTracks configuration only; it does not show whether the scorer is accurate
Classification metrics for objective scorersHow often an objective scorer's true or false verdicts agree with human labelsHuman-labelled true and false examples drawn from responses the scorer will judgeNeeds enough balanced examples from your own policy; weak labels produce misleading accuracy
Error metrics and significance testing for harm scoresHow far a numeric harm score sits from human ratings, and whether the gap is statistically meaningfulHuman harm ratings on the same responses the scorer rates, with enough items for the testError alone hides bias; significance results depend on sample size, so small sets prove little
Krippendorff's alpha for inter-rater agreementHow consistently human raters agree with each other, which sets a ceiling on how well any scorer can match themTwo or more raters scoring the same items, ideally with written rating guidanceLow agreement often reflects an unclear rubric, not a weak scorer, so fix the rubric before blaming the scorer
Re-measuring after a configuration changeWhether a new prompt, model, threshold or setting still performs as beforeA refreshed labelled set, ideally including cases the old scorer got wrongEvery change creates a new identity, so each change repeats the labelling and measurement effort

How to run scorer accuracy checks in PyRIT

This sequence takes a PyRIT scorer from installation to a stored, reproducible accuracy record, so you know how far its verdicts can be trusted before you rely on them. Each step ends with a check that confirms the evidence is usable.

  1. Install PyRIT on a supported Python version

    The engineer running the evaluation installs PyRIT from PyPI into an isolated virtual environment. The PyPI package supports Python 3.10 up to but not including 3.15, and the PyRIT documentation recommends Python 3.13, so pin that version in your environment. Confirm the install by importing the package and printing its version, then record that version alongside your results, because a scorer's behavior can change between releases.

  2. Select the scorer and record its identity hash

    Choose the scorer you plan to rely on, such as an LLM judge, Likert scale or Azure AI Content Safety scorer, and write down its full configuration: judge model, system prompt, question wording, thresholds and any composite logic. PyRIT computes an identity hash from that configuration, and metrics are stored and retrieved by that hash. Record the hash in your evaluation log. Check that the hash is identical when you construct the scorer again from the same settings, and that any change to a setting produces a new hash, which means a new evaluation is required.

  3. Assemble a human-labelled dataset for each harm category

    Build a labelled set of responses that covers every harm category in scope for your deployment, with enough examples in each category to support meaningful metrics. Reviewers should label each item against a written rubric, and the rubric should be fixed before anyone sees scorer output. Check the labels by confirming that reviewers were independent of the scorer design, did not see the scorer's verdicts while labelling, and that a second reviewer re-labelled a sample so you can measure agreement. Keep the labelled set and the rubric under version control.

  4. Run the scorer over the labelled dataset

    Score every labelled item with the selected scorer, using the same configuration recorded in the identity-hash step. Store the scorer outputs with the item identifiers so each verdict can be matched back to its human label. Check that the number of scored items equals the number of labelled items, that no item failed silently, and that malformed or missing judge outputs are counted and reported rather than dropped, since dropped items can inflate apparent accuracy.

  5. Compute the metric family that matches the scorer type

    Objective scorers, such as true/false judges and refusal detectors, are evaluated with classification metrics against the human ground truth. Harm scorers, such as Likert scales, are evaluated with error metrics, statistical significance tests and Krippendorff's alpha for agreement. Select the family that matches the scorer's output type, then compute the metrics from the matched pairs. Check that you used the metric family the scorer type requires, that the sample size is stated next to each figure, and that the agreement measure reflects the reviewers' labels, not the scorer's outputs.

  6. Store the results against the identity hash

    Save the computed metrics, the dataset version, the rubric version, the reviewer roster and the PyRIT version under the scorer's identity hash so the record can be retrieved later. Confirm that a later query by the same hash returns the same metrics, and that the record makes clear which configuration produced it. Store the record in the system where your evaluation evidence lives, and review it whenever the scorer configuration, the target model or the policy changes.

How labelled data flows into a scorer accuracy record

The diagram starts with human reviewers labelling a sample of responses, which sit outside the scorer's trust boundary. Those labels and the full scorer configuration go in, the scorer produces verdicts, and the metric step compares verdicts with labels. PyRIT stores the result under the scorer's identity hash, so any configuration change creates a new record that must be measured again before its verdicts are trusted.

Labels and verdicts meet in metric calculation, and results are keyed by configuration hash.

Security and governance risks in scorer evaluation

Measuring a scorer's accuracy means handling labelled harmful content, recording how labels were made, and deciding where judge calls and stored results travel. Each risk below affects whether the accuracy figures can be trusted and defended to an auditor.

Labelled data holds harmful content

Ground truth for objective and harm scorers is a set of prompts and responses that humans labelled, and many of them contain the harmful material the scorer is meant to catch. Restrict who can read the labelled set, store it in the same controlled location as your red teaming data, and log access. Confirm with your security team whether reviewers need a sanctioned review environment and whether any content must be removed or redacted before wider sharing.

Reviewer disagreement needs a process

If two reviewers label the same response differently, the metric you report depends on how that disagreement was settled. Write down who labels, how many reviewers see each item, how conflicts are resolved, and what guidance they follow. Inter-rater agreement measures show whether the labels are consistent enough to score against, so record those results alongside the accuracy figures.

External judge models leave your boundary

When the scorer under test is an LLM judge hosted by an external service, every response it evaluates is sent to that provider. Check the provider's data handling terms, confirm the judge endpoint is approved for the data classification you are testing, and decide whether a self-hosted judge model is required. The same boundary applies to the labelling tool, so list each endpoint that receives response text.

Memory holds results and conversations

PyRIT memory stores conversations, scores and metric results in SQLite or Azure SQL. Those records can contain the full harmful text that the scorer judged, so the database needs the same access controls, encryption and backup rules as other sensitive test data. Decide retention for evaluation runs separately from production red teaming, and confirm who can delete records.

Stale metrics after configuration changes

Metrics are stored against a scorer's identity hash, which changes when any setting changes, including the judge model, the prompt, or the scale. A metric measured on an earlier configuration does not describe the scorer you now run. Before relying on a verdict, confirm the hash in use matches the hash the metrics were measured on, and re-run the evaluation after each change to the scorer.

Scorer Metrics docs

Traceable hashes for auditor reporting

An auditor who asks how a scorer was validated needs a chain from the reported result to the scorer configuration, the labelled dataset and the metric record. Keep the identity hash, the labelling version and the metric output together in the evidence set, and export the configuration used for each run. Ask your compliance lead which records they need and in what format before the first evaluation.

Questions teams ask before measuring PyRIT scorer accuracy

What does it cost to measure a PyRIT scorer's accuracy?

The cost is mostly people's time: the labelling work, the reviewers who apply the labels, and the engineering time to wire the measurement into your environment. Compute and model calls are usually a smaller line item. Cost rises with the number of scorers, the number of harm categories, the number of labelled examples per category, and how many reviewers must label the same items to test agreement. Costs recur when a scorer's configuration changes and you re-measure. Ask any quote to split one-time setup (environment, data format, first labelling round) from recurring work (re-labelling after changes, retesting, reporting), and to state who labels, how many items are assumed, and how disagreements are resolved.

How long does a PyRIT scorer accuracy measurement take?

Duration is set mainly by how long human labelling takes, not by the PyRIT run itself. The main drivers are the volume of labelled responses, the number of reviewers available, how hard the harm categories are to judge consistently, and whether reviewers need a calibration round before labelling begins. Engineering setup depends on whether a Python environment and memory storage already exist. Ask for a schedule that separates setup, labelling, metric runs and review of results, and confirm the reviewer hours the plan assumes. Any duration in a quote should be tied to those inputs rather than presented as a fixed number.

What does our team need to supply before measuring a scorer?

Plan to supply four things before work starts:

  • Labelled ground truth: responses marked by humans for the objective or harm category the scorer is meant to judge, covering both positive and negative cases.
  • Reviewers: people with the policy knowledge to label consistently, with time set aside for calibration and for a second reviewer on a sample.
  • A Python environment: a supported Python version for the PyRIT release you use, with the scorer configuration you intend to validate.
  • Memory storage: SQLite or Azure SQL, where PyRIT keeps conversations and scoring results so that metrics can be retrieved and traced.

Confirm access to the target models and scorer endpoints as well, since the scorer must run in the same configuration you plan to rely on.

Can our team measure PyRIT scorer accuracy in-house?

Yes, if you have people who understand the policy being judged, can label responses consistently, and are comfortable running Python and reading statistical output. The PyRIT documentation describes the scorer metrics approach, including classification metrics for objective scorers and error metrics, significance testing and Krippendorff's alpha for harm scorers, so the method is documented. The harder part is usually discipline: keeping labels consistent, freezing scorer configurations during a measurement, and recording who labelled what. Ask an outside partner only if your team lacks reviewers, method experience or capacity to run a repeatable process.

Does an outside partner add value to scorer measurement?

An outside partner can add value when the work needs independent labelling, a repeatable process your auditors can follow, or an engineer who has set up this measurement before. DeployOpen plans, implements and documents self-hosted open-source platforms in your infrastructure, and runs security testing that includes AI systems and agents, so scorer validation can be scoped as part of a wider red teaming effort. Engagements are usually fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. Ask any partner to state which labels are their own judgment and which come from your policy owners.

Do scorer metrics prove that a PyRIT scorer is correct?

No. Scorer metrics measure how well a scorer agrees with the human labels you supplied, and they are only as good as those labels. A high agreement score shows the scorer matches your reviewers on the sampled data. It does not show the scorer is right about the wider population of responses, or that the labels reflect your policy correctly. Interpret results with the sample size, the spread of harm categories, the reviewer agreement level and any significance testing in view. Report the metrics as evidence of agreement with a defined labelled set, not as proof of correctness.

How do we re-measure a PyRIT scorer after changing it?

Re-measure whenever a setting changes, because PyRIT gives each scorer an identity hash computed from its full configuration, and metrics are stored and retrieved by that hash. Changing the model, prompt, threshold or any other setting creates a new identity, so earlier metrics do not automatically apply to the changed scorer. Keep the previous results for audit, run the labelled set against the new identity, and compare the two. Confirm with your partner or internal owner which changes trigger a full re-measure and which allow a smaller sample check.

Which parts of the measurement should we ask a quote to cover?

Ask for a written scope that names the scorers, harm categories and objectives in view, the number of labelled items assumed, the number and role of reviewers, and how disagreements are resolved. Ask which PyRIT version and Python version will be used, where memory is stored, and what evidence is delivered, such as metric outputs, labelling records and a method note. Ask how re-measurement after configuration changes is priced, and whether retesting is included or billed separately. Confirm what is excluded, including policy writing, model changes and remediation of scorer defects.

Limits to confirm in your environment before relying on metrics

Scorer metrics only tell you how well a scorer matched the labels you gave it, on the data you gave it, under the configuration you measured. The cards below cover the assumptions to confirm before a metric becomes a basis for a pass or fail decision on your AI system.

Labels must reflect your policy

The human labels define what the scorer is measured against. If the labelers followed a generic harm definition instead of your acceptable use policy, a high agreement score only shows the scorer matches that generic view. Ask who wrote the labelling guidelines, whether they match your policy text, and whether labelers were trained on the edge cases your policy actually covers before you cite any accuracy figure.

Sample must cover your categories

A metric is only as wide as the sample behind it. If the labelled responses cover one harm category or one language, the metric says nothing about the others. For illustrative purposes, a scorer tested mainly on English prompts may behave differently on the languages your users write in. Check that each harm category, language and target you test appears in the sample in enough volume to be meaningful.

Confirm metric definitions in your version

Metric names, error calculations and significance tests belong to a specific PyRIT release. Before you cite a definition in a report, read the scorer metrics page for the version you run. The current reference is the 1.1.0 documentation, so confirm each definition you rely on there, and record the version alongside the results so a later reader can reproduce them.

Scorer metrics docs

Any setting change resets identity

Metrics are stored and retrieved by the scorer's identity hash, which is computed from its full configuration. Changing a system prompt, threshold, model or other setting produces a new identity with no metrics attached. Treat each configuration as a separate scorer that needs its own labelled evaluation, and keep a record of the configuration that produced each metric so an old result is never applied to a changed scorer.

Set agreement thresholds yourself

Krippendorff's alpha reports how consistently raters agree, but it does not say what value is good enough. The threshold depends on your risk tolerance, the harm being measured and how much disagreement your reviewers accept on borderline content. Decide the acceptable level in advance with your risk owner, document the reasoning, and do not borrow a threshold from a general guide without checking it fits your use case.

Results are not an audit opinion

Scorer metrics are internal evidence about how a scorer performed in your test. They are not an audit report, attestation or certification, and an independent assessor will decide what weight to give them. Present the metrics with their method, sample, labelers and limits, and ask your compliance or assurance team how they fit into the evidence your assessment requires.

What to do when a scorer's metrics fall short

When a PyRIT scorer's metrics fall short, the team has four options, and the first step is to choose one deliberately rather than drifting into it. The options are to accept the scorer with documented limits, tune its configuration, add a second scorer or human review for borderline cases, or replace the scorer. Acceptance is reasonable when the errors fall in places that do not change decisions, for example when false negatives cluster in responses that are already routed to human review. Acceptance is not reasonable when the scorer misses the harm category that the test exists to find. Write the limits down in the same terms the metrics use, so a reader can see which failure modes remain open.

Tuning is the option most likely to be done casually and the one that most often invalidates earlier evidence. Because every PyRIT scorer has an identity hash computed from its full configuration, changing a prompt, a threshold, a model setting or a scale mapping produces a new identity with no stored metrics. Any verdict drawn from the tuned scorer must therefore be re-measured against the same human-labelled set before it is relied on, and the earlier measurements remain attached to the old identity. Treat each configuration change as a new scorer version with its own measurement record, and confirm with your reviewers that the labelled set was not reused to pick the new settings, since that would overstate accuracy.

Adding a second scorer or a human review step suits cases where the primary scorer is useful but uncertain near its threshold. This is a routing decision, not a fix, and it adds reviewer effort that recurs for every run. Replacing the scorer is the right answer when the metrics show systematic bias, or when the scorer cannot be measured against your own labels at all. Whichever path is chosen, record the decision in a log that holds the scorer identity hash, the metric results it was judged against, the date of the decision, the approver, the chosen option and the conditions that would reopen it. Store the same identifiers with the attack results in memory so an auditor can trace a finding back to the scorer version that produced it.

How DeployOpen works on this

DeployOpen scopes scorer accuracy work for PyRIT as a written, fixed-scope engagement covering the scorers your team relies on. We build the labelled test sets and metric runs, document the results against your policy, and hand over a repeatable process your team can run again after scorer changes.

How we scope

  • Agree in writing which PyRIT scorers and policy harms the accuracy work covers.
  • Confirm the human labelling process, label owners and the ground truth your team accepts.
  • Record which scorer configurations are in scope, since any setting change creates a new identity hash.
  • Set deliverables and timelines in the written scope before any work starts.

How we build

  • Assemble labelled objective and harm datasets that reflect your own policy and risk categories.
  • Run classification metrics for objective scorers and error metrics for harm scorers on your PyRIT installation.
  • Calculate Krippendorff's alpha and significance checks to test agreement between human raters and scorers.
  • Test identity hash behaviour so metrics are retrieved only for the exact configuration being relied on.

How we hand over

  • Deliver a written report of metric results, thresholds chosen and the limits of each scorer's accuracy.
  • Document the labelled datasets, rater instructions and the exact scorer configurations evaluated.
  • Train your team to rerun the metrics after model, prompt or configuration changes, and to read the results.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover rerunning scorer metrics when PyRIT versions or scorer settings change.
  • Ask for a quote built from the written scope, since DeployOpen does not publish a price list.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.