garak on Docker vs Kubernetes vs VMs

garak is a batch command-line scanner, so the host choice mostly sets scheduling, secrets, network reach and report storage. A VM or a single container host covers most teams, and Kubernetes suits teams that already run a cluster and a job scheduler.

On this page

Which garak deployment fits your team: VM, Docker or Kubernetes

garak runs as a batch job, so the host mainly determines scheduling, secret handling, network reach and where reports are stored. For most teams, a virtual machine or a single container host with a cron job or systemd timer covers those decisions without extra moving parts. The install path is pip from PyPI on Python 3.11 or newer, so a VM with a supported interpreter in a virtualenv is the shortest route. Confirm with the garak user guide whether an official container image or Helm chart exists before you plan around either. If none is published, a container you build from the pip install becomes an artifact you must version, patch and rebuild yourself.

Kubernetes earns its extra operating work when the scan is one workload among many on a cluster your platform team already runs, with admission control, secret management and log shipping in place. A CronJob provides scheduled runs, a Secret or external secret store supplies the generator API keys, a NetworkPolicy limits egress to approved model endpoints, and a persistent volume or object storage bucket keeps the JSONL report and garak.log after the pod exits. The cost is ongoing: someone owns the image build, cluster upgrades, RBAC for the scan namespace and the retention of garak.log across restarts. If you have no cluster today, building one for a single scanner adds more work than the scanner itself. Ask your platform team whether it can provide a dedicated namespace, egress rules and a storage class before you commit to this path.

Whichever host you choose, check four things before the first scheduled run. Keep target credentials in the host's secret store or the cluster's secret mechanism, not in command-line arguments, which can appear in process listings and shell history. Confirm the host can reach each generator endpoint and nothing else. Move the JSONL report and garak.log to storage that someone reviews and retains under your policy, because each run records every attempt, not only the failures. Finally, the default of 10 generations per prompt means run time and model spend grow with the probe set and generator, so measure one pilot run on the chosen host before you size it. A single VM is enough for most teams running scheduled scans; move to Kubernetes when the cluster and its controls already exist.

How a VM or Docker host compares with a Kubernetes cluster for garak

This table compares running garak on one virtual machine or single Docker host against running it on a Kubernetes cluster. Read each row as the trade-off for that factor, and check the condition in the cell before choosing. The main takeaway: a single host is the simpler place to start, and a cluster pays off when a platform team already operates one and needs shared scheduling and controlled rollout.

FactorVM or single Docker hostKubernetes cluster
Install pathInstall garak with pip into Python 3.11 or newer, or into a container you build. Quickest path for a one-off run.Package garak in a container image and run it as a job. Suits teams that already build and patch images for a cluster.
SchedulingRun scans from cron or a systemd timer on the host. Adequate when one team runs scans on a fixed schedule.Start scans with CronJobs or a workflow tool. Better when several teams or many targets share one platform.
Secret handlingTarget API keys sit in environment files or a host vault. Restrict file permissions and confirm who can log in to the host.Inject keys from the cluster secret store. Confirm encryption at rest and role-based access to secrets with your platform team.
Report and garak.log storageEach run writes a JSONL report and appends to garak.log on host disk. Copy both off the host on a schedule.Pod storage is lost when the pod is deleted, so mount persistent volumes or copy reports and garak.log out.
Failure recoveryA failed host stops scans until someone rebuilds it. Recovery depends on your rebuild steps and on saved reports.Failed jobs can be retried or rescheduled automatically. Confirm whether a retried run resumes or starts over.
Upgrade controlYou pin the garak version and upgrade when you choose. Test on a copy of the host before changing the live one.You pin an image tag and roll it out through the deployment process. Gives controlled rollout, but the cluster upgrade path also needs planning.
BackupBack up the report directory, config files and host disk image. Restore means rebuilding the environment and copying files back.Back up the report volume, manifests and secret definitions. Confirm the restore path for both cluster state and scan output.
Skills neededLinux administration and Python packaging. Fits a security engineer who can run and patch one host.Cluster operations, image management and access control. Choose this only if the platform team already runs the cluster.

How each host runs garak's probes, generators and reports

Every option runs the same garak components: probes that generate attacks, detectors that judge responses, a harness that drives them, and generators that call the target. What changes is who owns the host, where reports persist, and how egress is enforced. Read each card with the target's location in mind, because that location decides which network rules you must set.

Pip-installed garak on a VM

