Reviewing PyRIT scenario results and run history

PyRIT keeps scenario runs in memory so teams can compare results across model and prompt versions and trace a scenario down to individual attacks. This page covers how to review that history and what to confirm before relying on it.

On this page

Reviewing PyRIT scenario results and run history: what it answers and when you need it

A team that runs PyRIT assessments more than once needs a way to answer one question: is the new model or prompt version safer than the last run? Scenario history and scenario results are the parts of PyRIT's command-line surface meant to answer that question. The scenario-history view lists past scenario runs, and the scenario-results view drills into what a single run produced. Both are reached through pyrit_shell and the PyRIT CLI, and both read from the same memory that stores every conversation and score PyRIT produces. The documentation describes PyRIT memory as stored in SQLite or Azure SQL, so the run history you review is only as complete as the memory database you pointed the runs at.

The practical need arises when assessments repeat. A single scan tells you what a target did on one day. Comparing runs tells you whether a change to the model, the system prompt, the content filter or the target endpoint moved results in a harmful direction. Before you rely on this, confirm in your installed version which commands exist, what arguments they accept, how runs are identified and whether results can be filtered by target, scenario or date. The exact names and output formats have changed across PyRIT releases, so check the command help in your environment and the PyRIT documentation for the version you run, rather than copying examples from older posts.

Decide early which memory database holds your runs and keep it consistent across the team and the CI pipeline. Runs written to different SQLite files will not appear in one history, and comparisons will silently cover only part of your testing. Also confirm that the run labels and target version tags you intend to compare on were recorded at run time, because history can only separate versions that were tagged when they ran. A short check before the first comparison is worthwhile: run the same scenario twice against an unchanged target and confirm the two runs appear side by side with matching configuration. That baseline tells you how much variation to expect before you read a change into a comparison.

Three ways to review results: shell, CLI and Python

The interactive shell suits a reviewer who is exploring results and wants to move from a summary to the detail without writing code. Start by listing recent scenario runs with scenario-history, then open one run with scenario-results to see its scenario-level outcome. From there, the reviewer can drill into the individual attacks that made up the scenario and read the prompts, responses and scores behind each result.

  • List runs: Use scenario-history to see prior scenario executions stored in memory, so you can pick the runs you want to compare.
  • Open a run: Use scenario-results to view the outcome of a chosen run at the scenario level.
  • Drill into attacks: Move from a scenario result into the attacks that produced it, including the conversations and scores.
  • Compare side by side: Open two runs, typically a baseline and a new model or prompt version, and note where outcomes changed.
  • Keep notes outside the shell: Record run identifiers and observations in your review log, since the shell does not replace a findings document.

Before relying on any command, confirm the exact syntax, arguments and filters in the documentation for the PyRIT version you installed.

How to compare two runs and find a regression

