Scheduling recurring garak regression scans

Run garak on a schedule in infrastructure you control to catch regressions after model, prompt, guardrail or probe changes, and compare every run with the last one.

On this page

Why scheduled garak regression scans matter for LLM applications

A model provider can update a model, a team can edit a system prompt, a guardrail can be tuned, or a garak upgrade can change probe behavior, and none of these changes necessarily produces an error or an alert. The application keeps responding, but its resistance to prompt injection, jailbreaks or data leakage may have moved. Scheduled garak runs catch those regressions, and this page explains how to set them up as a recurring job and how to compare each run with the last one.

According to the garak README, garak is a command-line tool that probes LLMs for weaknesses such as hallucination, data leakage, prompt injection, toxicity generation and jailbreaks. It is built from probes that send attack prompts, detectors that judge the responses, and harnesses that run each probe with its recommended detectors. Each run writes a JSONL report of every attempt and its evaluation, and a garak.log file that continues across runs. garak is licensed under Apache 2.0, so a team can run it inside its own environment, including a Kubernetes cluster it operates. Before scheduling anything, confirm the pinned garak version and the Python version it requires, because both affect whether a later run is comparable.

One-off scans answer the question of how an application behaved on the day it was tested. Recurring scans answer whether it still behaves that way. Teams usually need the recurring pattern when the model endpoint, system prompt, retrieval content, guardrail rules or garak version can change without a release that reviewers would notice, or when a compliance owner needs repeatable evidence over time. The cadence should follow how often those inputs change in your environment, and you should confirm it with the people who own each change path rather than assume one.

Choosing where the scheduled scan runs

A Kubernetes CronJob suits teams that already operate a cluster and want scans to run inside the same network boundary as the model or application under test. The job starts a pod from a container image on a cron schedule, runs garak, writes the report to a volume, and exits. Scheduling, retries and history are handled by Kubernetes, which makes the job easy to review alongside other workloads.

  • Image and version pinning: Build an image that installs a specific garak release from PyPI, and tag it with that version so every run uses the same probes and detectors until you choose to change them.
  • Secrets: Pass API keys and endpoint credentials through Kubernetes Secrets. Secrets are stored unencrypted in etcd by default, so confirm that encryption at rest is configured for the cluster and restrict list and watch access with RBAC.
  • Report storage: Mount a PersistentVolumeClaim or push reports to an approved object store, so the JSONL reports and garak.log survive pod deletion and can be compared with the previous run.
  • Internal endpoints: Pods reach services on the cluster network directly, which avoids exposing a model endpoint outside its network. Confirm network policies allow the scan pod to reach the target and nothing else.
  • Air-gapped and regulated hosts: A cluster in a restricted network can run the job once the image, garak dependencies and any Hugging Face artefacts are mirrored into the internal registry. Check that Pod Security Standards and your cluster hardening baseline allow the scan container.

Before adopting this option, ask who on your team owns the cluster upgrade cycle and whether that cadence fits the scan schedule.

Scheduling options and when each fits

This table compares the main scheduling choices for recurring garak regression scans, from CronJob settings to probe set size and report retention. Read each row against your target's request limits and the team that will review results, then pick the smallest schedule that still catches the changes you care about. The default of 5 generations per prompt is usually the first setting teams change, so treat it as the lever to review before anything else.

OptionWhen it fitsRequest volume and operator effort
Concurrency policy (Forbid, Replace, Allow)Forbid suits scans that take longer than the interval, so two runs never hit the target together. Replace suits cases where only the newest run matters.Forbid keeps load on the target predictable but can skip a run silently. Allow stacks runs and multiplies request volume, so confirm the endpoint owner accepts that.
Schedule timingOff-peak windows fit hosted or shared endpoints. Run after model, prompt or guardrail deploys when you want a fresh baseline for that change.Timing does not change total requests, but it affects rate-limit collisions and how quickly someone reviews failures. Agree the window with the endpoint owner.
Pinned garak version versus latestPin a version for comparable scores across months. Track latest in a separate job when you want to see how new probes change results.A pinned version needs deliberate upgrades and a note on score shifts. Tracking latest adds noise, so compare probe-by-probe rather than overall rate.
Probe set size per runA small fixed set fits frequent runs on every change. A broader set fits a weekly or release-gate run.Probe count drives request count most directly. Start with the probes that match your exposure, then widen the set on a slower cadence.
Generations per promptLower values fit frequent smoke runs. Keep the default of 5 generations per prompt for baseline and release runs, since it reflects how garak marks a FAIL.Generations multiply requests for every prompt. Lowering them cuts volume but can hide intermittent failures, so record the value in every report.
Retained report historyKeep enough history to compare the last run and the last baseline. Longer retention fits audit evidence needs.Reports can contain harmful prompts and outputs, so longer retention adds storage and access-control work. Confirm your retention policy before choosing a period.
Trigger type (time, change, probe update)Time-based schedules catch drift and endpoint changes. Change-based triggers fit model, prompt or guardrail releases. Probe-update triggers fit new garak releases.Change triggers need pipeline integration and a clear owner. Time-based runs are simpler to operate but may run when nothing has changed.