Install garak from PyPI into a virtualenv on the Python version it requires, then schedule runs with cron or a systemd timer. The probes, detectors, harness and generator code all execute on this host, while the target model stays wherever it is hosted. Each run writes a JSONL report and appends to garak.log, so choose a directory that is backed up and restricted to the service account. Allow egress only to the package index and the generator endpoints you approved, since a VM with open outbound access can reach far more than the target.

Minimum Python version
3.11
garak on PyPI

Container on a single host

A container packages garak, its dependencies and a pinned version, so the same run works on any host with a container runtime. Check the user guide first to see whether an official image is published. If none is, your team builds and tags its own image, and that build belongs in your change control. Mount a host volume for the reports and garak.log, pass API keys from a secrets tool at runtime, and keep them out of image layers. Egress rules still apply: the container may reach only the generator targets you list.

garak user guide

Job or CronJob on a cluster

A Kubernetes Job runs one scan to completion, and a CronJob runs it on a schedule, with probes, detectors, the harness and the generator all running inside the pod. Mount API keys from the cluster secret store so they stay out of manifests. Attach a persistent volume claim so JSONL reports and garak.log survive pod restarts. Set a NetworkPolicy that permits egress only to approved generator endpoints and package sources, because a flat cluster network lets a scan pod reach far more than its target. Confirm how your concurrency policy handles a scan that overruns its schedule.

CI runner on each release

A pipeline job installs garak and runs probes each time a release candidate is built, so a model or prompt change is tested before it ships. The runner, probes, detectors and generator all execute on the runner, and the target is usually a staging endpoint outside it. Store target credentials in the CI secret store. Treat the job's artifact store as a report location with its own retention and access rules, and confirm that reports outlive an ephemeral runner. Shared runners need per-project egress allowlists so one pipeline cannot reach another project's targets.

garak releases

Where a garak run starts, what it reaches and where its reports land

The path starts with a scheduler (cron, a CI job or a Kubernetes CronJob) that starts garak on a host you operate, whether that is a Docker container, a Kubernetes pod or a VM. garak loads its probes, detectors and generator configuration, then sends prompts only to targets on your approved list: a hosted API, a local llama.cpp model or an internal REST endpoint. The API key comes from a secret store, so it stays out of the configuration file. Detector verdicts are written as a JSONL report and a garak.log on persistent storage, and the team then copies the reports to a restricted report store. Check that your egress rules, secret injection and volume mounts match your own environment, since this diagram is illustrative.

Illustrative: scheduler, garak, approved targets and report storage in your environment.

What a garak host needs before any option works

Every deployment option starts from the same host baseline. garak is a command-line tool installed from PyPI with pip, and the package requires Python 3.11 or newer. Check the interpreter that will actually run the scanner, including the one inside a container image or the one in a VM template, before anyone compares deployment models. The maintainers develop garak on Linux and macOS, so those are the platforms with the fewest surprises. If your standard build is Windows, uses a non-standard base image, or runs on an architecture you have not tested, confirm support in the garak user guide and run a test scan before you commit. Record the exact Python and garak versions in your build notes, because the release history moves (v0.17.1 was published on 16 October 2026).

Next, map the outbound paths. garak sends prompts from the host to whichever generator you configure, such as Hugging Face, OpenAI, AWS Bedrock, Replicate, LiteLLM, a local llama.cpp model, or a REST endpoint described in a short YAML file. The host, container or VM network segment needs outbound access to each chosen target, and an internal endpoint must be reachable from wherever the scanner runs. Hosted APIs also need credentials, so store keys in the secrets store your platform team already operates and keep them out of shell history, scripts and image layers. Ask the security team whether egress to third-party model APIs is permitted from the scanner's segment, who owns each API key, and whether the provider's terms allow sending attack prompts through that key.

Plan disk and run time from your probe selection, not from a generic default. Each run writes a JSONL report of every attempt and its evaluation, and garak.log is continued across runs, so the log accumulates with use. Decide where reports and logs are written, how long they are retained, and who may read them, since attack prompts and model outputs can contain sensitive test data. Run time and target API usage grow with the probe list because garak makes 10 generations per prompt by default. Multiply the prompts in the probes you choose by that generation count, then compare the result with the rate limits your target enforces. Take the inputs from your own configuration and from the provider's documented quotas, and confirm both before you size the host.

Which team should pick which garak host