This sequence takes two PyRIT runs, confirms they are comparable, and turns a difference in scenario results into a documented regression or a ruled-out false alarm. The output is a short comparison record that names the baseline and candidate target versions, the changed attacks, and the evidence behind each conclusion.

  1. Choose the baseline and candidate runs

    Pick the earlier run that represents the accepted behavior, often the last run on the approved model or prompt version, and the newer run you want to check. Find both in scenario history using their run identifiers and labels, and write them down with their dates. Confirm that the candidate is the only intended change between them, so any difference you see can be traced to something specific. The step is done when both identifiers and their labels are recorded in the review notes.

  2. Confirm objectives, dataset and scorer match

    Before reading any result, check that both runs used the same objectives, the same dataset or seed prompts, the same scenario definition, and the same scorer configuration. Compare the scenario and scorer settings each run recorded, including the judge model and any threshold settings. If any of these differ, treat the comparison as partial and either rerun the baseline with the candidate's settings or note the difference as a limit on the conclusion. The step closes when you have a written statement that the inputs match or a list of mismatches.

  3. Verify target and version configuration

    Confirm that the target recorded for each run points to the intended model or endpoint and version, and that the prompt or system configuration is what the record says it is. Check the labels for target version and build, since they are the fastest way to see whether the two runs differ in the system under test. Ask the team that owns the target to confirm any version they changed outside PyRIT. Do not attribute a difference to a regression until this check passes, because a changed endpoint, a routing change or a different system prompt can produce the same symptom. The step is done when each run's target version is recorded and confirmed.

  4. Pull scenario-level results for both runs

    Use the scenario results view in pyrit_shell or the CLI to pull the summary for the baseline and the candidate side by side. Record the overall outcome counts and the breakdown by technique or harm category for each run. Note any attacks that errored or returned undetermined scores, since those affect the denominator and should not be counted as passes. The output is a two-column summary that shows where the candidate moved up or down by category. Keep the exact figures from the tool rather than rounding them in your notes.

  5. Drill into attacks that changed outcome

    From the scenario summary, open the individual attacks whose outcome differs between the two runs. Sort them into three groups: newly successful attacks, newly blocked attacks, and attacks that flipped between error and a scored result. Read the conversation and the score rationale for each attack in the group where the candidate looks worse, and check whether the scorer judged the response consistently. Also review a sample of attacks that did not change, so you can see whether the scorer behaves the same way across both runs. The step closes with a list of changed attacks and a note on whether each change reflects the target or the scorer.

  6. Rerun changed attacks to test stability

    Repeat the attacks that flipped, on both the baseline and the candidate, to see whether the change holds or comes from run-to-run variation. Because model outputs and multi-turn strategies can vary between executions, a single flip is not enough to call a regression. Ask the owner of the test plan to confirm how many repeats they accept before a change counts, and record that decision before you rerun. The step is done when each flipped attack has a repeated result and a stable or unstable label.

  7. Record the regression decision and evidence

    Write a short comparison record that names both runs, both target versions, the scorer and dataset used, the changed attacks with their stable labels, and a decision: regression confirmed, no regression, or inconclusive with the missing input named. Link each claim to the run identifiers and conversation records so a reviewer can follow it without running Python. Send the record to the owner of the target and the scorer for sign-off. The step closes when the record is stored with the engagement labels and the sign-off is noted.

What makes run comparisons misleading

Two PyRIT runs can show different attack success rates without the target having changed at all. The cards below cover the differences in scoring, inputs, randomness, errors and target identity that can make a comparison look like a regression or an improvement. Check each one before you draw a conclusion from scenario history.

Different scorers or scorer versions

A scenario result is only as comparable as the scorer that produced it. If one run used an LLM judge with one prompt and the next used a different judge model, a Content Safety scorer, or a changed scorer configuration, the success counts measure different things. Before comparing, confirm that each run recorded the same scorer class, its configuration, and the judge model it called. Treat any mismatch as a reason to rescore both runs with one scorer.

Changed datasets or seed prompts

Scenario history can look like a regression when the objectives changed underneath it. A new seed prompt file, an edited YAML entry, or a dataset refreshed between runs means the attacks differ even when the target is identical. Compare the seed set used by each run and check whether the same objectives were attempted. Count only the objectives present in both runs when you measure change.

LLM judge variance

An LLM-based scorer can give different verdicts on the same response across runs because of sampling, judge model updates, or prompt wording. A small movement in attack success rate may be scorer noise rather than a change in the target. Rescore a sample of responses with the same judge to estimate how much verdicts move, and look for a difference that is larger than that movement before you report a regression.

Undetermined and errored attacks

An attack that returned no score, or failed with an error, is not the same as a refusal. If undetermined and errored attacks are dropped from the denominator in one run but counted in another, the rates are not comparable. Check how each run reports undetermined and errored attacks, then state the denominator explicitly in every comparison. Read the individual errors before you assume the target held.

Concurrency and retry effects

The set of attacks that completed can vary with concurrency limits, rate limiting, and retry behavior. A run with more retries or a different concurrency setting may have reached different objectives, or reached the same objectives in a different order that changed a multi-turn outcome. Record the concurrency and retry settings with each run, and confirm that both runs attempted the same attack list before you compare results.

Runs against unversioned targets

A run labeled only with a model name can point at a deployment that was updated, a system prompt that was edited, or a route that now serves a different model. Without a recorded target version, history cannot show whether a change came from the model, the prompt, or the endpoint. Confirm that each run records the target identifier and version, such as a deployment name, a prompt hash, or a build label, before you attribute a difference to a model or prompt change.