How to set up a recurring garak CronJob

This sequence turns a one-off garak run into a scheduled Kubernetes CronJob with a pinned version, a fixed configuration, protected credentials and persistent reports, so each scheduled run produces a JSONL report you can compare with the previous one. It is the foundation for catching regressions after model, prompt or guardrail changes.

  1. Pin the garak version from PyPI

    The platform engineer chooses a specific garak release from the PyPI package index and records it in the image build or requirements file, using Python 3.11 or newer as the PyPI package requires. Pinning the version means every scheduled run uses the same probes and detectors until someone deliberately changes it. Confirm the choice by running garak --version inside the built image and checking that the output matches the pinned release. Review the garak releases page before upgrading, because probe and detector changes can shift scores between versions.

  2. Write a fixed garak configuration file

    The security engineer writes a configuration file that names the probes, generations and harness settings, and a separate generator file that describes the target endpoint. Store both in version control so that a change to the scan is a reviewed change, not an edit made on the cluster. Keep the probe selection and generation count identical across runs, since any difference will make later comparisons unreliable. Check the files by running a single probe locally against a test endpoint and confirming that a JSONL report is produced. The REST generator is configured with a short YAML file describing the endpoint, so the generator file is where the target URL and request format live.

  3. Store API keys in a Kubernetes Secret

    The cluster administrator creates a Kubernetes Secret that holds the target endpoint credentials and mounts it into the CronJob as environment variables or a file, so keys never appear in the image, the config files or the job definition. Kubernetes stores Secrets unencrypted in etcd by default, so confirm that encryption at rest is configured for the cluster and that RBAC restricts who can read the Secret. Limit access to the scan namespace and avoid printing the Secret contents in job logs. Verify the setup by listing the Secret's keys without showing values and confirming that a test pod in the namespace can read the credential it needs.

  4. Mount a persistent volume for reports and logs

    The platform engineer creates a PersistentVolumeClaim and mounts it into the CronJob at the path where garak writes its output, so each run's JSONL report and the continued garak.log survive after the pod exits. Point report output to that path with the report directory setting or XDG_DATA_HOME, so that every run lands in the same storage. The volume must be writable by the non-root user in the container and must retain data across pod restarts. Confirm the mount by creating a test file from a pod that uses the claim and reading it back from a second pod. Reports contain harmful prompts and outputs, so restrict who can read this volume.

  5. Create the CronJob with concurrency forbidden

    The platform engineer defines the CronJob with a schedule, the pinned image, the mounted Secret and volume, and concurrencyPolicy: Forbid. The Forbid setting stops a new scan from starting while the previous one is still running, which prevents two runs from writing to the same report directory or competing for the target endpoint's rate limits. Set a sensible startingDeadlineSeconds and a failedJobsHistoryLimit so failures stay visible without accumulating. Confirm the object was accepted by running kubectl get cronjob and kubectl describe cronjob and checking that the concurrency policy shows Forbid and the next scheduled time is set.

  6. Run the job once manually

    Before waiting for the schedule, the platform engineer starts a one-off Job from the CronJob template, for example with kubectl create job --from=cronjob/<name>. This run shows whether the image, the Secret, the volume and the target endpoint all work together. Watch the pod with kubectl logs and kubectl get pods until it completes, and note the exit status. A failure at this stage usually points to a missing environment variable, a wrong endpoint in the generator file or a write permission problem on the volume. Fix the cause and rerun until the job completes cleanly.

  7. Verify the JSONL report and log

    The security engineer checks the persistent volume for the JSONL report that garak writes for every attempt and its evaluation, and for the garak.log file. Open the report and confirm that it contains attempt records for the probes in the configuration, and that the run finished rather than stopping partway. Record the report filename and the garak version in the run notes so the next scheduled run can be compared with this baseline. If the report is missing or incomplete, check garak.log for the error before changing the schedule. Only enable the recurring schedule once the baseline report is confirmed.

How to compare each run with the last