A platform team that already runs a cluster and a CI system can schedule garak next to the models it tests. A Kubernetes CronJob or a CI job fits when the cluster enforces egress control and secret management, because garak needs a network path to the target and credentials to reach it. Avoid giving the job broad cluster permissions just to make it run.

  • Egress control: Limit outbound traffic from the job's namespace to the target endpoint and your package source, so the scanner cannot reach other destinations.
  • Secret management: Load the target API key or REST token from your secret store at run time, not from a values file or image layer.
  • Pinned image: Build a container image with a fixed garak version, for example v0.17.1, and rebuild it only when you choose to upgrade.
  • Artifacts: Keep the JSONL report and garak.log as CI artifacts so reviewers can trace each finding to a specific run.
  • Scheduling scope: Use a CronJob for periodic checks and a CI job for pre-release gates, and agree on rate limits before both hit the same endpoint.

Confirm with your cluster team that the job's egress and secret paths meet your policy before you schedule the first run.

Upgrades, backups and monitoring for each garak host

This table compares what someone must do by hand on a VM or Docker host and what a Kubernetes cluster takes over for upgrades, backups, monitoring, reruns and staffing. Read each row as a list of duties that stay with your team on either option. The main takeaway is that garak writes files, so report and log handling matters on every option, and Kubernetes adds operating skills rather than removing them.

FactorOption A: VM or Docker hostOption B: Kubernetes
UpgradesPin a version such as v0.17.1 (released 16 October 2026) in a requirements file. Rerun a fixed probe set and compare reports before moving.Change the pinned image tag, such as v0.17.1, and promote only after the fixed probe set passes in a test namespace.
BackupsCopy JSONL reports, garak.log, config files and secret references to backup storage after each run. Test a restore onto a clean host.Export reports and garak.log from the job volume to object storage, and back up manifests and secret references. Test restores in a new namespace.
MonitoringCheck cron or systemd exit status, run completion, free disk, and failed attempts counted in each JSONL report. Alerting is your job.Alert on Job failure, backoff limit, run completion, volume usage, and failed attempts counted in each report. Metrics and alerts come from your cluster stack.
High availabilityA host failure means rerunning the scan on another host, not failing over. Retry and scheduling matter more than uptime.Kubernetes reschedules a failed Job pod, which reruns the scan. Set retry limits and confirm whether garak resumes partial output on rerun.
Skills to keep on handLinux administration, Python packaging and virtual environments (garak needs Python 3.11 or newer), plus cron or systemd.Kubernetes operations: Jobs, CronJobs, secrets, volumes and RBAC, plus container image builds and Python packaging.

What does it cost and take to run garak on our own hosts?

Does garak have a license cost to run on our own hosts?

garak itself carries no license fee. It is Apache-2.0 licensed, and its maintainers describe it as a free tool. The costs you pay fall into four buckets: staff time to install, configure and maintain it, host time for the machine or cluster that runs scans, usage charges from any hosted model you test, and partner fees for any work you buy. Target usage is the one that scales with activity. By default garak makes 10 generations per prompt, so each probe run multiplies into many calls against a hosted endpoint. Setup and endpoint configuration are one-time costs. Scan runs, upgrades and retesting after a target changes recur. Ask your model provider for current pricing on the models you plan to test.

What drives the effort of running garak on our own hosts?

Five drivers set most of the effort: where garak runs, how many targets it covers, how secrets are handled, how long reports are kept, and how upgrades are tested. Host choice matters because a single VM, a container host and a Kubernetes cluster each bring different patching, access and monitoring work. Target count multiplies run time and API usage, and each endpoint needs its own generator configuration, which for REST targets is a short YAML file. Secret handling covers the API keys for hosted models, which should live in your secrets manager and stay out of shell history and config files. Report retention matters because each run writes a JSONL report of every attempt, and garak.log carries across runs, so someone must decide who reads them and how long they stay. Upgrade testing matters because a new garak release can change results, so run a known target before trusting new output on production endpoints. Confirm each of these choices before scope is fixed.

Can an internal team run garak without an implementation partner?

Yes, a capable internal team can run garak without a partner. It is a command-line tool installed from PyPI, and the PyPI package requires Python 3.11 or newer. The harder part is ownership. Someone must maintain the host, rotate credentials, schedule runs, review JSONL reports and decide what counts as a failure for your use case. Teams typically need engineers who can read probe output and configure a REST generator for their own endpoints. A partner makes sense when the internal team lacks the time or skills, when several environments need the same setup, or when an outside party should document the controls for a compliance review. Confirm your team's capacity for the recurring work before deciding.

How long does garak setup take, and what should I ask for in writing?

No duration is fixed here, because the answer depends on the host, the number of targets and how quickly access approvals arrive. Ask for a timeline in writing, tied to an agreed scope. Most of the time typically goes to host provisioning, network access to each target, secret handling, a baseline run, the report workflow and the upgrade test. DeployOpen's engagements are fixed-scope, and scope, deliverables and timelines are agreed in writing before work starts, so ask any provider to date each milestone and name who owns each dependency. Check the garak user guide for the install steps your team will need to verify against your environment.