How a reviewer moves from scenario to attack to conversation

The reviewer starts at scenario history, which lists past runs, and opens one run to see its scenario results. From a result, they drill into an individual attack to read its conversation and scores, then open a baseline run to compare outcomes between model or prompt versions. Every view reads from the same memory store (SQLite or Azure SQL), so a finding seen in one view can be traced to the same records in another. Check that the baseline was run against the same scenario and objectives before reading any difference as a regression.

Every review view reads from the same memory store underneath.

Review options and when each fits

This table compares three ways to review PyRIT scenario results and run history: pyrit_shell, the command-line interface and the Python memory API. Read each column for who it suits, what it is best for, what must be installed and which limits to confirm in your own environment before relying on it. The main takeaway is that interactive review and scripted evidence work usually call for different options.

OptionBest suited toBest useNeeds installedLimits to confirm
pyrit_shellOperators reviewing runs interactivelyBrowsing scenario history, listing scenario results and drilling from a scenario into individual attacksPyRIT from PyPI with a supported Python version and a configured memory databaseWhich filters and comparisons the shell supports in your PyRIT version
CLI commandsEngineers scripting checks or reviewing in CIRepeatable retrieval of scenario history and results for comparison between model or prompt versionsPyRIT from PyPI with the same memory database the runs wrote toOutput formats and whether results can be saved to files for review
Python memory APIEngineers building custom findings lists or evidence packsQuerying conversations, scores and attack results directly for reports outside PyRITPyRIT from PyPI, Python 3.10 or later, and familiarity with the async memory interfaceRequired query methods, schema stability and how memory is shared across team members
Shared memory locationTeams reviewing the same runsMaking one database visible to every reviewer so comparisons cover the same recordsA SQLite file or Azure SQL database that all reviewers can reachAccess control, concurrency limits and backup arrangements for the chosen database
Labels and operation namesAnyone comparing runs across engagementsFiltering history to one engagement, target version or build before comparing resultsRuns tagged with labels at the time they were executedWhether labels are applied consistently by every operator

Setting up PyRIT so scenario history is usable

This sequence takes a clean environment to a state where one scenario run leaves history and results that you can read back, which is the baseline every later comparison depends on. It covers installation, credentials and settings, the memory backend, and a verification run.

  1. Confirm a supported Python version

    Check that the Python interpreter on the review workstation or build host falls within the range the PyPI package supports, which is 3.10 up to but not including 3.15. The PyRIT documentation recommends Python 3.13, so use that version if your platform team already provides it. Ask your platform team to confirm which interpreter they approve for tooling. You are done when python --version reports a supported release inside a virtual environment you created for PyRIT.

  2. Install PyRIT from PyPI

    Inside the virtual environment, install the pyrit package from PyPI with pip, then confirm the package imports and the pyrit_shell and pyrit_scan commands are on the path. Pin the version you intend to use for review so later runs are comparable, and record that version in your run notes. If your environment restricts outbound package downloads, have your package mirror administrator confirm access before you start. You are done when the install completes without errors and both commands print their help text.

  3. Create the credentials file in pyrit home

    Create ~/.pyrit/.env for the credentials your target and scorer need, such as API keys for the model endpoints you plan to test. Keep this file readable only by the operator account, and do not commit it to source control. Store only the secrets required for the first scenario, and confirm with your security team where production secrets should come from if they are managed in a vault. You are done when PyRIT loads the file without warnings about missing keys for the target you chose.

  4. Set run settings in pyrit conf

    Create ~/.pyrit/.pyrit_conf to hold the non-secret settings for the environment, including the default target, the scorer and the memory settings the team has agreed. Keep the configuration in a form you can copy to other review workstations so that every operator produces history under the same settings. Review the file with the person who owns the test plan before the first run. You are done when pyrit_shell starts and reports the settings you wrote, not library defaults.

  5. Confirm the memory backend

    PyRIT stores conversations and results in memory backed by SQLite or Azure SQL. Confirm which backend your configuration selects, and check that the database file or connection is in a location your team controls and backs up. For SQLite, note the path so reviewers know where history lives. For Azure SQL, confirm the connection with the database owner. You are done when a short query through the memory interface returns an empty but valid result set from the backend you intended.

  6. Run one scenario end to end

    From pyrit_shell, run one packaged scenario against the target you configured, using a small and agreed set of objectives so the run finishes quickly and the output is easy to inspect. Record the run in your notes with the scenario name, target, and PyRIT version. Let the run complete or fail visibly rather than interrupting it, because partial runs are part of the history you will later review. You are done when the shell returns a completed status for the scenario, even if some attacks scored as unsuccessful.

  7. Verify history and results appear

    List the scenario history from pyrit_shell or the CLI and confirm that the run you just made appears with its identifier, timestamps and status. Then open the scenario results for that run and drill into one individual attack to confirm its conversation and score are present. If the run is missing or the attacks show no scores, check the memory backend path and the scorer configuration before running anything else. You are done when you can name the run, open one attack from it, and read its score in the output.