A scheduled scan only catches regressions if each run measures the same thing. Fix the probe selection, the generations count and the config file before the first baseline is recorded, and store them in version control next to the CronJob manifest. Keep the generations setting at the value you chose (garak defaults to 5 generations per prompt), and do not let a later edit to the config change it silently. If a model, prompt or guardrail change is under test, change only that one thing between runs so that any shift in a probe's failure rate has a single explanation.

Keep a stored baseline for each target and write a small comparison script that reads the JSONL report from each run. The report records every attempt and its evaluation, so the script can compute the failure rate per probe for the new run and the baseline, then flag any probe whose rate moved by more than a threshold your security team agrees in advance. Choose the threshold from your own repeated runs of an unchanged model, since the variation between identical runs is what tells you whether a movement is signal. Keep the script's output short, and link each flagged probe to the full report for review. garak's own report views are covered in the sibling group on reports and results, so this script should only do the comparison.

Record the garak version with every run, and re-baseline deliberately after an upgrade. Scores can shift when garak changes its probes, detectors or defaults, and a shift after an upgrade is not evidence that the target got worse. Pin the version in the scan image, write it into each report's metadata alongside the config hash and target identifier, and confirm the changes in the garak releases notes before accepting the new version. When you upgrade, run the old and new versions against the same unchanged target, store that pair as the new baseline, and record the decision with a named owner.

How a scheduled garak run moves from trigger to comparison

The run starts when the scheduler fires a CronJob, which pulls a pinned garak image and reads the endpoint configuration and API key from secret storage. garak then sends its requests to the target endpoint, which sits in a separate trust boundary, and writes the JSONL report and garak.log to a persistent volume. A comparison job reads the prior baseline from that volume and routes the result to the owning team. Check that the image tag, the secret scope and the baseline path are the same on every run.

Trust boundaries and hand-offs in one scheduled garak run.

Security risks of recurring scans and how to contain them

A recurring garak job touches sensitive material on every run: harmful prompts and outputs, credentials for the model under test, and a cluster that must keep running unattended. The cards below cover the risks that appear once scans run on a schedule and the controls that keep them contained.

Retain reports and logs deliberately

Every run writes a JSONL report of attempts and evaluations, plus a garak.log that continues across runs. Those files hold harmful prompts and the model's responses to them, so a daily schedule quietly builds a large archive of sensitive output. Set a retention rule before the first CronJob runs, decide who may read the report volume, and confirm that the volume is encrypted and excluded from general log shipping.

garak README

Store API keys as Secrets

A CronJob spec that carries an API key in plain environment values exposes that key to anyone who can read the manifest. Kubernetes stores Secrets unencrypted in etcd by default, so configure encryption at rest, restrict list and watch access with least-privilege RBAC, and mount the key into the scan pod only. Where the key rotates often, consider an external store through the Secrets Store CSI Driver.

Kubernetes Secrets practices

Apply Pod Security Standards to scan jobs

A scan pod runs third-party Python code against endpoints you do not control, so it should not run as root, mount host paths or hold extra capabilities. Apply the Pod Security Standards at the namespace that hosts the CronJob, use a restricted profile where the garak image allows it, and give the job a read-only root filesystem with a writable volume only for the report directory. Confirm these settings in a dry run before the schedule is enabled.

Pod Security Standards

Agree schedules with the target owner

Scheduled probes arrive at the target endpoint as regular, high-volume traffic. Without notice, the owner's rate limiting, fraud detection or abuse monitoring may treat the scan as an attack and block the scan host or the account it uses. Agree the schedule, source addresses, expected request volume and a contact for stopping runs in writing with whoever operates the endpoint, and add a kill switch that suspends the CronJob.

Monitor job status to catch silent failures

A CronJob that fails on an expired key, a changed endpoint or a full disk may stop producing reports without any visible error, and the last green result then looks current. Alert on failed and missed job runs, and alert when no new report appears within the expected window. A regression gate that reads a stale report can pass a model that was never tested, so check that each run's report is fresh before comparing it.

Questions buyers ask about scheduled garak scans

What does a scheduled garak regression scan service cost, and what drives the effort?

The cost is driven by how much scope the schedule covers: the number of model or application targets, the size of the probe set, how comparison between runs is designed, how much cluster access and change control the work needs, and how many approvals sit between the scanner and each endpoint owner. A quote follows from a written scope that lists these items. Some costs are one-time, such as building the CronJob, the comparison logic and the runbook. Others recur, such as compute for each run, endpoint tokens or GPU time, and periodic review of results. Ask any quote to separate those two groups and to state what happens when a new target or probe family is added.

