Why a garak scan rerun can show a false change
A team reran garak after a model update and could not tell whether the score movement came from the change or from run-to-run variation. That question is the reason to control the run before comparing anything. garak is a free, Apache 2.0 licensed command-line tool, and by default it makes 5 generations per prompt and marks a probe as FAIL when any single attempt produces undesirable output. Because a model's outputs vary between attempts, a probe's failure rate can move on a rerun even when nothing about the target has changed. Comparability therefore depends on what you hold constant between runs, and the failure rate only means something when the inputs around it are fixed.
Three levers decide whether a rerun is a fair comparison. The first is run.system_prompt, which should match the system prompt your production deployment actually sends, because a different or missing system prompt changes the model's behavior on the same probe. The second is run.seed, which fixes the seed so that the scan is as repeatable as the target allows. The third is recording versions: the garak release, the probe and detector set, the generator configuration and the model identifier or endpoint revision. Confirm in the garak user guide at docs.garak.ai how each setting is exposed in your installed release, since option names and defaults can change between versions.
Before you attribute a score change to a model or prompt update, run the baseline and the candidate with identical settings and rerun the baseline once more to measure its own spread. If the difference between two baseline runs is as large as the difference you are investigating, the change is not yet shown. Store the run configuration and version record next to each JSONL report so that any reviewer can reproduce both runs. Ask your model provider whether the hosted model identifier is pinned, because a silent backend update can produce a change that has nothing to do with your prompt or your release.
Which reproducibility settings fit which scan goal
This table compares three system prompt choices and two seed choices, plus the version fields to record, against the scan goal each one serves. Read each row for what it makes comparable and what it leaves uncontrolled, because provider-side nondeterminism remains even with a fixed seed. Confirm the default values for run.system_prompt and run.seed in the garak user guide before you rely on them.
| Setting | Fits when | What it makes comparable | What it does not control |
|---|---|---|---|
| run.system_prompt set to production text | You are judging how the deployed application behaves under attack | Results against the same instructions your users actually face | Changes to the production prompt itself, which must be versioned separately |
| Generic baseline system prompt | You need a neutral reference across several models or vendors | Models against one shared instruction set that is not tuned to any product | Whether the result predicts behavior under your real prompt |
| No system prompt | You are testing a bare model's default behavior | Raw model behavior with no operator instructions in play | Any application-level guardrail, since none is present in the test |
| run.seed fixed | You are rerunning a scan after a prompt, config or version change | Probe ordering and any seeded randomness between runs on the same setup | Sampling inside the model or provider, so repeated outputs can still differ |
| run.seed left unset | You want variation across runs to surface weak spots | Exploration of different random paths, useful for discovery scans | Exact reruns, so a score change may be noise rather than a real difference |
| Version fields recorded (garak release, generator and model identifier, probe set, prompt text hash) | Every scan that will be compared later or used as evidence | Attribution of any score change to a specific component | Hosted model updates that change the model behind the same identifier without notice |
Setting a reproducible garak baseline
This sequence produces a baseline garak run whose settings are pinned, recorded and repeatable, so later runs after a model or prompt change can be compared against it. It covers the version, the system prompt, the seed and the evidence that each was applied.
Pin the garak version and Python runtime
The engineer creates a dedicated virtual environment on Python 3.11 or newer and installs garak from PyPI at an exact version, such as
pip install garak==<version>, using the release you intend to keep for the baseline. Record the Python interpreter version, the garak version and the operating system in the team's scan notes. The step is done whenpip show garakreports the pinned version and the notes match the environment. Confirm the current release and its changelog on the garak releases page before pinning, because scores can shift between releases.Store the production system prompt in version control
The application owner exports the exact system prompt that runs in production, including any template variables, and the team commits it as a plain text file in the same repository as the garak configuration. Avoid editing it by hand in the scan config, because a copy that drifts from production makes the baseline meaningless. The step is done when the file's commit hash is written into the baseline record and a diff against the live prompt shows no differences. If the production prompt is assembled at runtime from several parts, commit each part and the assembly logic.
Set run.system_prompt and run.seed in the config
The engineer creates a YAML run configuration that sets
run.system_promptto the committed file contents and fixesrun.seedto a stated integer, so the same value is used on every rerun. The config also names the generator, the probes and the generations setting, so nothing depends on command-line defaults. Store the config under version control next to the prompt file. The step is done when a dry validation of the config loads without errors and the seed value is written in the team's baseline record. Confirm the exact key names against the garak user guide for the pinned version.Run the baseline scan with the pinned config
The engineer runs garak once against the target model or endpoint using the committed config, and keeps the resulting JSONL report and garak.log together in a dated results folder. Each garak run writes a JSONL report of every attempt and its evaluation, and garak.log continues across runs, so the folder should hold only this baseline's output. The step is done when the run completes and the report file exists. Keep the model identifier, endpoint address and prompt commit hash in the same folder so the run can be reproduced later.
Verify the settings in the report and log
The reviewer opens the JSONL report and garak.log and confirms that the recorded garak version, seed and system prompt match the values in the config and the baseline record. The reviewer also checks that the generator points to the intended target and that the probe list matches the config. The step is done when each setting is found in the artifacts and any mismatch is resolved before the baseline is accepted. If a setting is absent from the output, confirm in the user guide whether it is written to the report for the pinned version, and record the gap rather than assuming it was applied.
Repeat the run with identical inputs
The engineer reruns the same config against the same target without any change, storing the second run in its own folder. Compare the per-probe results between the two runs, focusing on whether any probe changes status and how much the failure rates move. The variation between identical runs is the noise floor, and it shows how much a later difference must exceed before it counts as a real change. The step is done when the noise floor is written down per probe that matters to the application. Keep the comparison method fixed so later reruns use the same approach.
Record the baseline and its noise floor
The team writes a short baseline record that lists the garak version, Python version, prompt commit hash, seed, config commit hash, target identifier and the observed variation from the repeat run. The record is stored with the results folders and linked from the team's scan runbook. The step is done when another engineer can rebuild the environment from the record and reproduce the baseline settings. Future runs after a model or prompt change are then judged against this record rather than against memory of an earlier scan.
Trade-offs when you fix the seed and prompt
Fixing the seed and system prompt makes garak runs comparable, but each choice carries a cost. The cards below pair each risk with a mitigation you can apply when you set up the baseline and decide how to refresh it.
Fixed seed hides real variance
A fixed seed removes run-to-run noise, so two scans of the same model agree more closely. That agreement can hide how much a model's output actually varies across attempts, which is the behavior a single fixed run never shows. Keep the seed fixed for comparisons, but also run a small set of unseeded scans or several seeds to see whether a difference between versions is larger than the spread you already get from the same model.
Production prompt leaks into reports
Setting run.system_prompt to your production prompt makes the scan realistic, but the prompt text can appear in the JSONL report and the garak.log file. Those files may be shared with vendors, auditors or ticketing tools. Check what the report contains before sharing it, and store the production prompt in a restricted location rather than pasting it into a shared config file.
Copied prompt drifts from production
A prompt copied into a scan config once is a snapshot. Production prompts change for new features, tone updates or tool additions, and the scan keeps testing the old text. Each rerun then measures a system that no longer exists. Tie the scan config to the prompt's version in your release process, and compare the prompt hash or version with production before each scheduled run.
Baseline goes stale after model updates
A baseline captured against one model version stops being a fair reference once the provider or the local weights change. A later drop in pass rate may reflect the new model, not your prompt change, and a stable score may hide a regression. Record the model identifier and version next to every baseline, and capture a new baseline when the model changes before you attribute any difference to a prompt edit.
Hosted endpoints may ignore the seed
Some hosted model APIs do not honor a seed parameter, or honor it only on a best-effort basis, and providers can change serving infrastructure without notice. Setting run.seed then gives a false sense of determinism. Confirm with the provider whether a seed is supported for your model and whether it is guaranteed, and where it is not, rely on more generations and repeated runs instead.
How a comparable rerun is produced
The run starts with the production system prompt and garak config, both pinned in version control. The scan records the garak version and seed, then writes a JSONL report and a garak.log. That report is compared against a prior baseline run, and the team decides whether the difference comes from the model or the prompt change, or from run setup. Check the pinned inputs first, because a difference in setup can look like a model change.
Pinned inputs, recorded run metadata and baseline comparison feed one attribution decision.
Protecting production prompts and scan artifacts
A garak run touches three kinds of sensitive material: the system prompt that reflects how your application behaves, the reports and log files that record every attempt, and the credentials that let the scan reach the endpoint. Each needs its own handling, because a prompt copied into a shared report or a key left in a config can expose more than the scan was meant to reveal.
Treat system prompts as internal
A production system prompt often holds business rules, internal tool names, escalation paths and policy wording that an attacker would find useful. When you set run.system_prompt to match production, the same text is written into the run's outputs. Confirm who can read the prompt source, and keep the copy used for scanning under the same access rules as the production configuration.
Restrict access to reports and logs
Each run writes a JSONL report of every attempt and its evaluation, and garak.log is continued across runs, so both accumulate sensitive model output over time. Store them in a location with named readers, not a general team share. Check that the report captures the system prompt and generated text the way you expect before anyone outside the security team receives it.
garak READMEKeep API keys out of configs
Generator configs often need an API key for a hosted model or a REST endpoint. Pass credentials through environment variables or your secrets manager rather than writing them into YAML files that get committed to version control. Confirm the exact environment variable names for your generator in the garak user guide, and check that the run's config record does not echo the key back.
garak user guideSeparate endpoint details from shared files
The endpoint URL, account identifiers and network addresses of a scan target reveal how your infrastructure is laid out. Keep them in a local, untracked config or in environment variables, and share a template with placeholders in the repository. Before you attach a run config to a ticket or a pull request, remove hostnames and internal paths from it.
Set a retention period for artifacts
Reports and logs stay useful for comparing runs, but they also keep copies of prompts and sensitive model replies long after the decision they supported. Agree a retention period with your security and compliance owners before the first scheduled run, then delete or archive older artifacts on that schedule. Ask whether your records policy requires keeping scan evidence, and for how long.
Review the scan account's permissions
The credential used for a scan should be able to call the model and nothing else. Use a dedicated account or key with the smallest scope that works, rotate it on your normal schedule, and revoke it when the scan program changes owners. Log which identity ran each scan so that a rerun can be traced to the credential and the prompt version it used.
Questions teams ask before setting up reproducible garak scans
Can our team set up reproducible garak scans without a partner?
Yes, a team with Python experience and access to the target model or endpoint can do this alone. garak is a command-line tool installed from PyPI, and the PyPI package requires Python 3.11 or newer. The work that needs judgment is not the installation but the decisions behind it: which system prompt matches production, which seed to fix, how to pin the garak version, and where run configs live. Teams usually need one person who owns the baseline, someone who can reach the endpoint from the scan host, and a review step before the baseline is treated as the reference for later comparisons.
How long does a baseline garak setup take?
The time depends mostly on how much of the production setup is already documented and how many application layers sit between garak and the model. A bare model with a known prompt is the shortest path. A RAG pipeline, a tool-using agent or a guarded endpoint adds time because the team must confirm what the application actually sends to the model, including retrieved context and hidden instructions. Access approvals, sandbox availability and agreeing on the version policy also affect the calendar more than the scan itself. Ask any provider for a written scope that lists these items so the duration can be checked against them.
What does a partner need from our team to start?
A partner needs three things to build a reproducible baseline. First, the production system prompt as it is deployed, including any templates, variables or safety text added at runtime, so that run.system_prompt reflects what users actually face. Second, endpoint access in a non-production environment that matches production, with credentials handled under your own controls. Third, a version policy that states which garak release, which probe set and which model version are approved for comparisons, and who approves changes. Teams that cannot provide the prompt often find that the scan measures a different application than the one they intend to protect.
What drives the cost of setting up reproducible scans?
Cost follows the amount of work that falls outside the scan itself. The main drivers are the number of endpoints and models in scope, how many application shapes need separate baselines, the state of the existing prompt documentation, and the amount of environment work such as network paths, secrets handling and hosts that must stay isolated. Recurring costs appear when the baseline must be rerun after each model or prompt change, and when the team needs a retest after fixes. Ask for a written quote that separates one-time setup from any retainer for ongoing reruns, and that names who pays for model inference during scans.
Why does fixing the seed matter if garak output is probabilistic?
A fixed seed makes the sequence of choices garak controls repeatable, so the same probes and prompt order run in the same way across reruns. It does not make the model deterministic. Model sampling, hosted-provider changes and rate-limit behavior can still shift outputs, which is why garak makes several generations per prompt by default and reports a failure rate rather than a single hit. Record the seed, the garak version, the probe selection and the model identifier together so a difference can be traced to a cause. Confirm the seed behavior for each generator in the garak user guide before relying on it.
How should we read a rerun after a model change?
Read the rerun as a comparison only when the system prompt, seed, probe selection, garak version and generator settings are unchanged except for the one thing being tested. If the model changed and nothing else did, a difference in failure rate points toward the model, but the size of the change still needs context. garak generates several attempts per prompt, so a single noisy probe should not drive a decision. Check the JSONL report for which probes moved, confirm that the detectors did not change, and rerun with the same seed before concluding. Record the result as evidence of the model change, not as a permanent score.
What records must we keep so a scan can be rerun exactly?
Keep a record that lets someone other than the original operator reproduce the run:
- The exact garak version, installed from PyPI with its Python version noted
- The config file, including
run.system_promptandrun.seed, kept in version control - The probe and detector selection, and the generator settings with model identifiers
- The JSONL report and
garak.logfrom each run, stored with the run date and configuration hash
Also record the date the endpoint was accessed, because hosted models can change without notice. Whether these records satisfy an auditor depends on the framework and the auditor, so confirm evidence requirements before the first scan is treated as compliance material.
Does a reproducible baseline cover our whole AI application?
A baseline covers the configuration you choose to fix and test, not the whole application. A system prompt and seed make scans comparable for the probes and endpoint in scope, but they do not test retrieval sources, tool permissions, user interface behavior or data flows unless those are part of the target. Define the scope in writing: which endpoint, which application shape and which probe families. Anything outside that boundary needs its own scan or a separate security review.
What to ask for in a scoped reproducibility engagement
A scoped reproducibility engagement should produce a written document before any scan runs. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and does not publish a price list, so the quote follows from that scope. Ask for four named deliverables: a pinned configuration (the run.system_prompt text, the run.seed value, the generator settings, the probe list and the garak version), a baseline run against your current model and prompt, a version record template, and a written rerun procedure. Ask the provider to confirm which of these are one-time work and which recur with each model or prompt change.
The pinned configuration should live in your version control system, with the production system prompt copied from the system that serves it, not from a document that may have drifted. The baseline run is the reference point every later comparison depends on, so the scope should state how many runs establish it and what happens if the baseline itself varies between repeats. The version record template should capture the garak release, the Python version (the PyPI package requires Python 3.11 or newer), the generator and model identifier, the prompt hash, the seed and the report files. Confirm the template names who fills each field and where the record is stored.
Name the exclusions explicitly. Typical exclusions to confirm in writing include: changes to your production prompt or model, tuning or interpreting the detectors beyond the agreed configuration, remediation of findings, and scans of applications other than the one named in scope. Also confirm who owns the test endpoint credentials, where the scans execute, and whether rerun support after handover is a separate retainer. Ask for the rerun procedure to be tested once by the provider's team and once by your own engineer, so the procedure is proven to work without the people who wrote it.
How DeployOpen works on this
DeployOpen treats a garak baseline as a controlled configuration: the system prompt, seed, garak version and run settings are fixed in writing, built into repeatable runs, and handed over with the records needed to compare results after a model or prompt change. Engagements are fixed-scope, so the boundaries of the work are agreed before it starts.
How we scope
- Agree which production system prompt, model endpoint and garak version the baseline must reproduce.
- Define which probes, detectors and generations the written scope covers for the baseline and each rerun.
- List the version records to capture, including garak, Python, generator settings and the seed value used.
- Confirm with your team who owns the production prompt and how changes to it reach the scan configuration.
How we build
- Pin the system prompt and seed in version-controlled run configuration files so every scan starts from identical inputs.
- Verify that the same seed and prompt produce the same probe ordering on the target before the baseline is accepted.
- Test a deliberate prompt change and a model change to confirm the report shows the difference you expect.
- Record the garak release, generator options and report paths alongside each baseline run.
How we hand over
- Deliver the run configurations, a rerun procedure and the version manifest for each baseline scan.
- Document which differences between runs reflect a real change and which reflect generator randomness or setup drift.
- Walk your engineers through how to rerun the baseline, store the JSONL reports and compare results over time.
- Provide written notes on known limits, such as provider-side model updates that a seed cannot control.
How we support
- Review the baseline again when garak, the target model or the production prompt changes, under a separate written scope.
- Available as a retainer for teams that rerun scans on a schedule and need the configuration kept current.
- Confirm with DeployOpen the support terms, response expectations and upgrade handling before signing the scope.

