Scheduling promptfoo red team scans in CI/CD

Run promptfoo red team scans on a cron schedule or on release branches instead of every commit, with clear run tags, a deliberate choice between regenerating and reusing attack suites, and results stored where reviewers can act on them.

On this page

Scheduling promptfoo red team scans in CI/CD: when every commit is too often

If a full red team scan takes too long or costs too much to run on every commit, move it to a schedule or to release branches and keep fast eval checks on each change. A scheduled or release-branch scan runs the red team configuration against your application on a trigger you choose, instead of on every push. The per-commit pipeline keeps running the cheaper checks that catch obvious regressions, while the heavier adversarial run happens at a cadence that matches how often the model, prompts, tools or retrieval data actually change. The promptfoo CI/CD guide shows this pattern with a cron trigger, such as a scheduled security scan that runs daily at midnight, so the same pipeline definition can serve both a commit trigger and a timed one.

Teams usually reach for this pattern when three things are true at once: the red team run calls a paid model provider many times, it takes long enough to hold up merges, and the application under test changes less often than the code around it. A nightly or weekly run can also make sense when the attack suite is large and results are reviewed by a security group on a fixed rhythm. The right schedule depends on your release cadence. Ask your engineering and security leads how often prompts, tool permissions, model versions and knowledge sources change, then align the scan with each of those events. Confirm with your provider how many requests a full run sends and what your rate limits allow before you choose a frequency.

Which triggers fit a red team scan: cron, release branches or manual runs

Each trigger answers a different question: whether the application still holds up over time, whether a specific change is safe to ship, or whether a particular build needs a deliberate check. Choose the trigger that matches the risk you are testing, then pair it with the others so that gaps between runs are covered.

Scheduled cron runs

A cron trigger runs the red team scan at a fixed time, such as the daily midnight example in the promptfoo CI/CD guide. It catches drift in the deployed model, provider behavior changes and new attack patterns that appear without any code change in your repository. Between runs, a prompt or tool change merged at 9 a.m. stays untested until the next scheduled run. Check that the pipeline's scheduler is enabled for the branch you test, that the job runs against the same environment as production, and that failures notify an owner.

CI/CD guide

Release branch and tag runs

Running the scan when a release branch is updated or a version tag is created tests the exact build you intend to ship. It catches regressions introduced by prompt edits, model swaps, retrieval changes and tool configuration that passed ordinary evals but weaken guardrails. It misses problems that appear only when the model provider changes behind an unchanged build. Confirm that the pipeline only triggers on the branch or tag pattern you release from, and that the scan results are tied to the commit or tag so reviewers can trace a finding to a build.

Manual and pre-release runs

A manual run gives a security or release owner control over when a full red team scan executes, for example before a customer-facing launch or after a major change to an agent's permissions. It catches issues in changes that were not on a release branch and lets the team run a larger attack suite without spending that budget on every build. It depends on people remembering to run it, so write the pre-release checklist into your release process. Confirm who is allowed to start a manual run, since the run uses provider credentials and may incur model API costs.

Combining triggers without duplicate spend

Most teams use more than one trigger: a scheduled run for drift, a release run for shipped builds and a manual run for ad hoc checks. The risk is running the same full suite three times for the same commit and paying for it each time. Agree which trigger owns which suite size, and skip a scheduled run when a release run has already tested the same commit. Check that the pipeline can tell which trigger started a job, because that label is what reviewers use to read results.

How tagging, regeneration and reuse of attack suites change the scan

When a model version, system prompt, retrieval source or tool set changes, the main question is whether the change introduced new risk. A regenerated attack suite suits this situation because it can surface failure modes the previous suite never probed, and a tag that names the change (for example, the branch, the model identifier or the prompt version) lets reviewers trace which change produced which result. Regeneration gives broader coverage but produces a different set of probes, so the pass rate from this run is not a clean comparison with the last run. Treat the result as a finding to investigate rather than a trend point.

  • Tag by change: Include the model identifier, prompt version or commit in the run tag so each result maps to one change.
  • Regenerate for breadth: A fresh suite can probe categories the saved suite does not cover, which suits changes with unclear blast radius.
  • Accept lower comparability: Scores from a regenerated suite should not be compared directly with earlier scores without also running the saved suite.
  • Run the saved suite alongside: Running the reused suite on the same change gives a like-for-like baseline next to the broader result.
  • Confirm generation settings: Check with your team which plugins, strategies and attack counts were used for each run, since these determine what the regenerated suite covers.