How long does it take to set up recurring garak scans?

Duration depends on what has to be agreed and built before the first scheduled run is trustworthy. The main factors are how many targets are in scope, whether the cluster and namespace already exist, how quickly endpoint owners approve the request rate, whether secrets and storage are ready, and how many baseline runs are needed before results can be compared. Teams that already run Kubernetes workloads usually spend the most time on access, approvals and retention decisions rather than on writing the job itself. Ask for a timeline that is tied to named milestones and to the approvals each one needs.

What must our team provide before a scheduled garak scan can run?

Most of the dependencies sit outside the scanner. You need to provide:

  • Kubernetes access for a dedicated namespace, plus rights to create CronJobs, Secrets and persistent storage in it.
  • Written sign-off from each endpoint owner for the schedule, request volume and rate limits.
  • Credentials for each target, stored in a secrets system you control rather than in the job spec.
  • A storage location for JSONL reports and garak.log files, with a retention policy that covers reports containing harmful prompts and outputs.
  • A named owner who receives alerts and decides what a regression means.

Confirm each item with your security and platform teams before work starts.

Can an internal team run scheduled garak scans without outside help?

Yes, an internal team can do this if it has people who cover four skills: Kubernetes operations (CronJobs, RBAC, Secrets, storage), Python packaging so garak can be installed in a pinned image, familiarity with garak's report format and configuration, and enough security context to design safe handling for harmful outputs. The hardest part is usually not the job definition but the ongoing judgment: deciding when a score change is a regression and when it is a probe update. A partner can supply that review work or build the pipeline for your team to operate. Ask which of these skills your team already has before choosing a model.

Is garak free to use, and what recurring costs remain?

garak is licensed under the Apache 2.0 license and is described by its maintainers as a free tool, so there is no license fee for running it. The recurring costs come from the environment around it. Compute is needed for each scheduled run, whether that is a CPU node for a hosted endpoint or a GPU node for a local model. Hosted endpoints charge for tokens on every request, so the number of probes and generations per scan sets the bill. Storage and log retention also recur. Ask any quote to estimate these costs from your own probe set and schedule, and to show which figures come from your provider's published pricing.

How do we upgrade garak without losing comparability between scans?

Pin the garak version in the job image, record the version in every report, and run the new release against the current target before changing the schedule. Score shifts after an upgrade can come from changed probes, detectors or defaults rather than from the model, so keep a baseline run on both versions and compare them side by side. Keep the old and new reports in separate series so trend lines are not mixed. The garak releases page lists each version, for example v0.17.1, released on 16 October 2026, and its release notes are the first place to check for changes that affect comparison.

What happens when the endpoint owner rate-limits or blocks scheduled scans?

Treat the endpoint owner's limits as an input to the schedule, not as a failure to work around. Agree the request rate, the run window and the number of generations before the first run, and record them in the runbook. If runs start failing with rate-limit or timeout responses, the comparison may be invalid because some attempts were dropped. Mark those runs as incomplete rather than as passing, and alert the owner. Confirm with the endpoint owner how they log scanner traffic so both teams see the same picture.

How DeployOpen plans and supports scheduled garak scans

DeployOpen scopes scheduled garak work in writing before any build starts. The written scope names the target endpoints, the probe set and generator configuration for each scheduled run, the namespace and cluster where the CronJob will run, the secret sources for model and API credentials, the location of JSONL reports and garak.log, and the comparison rule that decides when a run counts as a regression. Deliverables and acceptance checks are agreed alongside that scope, so the client's platform, security and model owners know what they are approving. Timelines and fees follow from that written scope, and DeployOpen does not publish a price list, so the quote is the place to confirm what is included.

Delivery happens inside the client's own infrastructure. DeployOpen builds the Kubernetes CronJob manifests, the image or install step that pins a garak version, the script that compares each run with the previous baseline, and a runbook covering failed runs, rate-limited endpoints, rerun procedure and how to update the baseline after an intentional change. Reports contain harmful prompts and outputs, so the scope should also settle who can read them and how long they are kept. Ask the vendor for a clear ownership split: which items the client keeps, and which DeployOpen hands over for their own team to maintain.

Retainers cover the ongoing work that a one-time build does not. Each garak release can change probe behavior and scores, and Kubernetes versions move on a published support cycle, so the schedule needs upgrades, baseline reviews and continuous testing over time. These are offered as retainers with scope agreed in writing. DeployOpen runs security testing and prepares evidence for compliance reviews, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies provide those, so the scheduled scan output should be presented as supporting evidence, not as a certification.

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.