Security and operational considerations for stored run history

Every scenario run writes prompts, model responses and scores into PyRIT memory, and that record is useful only while it stays controlled. The cards below cover what the stored history contains, who can reach it, how exports should be handled, and who owns retention, with the private route for reporting vulnerabilities in PyRIT itself.

Harmful output in retained conversations

Stored conversations hold the model responses that red teaming was designed to provoke, including harmful content, and scores keep a record of which attacks succeeded. Treat the memory store as sensitive material from the first run, not as a debugging log. Before a run starts, confirm which harm categories the scenario covers and whether reviewers are prepared to read that content. Do not copy raw transcripts into tickets or chat channels when a score summary answers the question.

Memory backends
SQLite or Azure SQL
PyRIT documentation

Database access equals findings access

Anyone who can open the SQLite file or query the Azure SQL database can read every prompt, response and score in the run history, which in practice is the full findings set. Restrict file permissions on the memory location, keep it off shared drives and out of repositories, and grant database roles per engagement. Confirm with your platform team where backups of that database are written and who can restore them, because backups carry the same content.

Credentials kept out of reports

Settings and API keys usually live in ~/.pyrit/.env and ~/.pyrit/.pyrit_conf, and target configuration can reference them. Exported reports, screenshots and shared notebooks must not include those values, endpoint tokens or connection strings. Review a sample export before distribution and rotate any key that appeared in a log, traceback or pasted command. Keep the report generator's inputs limited to scores, labels and conversation text.

Named owner for retention and deletion

Run history accumulates across engagements, model versions and operators, and nothing in the workflow deletes it automatically unless your team builds that step. Assign one owner who sets how long each engagement's memory is kept, who approves deletion, and how deletion is confirmed, including from backups. Record that decision in the engagement's labels so later reviewers can see which runs are still held. Ask your legal and compliance contacts whether the retention period must match any contractual or regulatory requirement.

Reporting PyRIT vulnerabilities privately

If review of run history suggests a defect in PyRIT itself, such as a data exposure or a flaw in how it handles credentials, report it privately rather than in a public issue. The project directs security reports through the Microsoft Security Response Center under its security policy, which is described in the project README. Check the policy for the current reporting channel before you send anything, and keep sample data in the report to the minimum needed to reproduce the problem.

PyRIT on GitHub

Questions teams ask before reviewing PyRIT run history

How much effort does a first PyRIT run comparison take?

The effort depends mostly on how many scenarios and targets are involved, how the scorers are configured, and how clean the existing run records are. A first comparison is usually slower than later ones because the team has to agree on what counts as the same scenario, the same objective set and the same scorer across two runs. Before starting, check three things: how many scenarios each run executed, whether every target version is recorded, and whether the scorer configuration changed between runs. Each difference adds review time, and a change in scorer is the one most likely to make two runs look different when the target did not change. Ask for a written estimate that lists these inputs rather than a single number.

Can our team review PyRIT scenario results without a partner?

Yes, a team with Python experience and access to its PyRIT memory can review scenario results and run history itself. The pyrit_shell and CLI commands for scenario history and scenario results let an engineer list runs, open a scenario, and drill into individual attacks. What usually takes outside help is not the commands but the judgment: deciding whether a score change is a regression or scorer noise, and presenting the result to a risk committee in a form it will accept. Teams that want a repeatable process often start in-house and bring in a partner to review the method before it goes into a control or audit file.