Before relying on a new run, confirm that the tag, the generation settings and the saved baseline are all recorded with the same change identifier.

Configuration options and when each fits

This table compares the main choices for a scheduled promptfoo red team job: how often it runs, which branches trigger it, how runs are labeled, whether attack suites are regenerated or reused, how scope is set, and where results go. Read each row for the situation it suits and the cost it adds. Confirm exact keys and syntax in the promptfoo CI/CD guide before you build the job.

OptionWhen it fitsTrade-off
Cron schedule frequencyNightly or weekly runs when prompts, tools and models change in bursts and you want drift caught without blocking each merge.Less frequent runs find a regression later. Frequent runs increase provider spend and rate-limit pressure on the same key.
Branch or tag filtersRelease branches or version tags where a red team pass is a release gate, while feature branches run only lightweight evals.Teams can forget that a path is excluded. Confirm which refs trigger the job in your CI system's syntax.
Run tagging or labelsSeveral environments or model versions share one pipeline and reviewers need to tell runs apart in the results view.Labels only help if the naming convention is written down and enforced. Inconsistent tags make trend comparison unreliable.
Regenerate the attack suiteYou want fresh probes each run to reduce the chance that a fixed set is memorized or drifts from current attack techniques.Results are harder to compare across runs, and generation adds cost and possible variance between runs.
Reuse the attack suiteYou need a stable baseline so that a change in pass rate reflects the application, not a different set of attacks.The suite can become stale as new attack techniques appear, so schedule a periodic review of its contents.
Plugin and strategy selectionA narrow scope suits a focused change, such as a new tool or a new retrieval source. A broad scope suits a scheduled full pass.A broad scope raises run time and probe count. A narrow scope leaves categories untested between full runs.
Results to CI artifacts with JUnit or HTML reportsA small team wants reports attached to the pipeline run that reviewers already open, with no extra service to operate.Artifacts expire under retention settings and are hard to trend across weeks. Reports can contain sensitive prompts and responses, so restrict access.
Results to a self-hosted promptfoo serverSeveral teams need shared history, trend views and access control across scheduled runs.The self-hosted app stores data in SQLite that cannot be shared across replicas and has no built-in authentication or SSO, so it is not recommended for production use. Plan for hosting, backups and access control.

How a scheduled run moves from trigger to reviewed results

A scheduled run starts from a cron trigger, a release branch or a manual start, and the CI job pulls provider keys from secret storage before it does anything else. The job then chooses whether to regenerate the attack suite or reuse a saved one, runs the promptfoo red team, and routes results to CI artifacts, reports and a review step. A failed run should raise an alert. The shaded boundary marks where provider keys and test prompts leave your pipeline for the model provider, so confirm what each provider retains before you widen the schedule.

Scheduled red team run from trigger to reviewed results, with the provider boundary marked.

Setting up a scheduled red team job in your CI system

