Detecting model drift with promptfoo red teams starts with a fixed baseline
Your LLM application may now run on a different provider model, a reworded system prompt or a changed guardrail, and nobody has repeated the security tests since the change. Repeated, identical red team runs close that gap by comparing attack success rate over time, so a weakened defense shows up as a rising number instead of a surprise in production. promptfoo's model drift guidance describes this pattern: run the same consistent adversarial tests after each change and compare results against the earlier run. It names three triggers: provider model updates, fine-tuning, and prompt or guardrail changes. Teams that ship on a hosted model they do not control, or that edit prompts often, need this loop most. The guidance is described in the promptfoo model drift documentation.
The first decision is the baseline. Before you compare anything, record the target configuration, the purpose, the plugin and strategy selection, the number of tests per plugin, and the grading setup that produced the reference run. Keep the generated test cases fixed, so a later run differs only where the application changed. If you regenerate probes each time, a rise or fall in attack success rate may reflect different attacks, not a different model or prompt. Write down which values the baseline depends on, such as the grader model and the target endpoint, because a changed grader can move the numbers without any change to the application.
A drift check does not prove the application is secure, and it does not prove that a change caused a regression. It shows that the measured results moved under the same test conditions. Attack success rate is also only as broad as the probes you chose, so a flat trend can hide a weakness outside the selected plugins. Grading errors can shift the numbers as well, which is why borderline results should be reviewed by a person before a trend is reported. Confirm with your own tests how much run-to-run variation your target produces, since model outputs are not always identical between runs.
How to set up a repeatable promptfoo drift baseline
This sequence fixes the variables that a drift comparison depends on, so that a later attack success rate change can be traced to the model, prompt or guardrail that changed rather than to the test setup. It ends with a stored baseline that every later run is compared against.
Record the promptfoo and Node.js versions
The platform engineer or security engineer who owns the scan records the promptfoo version in use and checks it against the Node.js requirement. The published npm release 0.124.1 requires Node.js 22.22.0 or newer, so confirm both before the first run. Pin the version in your lockfile or CI image and write it into the baseline record. The step is done when the same version and runtime can be reproduced from that record.
Define the target endpoint and purpose
The security lead and the application owner agree which exact endpoint is under test, such as a named API route, a deployment identifier or a gateway alias, and write down the purpose statement that describes its users, data and tools. Record the model identifier, system prompt version and guardrail configuration active at that endpoint. The step is done when a second person can point to the same endpoint and read the same purpose text without asking questions.
Freeze the plugin and strategy configuration
Lock the plugin list, per-plugin test counts, severity settings and attack strategies in the promptfoo configuration file, and commit that file to version control with a fixed identifier. Do not add or remove plugins between runs, because a changed plugin set changes the denominator of the attack success rate. The step is done when the configuration file hash is recorded alongside the baseline.
Generate and freeze the test set
Generate the adversarial test cases once, then save the generated set as a fixed artifact rather than regenerating it at each run. Regeneration produces different probes, so any difference between runs would reflect new test content rather than a change in the target. Store the file with its checksum and generation date. The step is done when later runs can load this exact file and the count of cases matches the baseline record.
Confirm grading settings before the baseline run
Record the grader model, grader guidance and any grading examples used to judge responses, plus the provider used for generation if it differs from grading. Grading changes can shift results without any change to the target, so a reviewer should confirm these settings match the configuration committed in the previous step. The step is done when the grading block is part of the stored configuration and the reviewer has signed off on it.
Run the baseline and store results with identifiers
Run the frozen suite against the target and save the full output, including the attack success rate, per-plugin results and raw responses for failed cases. Tag each stored result with the promptfoo version, configuration hash, test set checksum, target identifier and run date. The step is done when the baseline record can be retrieved and the tags match the values recorded in the earlier steps.
Re-run after each model, prompt or guardrail change
After a provider model update, fine-tune, system prompt edit or guardrail change, run the same frozen suite against the same endpoint. Before comparing results, check that the target endpoint is unchanged in the sense that it still resolves to the intended deployment, and that the grading settings and promptfoo version match the baseline. If any check fails, record the mismatch and treat the comparison as invalid until it is resolved. The step is done when each run has a matching tag set or a documented reason it does not.
Compare attack success rate across stored runs
Compare the attack success rate and per-plugin results against the baseline and against the prior run, and investigate any plugin where the rate moved. Keep the comparison and the investigation notes with the stored runs so that auditors can see what changed and why. The step is done when every change is either explained by a known modification or logged as an open security regression for remediation.
Which configuration choices keep runs comparable
This table compares the configuration choices that decide whether two red team runs can be read against each other. Each row names when an option fits and what it costs in comparability or day-to-day operations. The main takeaway is that a drift trend is only as reliable as the weakest fixed input, so freeze the test set and tool version before you compare anything.
| Choice | Fits when | Cost to comparability | Operational trade-off |
|---|---|---|---|
| Freeze generated test cases | You need a trend line across model, prompt or guardrail changes | Low risk of drift from the attack set itself | Someone must review and version the saved set when the purpose changes |
| Regenerate test cases each run | You want broader coverage of new attack variants | Scores move because the attacks changed, not the target | Each run costs fresh generation and needs a separate baseline |
| Pin the promptfoo version | You compare results over weeks or months | Grading and strategy changes in new releases stay out of the trend | Upgrades become deliberate, tested steps rather than automatic |
| Use the latest CLI release | You need newer plugins or strategies right away | Changes in plugins or grading can look like target regressions | Re-baseline after each upgrade and record the version used |
| Run the CLI locally | A single engineer or pipeline runs scans on one machine | Consistent if the same config and version are reused | Results stay in local files that must be archived by you |
| Use a self-hosted promptfoo server | A team shares results and needs a central history | Shared history supports trend review across runs | Self-hosted app uses SQLite and has no RBAC or SSO, so confirm limits for production |
| Store results in version control or object storage | Auditors need to retrieve evidence for past runs | Stable paths and naming make old runs comparable | Retention, access control and backup become your responsibility |
| Record model and endpoint identifiers per run | The provider updates models behind a stable alias | Without it, a score change cannot be traced to a model change | Requires the target to report or be labeled with its exact version |
When to trigger a re-run for each kind of change
A provider can change a hosted model without a new name or a version bump that your team controls. Aliases such as "latest" models can point to new weights, and safety tuning can shift between releases. Treat any upstream change as a trigger, even when your application code has not changed, and rerun the full suite that matches the production configuration of the target.
- Re-run the full suite: Use the same plugins, strategies, numTests and purpose as the last approved run, so the only variable is the model.
- Compare against the last approved run: Pin the baseline to the report you signed off, not to a run from a development branch.
- Check the model identifier: Record the exact model name and date the provider reports, so the trend can be tied to a specific upstream version.
- Investigate any rise in attack success rate on high-severity plugins: Look first at categories tied to your data and tools, such as PII disclosure or unauthorized tool use.
- Confirm what the provider changed: Ask the provider for release notes or deprecation notices, since the answer determines whether the shift is expected.
Check that the target configuration, grader and generation model are unchanged, so a difference in results can be attributed to the provider.
Fine-tuning changes model weights with data that may carry its own tone, refusal patterns or domain examples. Safety behavior can weaken even when accuracy improves, so a fine-tuned model should be tested as a new target rather than assumed to inherit the safety profile of its base model.
- Run the whole suite against the tuned model: Do not limit testing to the plugins that match the new training domain.
- Compare against the base model on the same suite: The base run shows whether any shift comes from the tuning itself.
- Add plugins for the training data: If examples contain customer records or internal documents, include data leakage plugins and custom intents built from those examples.
- Investigate broad shifts across categories: A rise limited to one plugin is a narrower finding than a rise across many unrelated plugins, which suggests general refusal weakening.
- Record the training data version: Link each run to the dataset and training job so results can be traced in an audit.
Ask the team whether the tuned model will be deployed alongside the base model, since each deployed variant needs its own trend line.
A system prompt, tool description or few-shot example can change how a model handles instructions that conflict with policy. Prompt edits are frequent and often small, which makes them easy to approve without testing. Make the re-run a required step in the prompt review process for any change that touches instructions, roles or tool use.
- Re-run the suite the prompt affects: Tool-related and access-related plugins matter most when tool descriptions or permissions change.
- Compare against the prompt version in production: Keep each prompt version identifier in the report so a trend can be read against a specific text.
- Watch for shifts in instruction-following attacks: Prompt injection and jailbreak strategies usually respond first to changes in wording.
- Review the purpose field: If the prompt changes what the application is for, update the purpose before the run, or the grader will judge against outdated expectations.
- Retest after rollback: Confirm the earlier results return when the prompt is reverted, which shows the change caused the shift.
A meaningful shift is one the team cannot explain from the diff alone, so the review should cover the exact lines changed.
A guardrail change is one that alters the filters, classifiers or policies that sit around the model. These changes are often made to reduce false positives, which means they can also reduce blocking of attacks. Testing should measure both sides, so the team can see whether the trade-off moved in an unexpected direction.
- Re-run with the guardrail in place: Test the full path from user input to model output, not the model alone.
- Compare against the guardrail version before the change: Keep the previous configuration so the baseline is reproducible.
- Watch for a rise in attack success rate on input-side plugins: A looser filter often shows up first in injection and encoding strategies.
- Check output-side plugins as well: A change to output filtering can expose harmful or private content that earlier runs blocked.
- Confirm the guardrail vendor's release notes: For hosted guardrails, ask what rules changed, since the vendor may not describe changes in the same terms your tests use.
Record both the attack success rate and any change in blocked legitimate requests, because a guardrail that passes more attacks is not automatically a regression if the team intended that outcome and documented it.
How baseline, change and comparison fit together
The cycle starts with a frozen attack suite and its purpose, which run against the target to produce a baseline. Each run is stored in run history tagged with the model, prompt and guardrail versions in use, so results from different configurations can be told apart. When a change event such as a provider model update, a prompt edit or a guardrail change occurs, the same suite is re-run and compared against the stored baseline. Check that the suite and purpose were not edited between runs, because a changed test set makes the comparison meaningless. The comparison then decides whether a rise in attack success rate needs investigation or can be accepted and recorded.
Frozen inputs feed each run, and comparison against stored history decides the outcome.
Security and data handling for stored red team history
Repeated red teams produce a growing record of attack prompts, model responses and grading decisions. That record can be as sensitive as the application it tests, so storage, access and configuration hygiene need decisions before the first scheduled run.
Map where results are stored
Each run writes prompts, responses and grades to the machine or server that executed it unless you configure otherwise. For drift detection, decide whether history lives on a laptop, in a CI artifact store or on a shared self-hosted server, and document the location for each. Ask your team to confirm the retention behavior of the version you run, since copies in CI logs and artifacts can outlive the promptfoo output itself.
Self-hosting docsLimit who can read history
Attack prompts that worked against your application are a roadmap for other attackers. The self-hosted app uses a local SQLite database, has no RBAC, built-in authentication or SSO, and is not recommended for production use. Shared red team history therefore needs a control layer in front of the server, such as a reverse proxy with your identity provider, network restrictions and a named owner for access reviews.
Plan the shared server control layer
Because the self-hosted app cannot be shared across replicas and lacks built-in authentication, a team instance needs compensating controls designed up front. Decide the authentication gateway, TLS termination, backup of the SQLite file, and who may restart or upgrade the service. Treat this layer as in scope for your security review, not as an afterthought to the test suite.
Keep secrets out of configs
Provider API keys, bearer tokens and session cookies belong in environment variables or your secrets manager, never in promptfoo configuration files committed to a repository. Attack suites are reused on every run, so a single hardcoded key is copied into every report and CI log. Check that target authentication for multi-turn tests uses injected values and that generated reports are scanned before they are shared.
Review generated data flows
Plugin generation and grading may send attack content and target responses to external services, depending on your configuration. Before scheduling recurring runs, document which data leaves your environment for each provider and grader you choose, and confirm this with your privacy and security reviewers. Re-check the flow whenever you change the grading model or add a hosted strategy.
Red teaming docsDefine retention and evidence handling
Drift evidence is only useful if it is kept long enough to show a trend, and only as long as your policy allows. Agree how long run histories, reports and raw transcripts are retained, who may export them for an auditor, and how deletion is recorded. Ask your compliance lead to confirm these rules before the first quarterly comparison is requested.
What audit evidence a drift history can and cannot show
A drift history is useful audit evidence only as a record of testing, not as proof that a system is secure. Each repeated run of the same fixed attack suite produces dated results, the attack success rate per plugin and strategy, and the configuration that was tested. Kept together, those records can support a control narrative: the organization defined a test set, ran it before and after each model, prompt or guardrail change, compared results against a baseline, and acted on regressions. Frameworks that promptfoo's documentation references, including the OWASP LLM Top 10, the NIST AI Risk Management Framework and the EU AI Act, ask for systematic, repeatable testing before deployment and ongoing risk management. A drift history can show that this testing happened and that changes were reviewed, which maps to the evidence those frameworks describe in general terms.
Your records must show the context of each run, or the trend line is hard to defend. For every run, keep the promptfoo version (the npm release, such as the 0.124.1 release published on 8 October 2026, if that is the version you ran), the target model identifier and provider version, the prompt and guardrail configuration hash, the test suite file revision, the grading model, the run timestamp and the operator. Store the raw results with the summary, because auditors often ask to trace a headline number back to individual probes. Confirm with your auditor which retention period and storage location they expect. The self-hosted promptfoo server stores data in a local SQLite database that cannot be shared across replicas, so archive exported results to storage your records process already covers.
A drift history cannot show that the system is safe, that the attack suite covers every relevant risk, or that a regression was absent when it was not tested. Probes are samples, and attack success rate depends on the grader, the purpose text and the target's behavior under load. A flat trend can also mean the suite stopped reflecting current threats. Tell auditors what the suite does not cover, who approved the test set, and how new attack classes are added. Auditors decide whether this evidence is sufficient for a given control. DeployOpen does not issue audit reports, attestations or certifications. We can help you define the test set, keep the run records and prepare the evidence pack, and the independent auditor or certification body decides what it proves.
Limits to confirm before relying on drift results
A drift trend is only as reliable as the test run behind it. The cards below cover the variables that can move results without any change in the application, so you can separate real security regressions from noise in your own environment.
Attack stability across runs
Confirm whether the generated attack prompts stay the same when you regenerate a suite from the same purpose and plugin settings. If they change between runs, a rise in attack success rate may reflect different probes rather than a weaker defense. Pin the generated set after the first run, store it with your results, and rerun that exact set for every comparison. Ask promptfoo or check your configuration to see which generation outputs can be saved and reused.
Drift detection docsGrading model changes
Confirm which model grades each finding and whether that model is pinned. A change in the grader can shift attack success rate even when the target is unchanged. Run the same stored outputs through the old and new grader once, and compare verdicts on a sample before you treat a trend as a target regression. Record the grader name and version alongside every run.
Community probe allowance
Confirm how many probes your Community edition allows per month and how many a full drift suite consumes once strategies and per-plugin test counts are applied. A suite that runs out of allowance mid-cycle leaves gaps in the trend line. Calculate the probes for one complete run, multiply by your planned run frequency, and compare the total with the monthly limit before you schedule anything.
- Community monthly allowance
- 10k probes
Target rate limits
Confirm the request rate your model provider or gateway allows for the target endpoint. Throttling can cause timeouts or retries that change which probes complete and how they are recorded. Compare the number of completed probes in each run, not only the score, and flag any run where the completion count drops. Schedule drift runs outside peak provider usage where possible.
Hosted generation dependency
Confirm whether attack generation and grading call a hosted API in your setup. If they do, provider-side model updates, outages or network policy changes can alter the suite between runs without anyone touching your configuration. Check where generation and grading run in your environment, and decide whether a local model is needed to keep the suite fixed. Document the answer before you present drift results to an auditor.
Red teaming docsEvidence retention
Confirm where run outputs, configurations and generated test sets are stored and for how long. Drift trends are only useful for audit evidence if the earlier runs can still be retrieved and their settings reconstructed. The Community edition stores data on your machine, so back up result files and the exact configuration for each run, and agree a retention period with your compliance team.
Questions teams ask before running drift detection
How much effort does a baseline red team run take?
The baseline is the first run of the attack suite against the current model, prompt and guardrail setup, and it is the reference every later run is compared against. Most of the effort sits before the run: agreeing the purpose, choosing plugins and strategies, fixing the test set, and confirming that grading matches what your team counts as a finding. Ask your team to record the exact configuration, because a baseline that cannot be reproduced cannot show drift. Promptfoo's own documentation on model drift describes the method as running consistent adversarial tests over time and comparing attack success rate, so the baseline is the anchor for that comparison.
What drives the cost of drift detection?
Cost comes from five components, and each one is paid by a different party. Target access means endpoint setup and test accounts, usually owned by your platform team. Probe volume is driven by the number of plugins, the numTests per plugin and the strategies you enable, and it sets both runtime and model spend. Staff time covers writing the purpose, reviewing borderline findings and reading trends. Storage holds the results and evidence for each run. Review is the recurring part, because someone must triage new failures after each change. Ask any quote to split these components so you can see what recurs on every re-run.
Can our team run drift detection alone with the open-source CLI?
Yes, the promptfoo CLI is licensed under the MIT license and can run red team scans from the command line, in a library or inside a CI/CD pipeline. Community edition includes red teaming with 10k probes per month and community support. Teams usually need one person who owns the configuration, a stable place to store the fixed test set and results, and a process for reviewing failures. Note that the self-hosted web app uses a local SQLite database that cannot be shared across replicas and has no RBAC or built-in SSO, so it is not recommended for production. If you need shared access controls, confirm what the Enterprise or On-Premise editions add before you plan around them. DeployOpen can plan or implement the setup if your team prefers help.
How often should we re-run the attack suite?
Re-run the same suite after every change that could move security behavior: a provider model update, a fine-tune, a system prompt edit, or a guardrail or filter change. Promptfoo's drift guidance names these triggers, so tie the schedule to your change records rather than a calendar alone. Many teams also run a scheduled re-run to catch silent provider updates, since those arrive without a change on your side. The right frequency depends on how often your model and prompts change and how much review capacity you have. Confirm the schedule with your risk owner, and keep the suite fixed between runs so the trend line stays meaningful.
What does the work need from our side?
Drift detection depends on four things from your organization. First, endpoint access: a stable URL or endpoint for the application under test, with test credentials that match the production authorization model. Second, named owners: one person for the configuration, one for grading decisions, and one who approves changes to the fixed test set. Third, change records: a log of model versions, prompt revisions and guardrail updates, so each attack success rate change can be matched to a cause. Fourth, a place to keep evidence. Without the change log, a rise in attack success rate cannot be traced, and without fixed owners, the trend stops being trusted.
Does drift detection prove our AI system is compliant?
No. Repeated red teams produce test evidence, such as run configurations, attack success rate trends and findings history, that your compliance and security teams can review. They do not issue an audit report or certification, and independent auditors and certification bodies make that determination. Promptfoo's red teaming documentation references the OWASP LLM Top 10, the NIST AI Risk Management Framework and the EU AI Act as frameworks that support systematic testing before deployment. Ask your auditor which evidence they expect, and confirm how your regulator treats automated testing before you describe the results as compliance evidence.
What are the main ways drift detection goes wrong?
The most common failure is a changing test set. If plugins, strategies or numTests change between runs, the attack success rate no longer compares like with like. The second is grading drift: a grader model or grader guidance changes, and the trend moves for reasons unrelated to the system. The third is provider-side changes you do not see, which appear as a sudden trend shift with no change record. The fourth is alert fatigue, where failures are not triaged and the suite stops being read. Check the configuration hash, pin the grader, and assign a reviewer before you treat a trend as a finding.
How do we keep the results and evidence secure?
Treat red team results as sensitive, because they can contain working attack prompts and details of weaknesses in your application. Store them in a controlled location with access limited to the owners named for the program, and keep secrets such as API keys out of configuration files and reports. Confirm what data is sent to hosted services for generation and grading, since that depends on your configuration and is covered in promptfoo's data-flow documentation. Retention periods should be set by your security and records policies, not by the tool.
How DeployOpen scopes drift detection for your application
DeployOpen scopes drift detection as a written, fixed-scope engagement, so the scope, deliverables and timelines are agreed before any repeated run is configured. The first working session settles which application and endpoint the suite targets, which model, prompt and guardrail versions count as a baseline, and which changes should trigger a rerun, such as a provider model update, a fine-tune, a system prompt edit or a change to a guardrail policy. Each trigger is written down with an owner, because a drift signal is only useful if someone is accountable for acting on it. The same session confirms what is out of scope, for example whether generated attack data may leave your network, since that changes which grading and generation models can be used.
The attack suite is agreed as a fixed artifact before the first baseline run. DeployOpen works with your team to freeze the plugin selection, strategies, numTests per plugin and the grading configuration, and to record them in version control alongside the purpose text. Freezing matters because a changed probe set makes attack success rate trends impossible to compare. DeployOpen then configures repeated runs inside your infrastructure, including where the promptfoo configuration, results and reports are stored, how the runs are scheduled or triggered from your pipeline, and who can view the output. Ask the partner to confirm in writing how stored results are retained, since a self-hosted promptfoo server uses a single local SQLite database, and self-hosting documentation lists its limits for production use.
After the engagement closes, retesting is handled through a retainer if you want continuous coverage. A retainer can cover rerunning the frozen suite after agreed triggers, reviewing the attack success rate trend, retesting after fixes and keeping the configuration aligned with promptfoo upgrades. Ask any partner for the scope of each retainer in writing, including response expectations, and confirm whether the retainer includes evidence packages for your audit or assessment teams. Those packages are evidence of tests run, not an audit report or certification, since independent auditors and certification bodies issue those.