Is Kubernetes worth adopting for garak alone?

Usually not for garak alone. garak is a command-line scanner that runs when you start it, and Kubernetes adds control plane upkeep, cluster upgrades, access policy, image management and network policy work that a single host does not need. Kubernetes starts to pay off when the cluster already runs other workloads that garak can share, when you need scheduled scans managed by platform tooling, or when your platform team already operates the cluster well. Before you design a container workflow, confirm in the maintainers' current documentation whether an official container image is published and what it expects. Ask any partner to cost the Kubernetes option separately so the comparison uses your own numbers.

What does a partner quote for garak depend on?

A quote follows from the written scope, so it depends on what the work covers. The main inputs are scope (which garak runs, which probes and what the engagement includes), targets (how many, and whether they are hosted APIs, REST endpoints or local models), environments (Docker, Kubernetes or VMs, how many of each, and whether any network is air-gapped), deliverables (runbooks, reports and documentation) and retesting after fixes or upgrades. Also confirm whether ongoing support is a retainer or a one-off engagement. DeployOpen does not publish a price list. Ask each bidder to state assumptions, exclusions and who pays for target API usage, so the quotes are comparable.

How to keep garak upgrades and reports traceable

Pin garak to one version in every deployment model before the first scan, and keep that pin in the artifact that actually runs. On Docker, that is the image tag or digest built from a Dockerfile that installs garak==0.17.1 from PyPI on Python 3.11 or newer. On Kubernetes, it is the image reference in the Job or CronJob manifest, so a cluster never picks up a newer build by accident. On a virtual machine, it is the version listed in the requirements.txt used to build the virtualenv. Whichever model you choose, the pin must live in version control, and a change to it should require a reviewed commit. Confirm with your platform team how base images are rebuilt, because a rebuilt image under an unchanged tag can still install different packages.

Read the release notes on the garak releases page before you move a pin. Each entry shows whether probes, detectors or generators changed, and a changed detector can move a result from pass to FAIL without any change in the target model. Treat an upgrade as a new baseline: run the same probes against the same target on the new version before comparing results. Record the garak version beside every JSONL report, either in the file name, in a sidecar file written by the job, or in your evidence store, together with the probe list, generator configuration and target model identifier. Without that record, a later run that looks better or worse may simply reflect a different version or configuration.

The garak.log file continues across runs, so it grows with every scan and mixes entries from different versions and targets. Set rotation and retention rules before the first production run: the maximum file size, how many rotated copies you keep, how long reports and logs are retained, and who approves that period. On Kubernetes, container logs are not a retention plan on their own, so mount a persistent volume or ship the files to your log store. On Docker hosts and VMs, configure logrotate or an equivalent tool. Confirm the retention period with your compliance owner. Finally, treat these reports as evidence for your own team's review of a model or application. They do not, on their own, make a system compliant with any framework, and an assessor will still ask how each finding was triaged and fixed.

How DeployOpen scopes and runs a garak deployment

DeployOpen plans and implements self-hosted garak inside your own cloud accounts, data centers or air-gapped networks, so the Docker, Kubernetes or virtual machine choice is made against your environment. Each engagement starts from a written scope that fixes deliverables and timelines before work begins. Most engagements are fixed-scope, and ongoing support is available as a retainer.

How we scope

  • We confirm the target platform, whether Docker, Kubernetes or VMs, before any build starts.
  • We record which model endpoints garak will test, including Hugging Face, OpenAI, AWS Bedrock, llama.cpp or custom REST targets.
  • Scope, deliverables and timelines are agreed in writing before work starts, and ongoing support is available as a retainer.

How we build

  • We install garak from PyPI with pip on Python 3.11 or newer, in an environment your team can review.
  • We configure a generator per target, using a short YAML file for REST endpoints that return plaintext or JSON.
  • We set probe selection, generation count and detector settings in writing, since the default is 10 generations per prompt.

How we hand over

  • Each run produces a JSONL report of every attempt and its evaluation, plus a garak.log file that continues across runs.
  • We document the chosen platform, configs and run procedure so your team can rerun garak independently.
  • We walk the team through the hit log of attempts that found a vulnerability and how to read the JSONL report.

How we support

  • Upgrades for garak, which publishes releases such as v0.17.1, can be handled under a retainer.
  • Before each upgrade, we check the garak releases page and rerun the scan on the target platform.
  • Continuous testing on a schedule is available as a retainer; confirm the cadence and run host in the 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.