This sequence takes a team from a pinned promptfoo version to a scheduled or release-branch red team job that runs with managed keys, tagged runs, a deliberate attack suite policy and results that reviewers can find. It ends with a manual first pass that confirms output and spend before the schedule is trusted.

  1. Confirm the promptfoo and Node.js versions

    Pin the promptfoo release your job will install, and confirm the runner image provides the Node.js version that release requires. The promptfoo npm release 0.124.1, published on 8 October 2026, requires Node.js 22.22.0 or newer, so a job on an older Node image will fail before any probe runs. Check: a version command on the runner prints the pinned promptfoo version and a Node.js version at or above the stated minimum. Confirm the release notes for any change before upgrading the pin.

  2. Define the red team config and target

    Commit a red team configuration file that names the application under test, the plugins and strategies to run, and the grader. Keep the target endpoint and any test-only settings in this file or in environment variables, not hard-coded in the pipeline definition. Confirm the config runs locally against a non-production target before CI is involved. Check: a local run completes and writes a results file with the expected plugin coverage, and the config passes review like any other code change.

  3. Add a scheduled trigger

    Add a cron-based trigger to the pipeline so the red team job runs on a fixed cadence, separate from the job that runs on every commit. The promptfoo CI/CD guide shows a cron trigger set to run daily at midnight as an example of a scheduled security scan. Agree the cadence with the security owner and the cost owner, since each scheduled run makes model calls. Check: the pipeline shows the schedule in the CI system's trigger list, and a manual trigger of the same job produces the same output.

  4. Add a release branch trigger

    Add a second trigger that runs the same red team job when a release branch is created or updated, so the scan covers the build that is about to ship. Keep the commit-level pipeline free of the full scan unless the team decides otherwise. Confirm the branch pattern matches your release naming convention. Check: a push to a test release branch starts the job, and a push to an ordinary feature branch does not.

  5. Store provider keys in masked or secret variables

    Place the model provider keys and any target credentials in the CI system's secret or masked variable store, scoped to the scheduled job and release branches only. Do not echo them in the config or log them in debug output. Ask the platform owner who can read these variables and whether protected branches are required for access. Check: a test run prints no key values in the log, and a branch outside the protected scope cannot read the variables.

  6. Tag each run and choose regenerate or reuse

    Tag each run with its trigger type, branch, commit and date, so reviewers can separate scheduled results from release results. Then decide whether each run regenerates the attack suite or reuses a saved one. Regenerating gives broader coverage of new attack variants but changes the set of probes between runs and raises cost. Reusing a fixed suite makes results comparable over time but can miss new techniques. Many teams regenerate on the scheduled run and reuse on release branches. Check: two runs with the same tag scheme produce results that can be sorted by trigger, and the chosen policy is written in the pipeline notes.

  7. Route results to artifacts and a review location

    Save the results file and the report as pipeline artifacts with a retention period your team sets, and send a summary to the location where the security or AI owner reviews findings. Results can contain sample prompts and model outputs that may include sensitive content, so limit who can open them and confirm your retention rules. Check: the artifact is downloadable from the run page, and the designated reviewer receives a link or notification.

  8. Run a first manual pass to check output and cost

    Trigger the job by hand once before the schedule is relied on. Read the report to confirm the plugins ran, the findings are readable, and the grader results look sensible. Record the model calls and spend the run produced, then compare that figure with your budget for the schedule. Check: the manual run completes, the artifacts and tags are correct, and the cost per run is recorded so the owner can estimate recurring spend before enabling the cron trigger in production.

Security and operational risks of unattended red team runs

Scheduled red team scans run without anyone watching the console, so their risks show up in logs, stored results, cost reports and the people who receive them. Each card below pairs one risk with the control to apply before the first unattended run, and most of the controls come down to where results live and who can read them.

Provider keys in logs and artifacts

A scheduled job that prints its environment, echoes a config file or uploads a full working directory can expose the API keys it uses to call the model. Mask provider keys in the CI system, load them only into the job that calls the model, and keep them out of uploaded artifacts. Check the job log and every artifact after the first scheduled run, and confirm the keys cannot be read from forked or external pipelines.

Sensitive data in stored results

Attack prompts and model responses can contain sample personal data, system prompt text or tool output from the application under test. Because promptfoo runs on your machine and talks directly to the model, the storage location of each results file is a decision your team owns, not a default the vendor makes for you. Decide where results land, how long they stay there, and whether that location meets your data handling policy before the schedule goes live.

Silent failures and stale results

A cron trigger can keep firing while the job fails on a changed endpoint, an expired key or a dependency update, and the last green report then looks current. Make the job fail loudly on error, record the commit, configuration and date with every run, and alert the owning team when no new result has arrived within the expected window. Review the age of the newest report during routine checks.

Unbounded spend from frequent runs

Each red team scan calls the target application and, for model-graded checks, a grader model, so the bill grows with every run, concurrency setting and attack suite size. Set a scan size and concurrency limit in the configuration, choose a schedule that matches how often the application changes, and ask the model provider for spend alerts or budgets on the key used by the job. Review spend against the number of runs each month.

Attack suite drift between runs

If every scheduled run regenerates attack prompts, results from one week cannot be compared with the next, and a regression can hide behind a different set of probes. Decide which runs regenerate the suite and which reuse a saved one, store the generated suite with its run record, and tag each run with the release it tested. This keeps trend lines meaningful for reviewers.

Reports reaching the wrong readers