What do you need from us to compare runs?

A comparison needs three things: access to the target that was tested, access to the PyRIT memory store that holds the results, and a baseline run to compare against. The target access is needed to confirm which model or prompt version was live during each run. The memory store, which PyRIT keeps in SQLite or Azure SQL, is where the conversations, scores and scenario records live. The baseline run should be a run you already trust, ideally one executed with the same scenarios and scorers as the run under review. Also provide the ~/.pyrit/.pyrit_conf settings used for each run, so the reviewer can confirm that configuration did not change between them.

How long do setup and review take in our environment?

The timeline depends on where PyRIT runs and where its memory lives. A single developer workstation with a local SQLite memory file is the quickest setup. A shared Azure SQL memory store, Key Vault secrets and team access controls add access requests and configuration checks before the first comparison can start. Review time grows with the number of scenarios, targets and runs in the baseline. Ask for a timeline that separates environment setup, data export and verification, and the comparison and write-up, so you can see which part is waiting on your approvals.

What does a regression review produce?

A regression review produces a written comparison between a baseline run and a newer run, covering the scenarios, targets and attack techniques that changed. A useful output lists each scenario with its baseline and current results, links the individual attacks that drove the change, and records the scorer and target versions used in both runs. It should also state what was not compared, such as scenarios missing from one run or scores marked undetermined. The reviewer should flag changes that could be scorer or data differences, so the team does not treat a change in measurement as a change in model behavior.

When is outside help worth it for PyRIT run history?

Outside help is worth considering when the results will support a decision that is hard to reverse, such as a release gate, a customer security review, or evidence for an assessment. It is also worth it when the run history spans many targets, scorers or people, and the labeling is inconsistent. DeployOpen can review the run history, set up a repeatable comparison method, and prepare the evidence in a form your compliance team can check. DeployOpen does not issue audit reports or certifications, so the final assessment still comes from an independent auditor or certification body. Work is scoped in writing before it starts.

Which scorer and target changes most often cause false regressions?

Two changes most often produce a regression that is not a real change in model behavior: a scorer update and a target version change recorded incorrectly. A scorer that was switched between runs can score the same response differently, so the scores move without any change in the model. Similarly, if the target version label was not set, a reviewer may attribute a change to the wrong model or prompt. Before accepting a regression, rerun a sample of the flagged attacks with the baseline scorer, and confirm from the run records which target version produced each result. Record the outcome of that check in the review.

How DeployOpen works on this

DeployOpen plans and runs PyRIT results review as a fixed-scope engagement, starting from the scenario runs, labels and memory your team already has. The work covers how scenario results and run history are compared across model and prompt versions, and it ends with a documented review method your own team can repeat.

How we scope

  • Inventory the PyRIT runs, memory databases and scenario outputs your team keeps today, including which SQLite or Azure SQL memory stores hold them.
  • Agree in writing which target versions, prompt versions and time windows the run history comparison will cover.
  • Define the regression questions the review must answer, such as which harm categories moved between two model releases.

How we build

  • Set up pyrit_shell and CLI queries for scenario-history and scenario-results against your memory store, tested on a sample of real runs.
  • Build a comparison procedure that drills from scenario totals into individual attacks and their scored responses.
  • Test the procedure with your team, checking that the same inputs produce the same comparison output on repeat runs.

How we hand over

  • Deliver a written runbook covering the commands, filters, comparison steps and the labels each review depends on.
  • Document how regressions were identified, including scoring caveats and any runs excluded from the comparison.
  • Train the engineers who will run reviews so they can repeat the method on new runs without DeployOpen involved.

How we support

  • Engagements are fixed-scope, and the written scope sets the deliverables, timelines and handover points before work starts.
  • Ongoing support, upgrades when PyRIT releases change memory or CLI behavior, and continuous testing are available as a retainer.
  • Ask your DeployOpen contact to confirm which PyRIT version and memory backend the quote assumes before any work begins.

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.