Red team reports describe weaknesses in a production application, and CI systems often show artifacts and build logs to anyone with repository read access. Limit who can open the pipeline and download reports, send summaries rather than full result files to broader audiences, and confirm that access to the results location follows the same model as access to the application. Self-hosted promptfoo has no built-in RBAC or SSO, so these controls sit in your CI system and storage.

Where red team results should live for review and audit

The place where scheduled red team results land decides who can review them, how long they are kept and whether an auditor can trace a finding back to a run. Most teams start with CI artifacts: the scan writes its report files, the pipeline attaches them to the run and the retention period is whatever the CI system is configured to keep. This is cheap and needs no new infrastructure, but each nightly run is an isolated folder. Trend analysis across weeks, finding ownership and sign-off usually have to be built by hand, and access follows the CI project's permissions, which may be wider than the security team's need.

A shared report store, such as a versioned storage bucket or a document location with restricted access, gives reviewers a stable home for exported results. It works well when the requirement is evidence retention rather than interactive triage. Whatever you choose, confirm what the exported files contain before sharing them, because red team output includes the attack prompts and model responses that produced each finding, and those may include sensitive data. Set retention and access rules in writing, and test that a restore or retrieval works before you rely on it.

A self-hosted promptfoo server is the option that adds a web UI and API to the results. The self-hosted app stores data in a local SQLite database that cannot be shared across replicas, has no RBAC, no horizontal scaling, no built-in authentication or SSO, and the promptfoo self-hosting documentation does not recommend it for production use. For a team that needs shared access, the paid tiers are the documented path: promptfoo Enterprise adds team sharing, teams-based access control and SSO, custom roles, continuous monitoring and remediation recommendations, and promptfoo On-Premise runs that functionality in your own infrastructure with a dedicated deployment engineer. Both are custom priced, so ask for a written quote and confirm current capabilities with the vendor before design decisions depend on them.

Limits to confirm before you commit to a schedule

A scheduled red team scan is only as predictable as the limits behind it. Probe allowances, runner capacity, provider throttling, framework claims and vendor ownership each shape whether a schedule holds up over months. Confirm these before you commit a cadence to a pipeline.

Community probe allowance

The Community edition includes red teaming with 10k probes per month. Work out how many probes one scheduled scan consumes across your plugins and strategies, then multiply by how often it runs. If a daily or per-release schedule exceeds the allowance, reduce scan size, narrow plugins to the release risk, or price a higher tier. Confirm the current allowance with promptfoo before you commit.

Pricing page

Runner time and concurrency

A red team scan calls the target application and a grader model many times, so it can run for a long time on a shared CI runner. Check the runner's timeout, the job's concurrency limit and whether a scheduled job can starve merge pipelines. Decide whether scans run on dedicated runners with their own time budget, and confirm the maximum job duration your CI platform allows.

Provider rate limits and spend

Scheduled attacks against a model API can hit requests-per-minute or token limits, causing retries, partial results or throttled reruns. Each run also bills against your provider account, and the attacker and grader models may be billed separately from the target. Ask your provider for the limits on the key used by the schedule, and set a concurrency cap before the first production run.

Framework mapping is support, not proof

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. A scheduled scan produces test evidence, but it does not establish compliance on its own. Confirm with your compliance lead and any independent assessor which controls the scan actually covers, and keep the mapping in your own records.

Red teaming docs

Vendor direction and license

promptfoo is licensed under the MIT license, and OpenAI acquired promptfoo, announced on 9 March 2026. The founders state that promptfoo will remain open source and continue to support a diverse range of providers and models. Because a schedule may run for years, ask the project in writing how it plans to handle licensing, provider support and the Community edition, and record the answer in your risk file.

Acquisition post

Questions buyers ask about scheduling red team scans

What drives the cost of scheduled promptfoo red team scans?

The main cost drivers are the model calls the scan makes, the number of targets it runs against, and the size of each scan. Every probe sends traffic to the model under test and, where grading is model-based, to a grader model, so provider billing scales with probe count, attack strategies and the number of applications in scope. Engineering time is a separate, mostly one-time cost to build the pipeline job, tag runs and wire up reports. Ask any partner quote to split these into setup effort, recurring provider spend you pay directly, and any retainer for ongoing upkeep. The promptfoo Community edition is free under the MIT license and includes red teaming with 10k probes per month, so check whether your planned schedule stays within that allowance before assuming any licence cost.

How long does it take to set up a scheduled red team scan?

Duration depends on how many targets you have, how well your application exposes a testable endpoint, and whether your CI system already runs promptfoo jobs. A single target with a working provider configuration is usually the quickest case, while several applications, agents or custom HTTP endpoints add planning for scope, credentials and grading. No supplied figure gives a fixed duration, so ask any partner for a timeline that follows from a written scope, and confirm it with your own platform team. Fixed-scope work is agreed in writing before it starts, which lets you compare the timeline against the number of targets, schedules and report channels you need.

What does the work need from our team?

Expect to supply the people and access that only your organization holds. That usually means a CI administrator who can create scheduled pipeline triggers, someone who owns the application under test and can describe its intended behavior, and a security or compliance reviewer who decides what counts as a failed finding. You will also need to provide provider keys stored in your CI secret store, network access from the runner to the model endpoints, and a place for reports, such as a ticket queue or a shared dashboard. Without these decisions made early, a schedule tends to run without anyone reviewing the output.

Can our own team set up scheduled red team scans without a partner?

Yes, if your team has CI experience and can read promptfoo configuration files. The CLI runs locally, the Community edition includes red teaming, and the scheduled security scan pattern uses a cron trigger in the pipeline. The parts that usually need outside help are scoping which attacks matter for your application, deciding how to regenerate or reuse attack suites, and designing reporting that security and compliance teams accept. Self-hosted promptfoo is not recommended for production use as a shared service, so a team-wide dashboard needs a different architecture, which is a planning decision to make before building.

How often should we run scheduled red team scans?

Choose the frequency from how often your application, prompts, tools and model versions change, not from a fixed rule. A daily cron trigger, such as the midnight example in the promptfoo CI/CD guide, catches provider-side changes and drift, while release-branch runs match scans to deployments. Frequent scans increase provider spend and produce more findings to triage, so balance the interval against the cost of the probes and the staff time needed to review results. Re-run the scan after any change to prompts, tools, retrieval sources or the underlying model, whatever the schedule says.

Does a scheduled scan replace pre-release testing?

No. A schedule shows how a deployed application behaves over time and can catch regressions from provider updates or configuration drift, but it does not replace a scan that runs against a candidate release before it ships. Pre-release testing gates a specific build, while scheduled runs monitor what is already live. Many teams run both: a release-branch scan before deployment and a recurring scan afterward. Testing alone also does not produce compliance evidence on its own; frameworks such as the OWASP LLM Top 10 and the NIST AI Risk Management Framework describe what to test, and your assessors decide what evidence they accept.

Should we regenerate attack suites or reuse them on each scheduled run?

Reusing a fixed attack suite gives you comparable results between runs, which helps you spot regressions. Regenerating it each run widens coverage but makes results harder to compare, and it adds model cost for generation. A common pattern is to reuse a fixed suite for trend tracking and regenerate on a slower cadence or on release branches. Record which suite version produced each result so reviewers can tell a new finding from a changed test.

How DeployOpen scopes and supports scheduled promptfoo red team runs

DeployOpen treats scheduled promptfoo red team runs as a written scope: which attack suites run on which schedule, where results go, and who reviews failures. The work is built inside your own CI system and infrastructure, then handed over with documentation your team can run without us.

How we scope

  • Confirm which branches, tags and calendar triggers should start a full red team run versus a lighter per-commit check
  • Agree which target application, endpoints and provider accounts the scheduled job may reach, with credentials held in your secret store
  • Record in writing where results are stored, who receives failure notices and how long reports are retained

How we build

  • Configure cron-based scheduled pipelines in your CI system, with the run tagged by date, commit and suite version
  • Decide with your security team whether attack suites are regenerated on each run or pinned and reused for comparison
  • Test the schedule with dry runs and a deliberately failing target to confirm alerts and gates behave as written

How we hand over

  • Document the trigger definitions, suite versions, tagging convention and the location of every report and artifact
  • Provide a runbook covering how to rerun a scan, investigate a finding and retire or update an attack suite
  • Walk your platform and security engineers through the pipeline so they can change schedules without rebuilding it

How we support

  • Fixed-scope engagements agree deliverables and timelines in writing before any build work starts
  • Ongoing upgrades of promptfoo versions, pipeline maintenance and continuous testing are available as a retainer
  • Confirm the support terms, response expectations and included retests with DeployOpen in your written quote

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.