garak config files and site configuration

garak reads run settings from config files, a site-wide configuration and command-line flags, so one organization can keep scans consistent. This page explains how the layers combine and how to version them so a scan can be rerun exactly.

On this page

Why garak config files matter for repeatable scans in your organization

When several teams run garak ad hoc, each with its own command line, probe list and generator settings, the results cannot be compared over time. One team scans a chat endpoint with a narrow probe set, another scans the same model with different flags, and a third changes the generator name between runs. Each report may be accurate for its own run, yet none of them shows whether the organization's posture has moved. A config file turns a scan into a repeatable definition that anyone on the team can rerun, review and change through version control. garak is a free, command-line tool licensed under Apache 2.0 and developed in the NVIDIA GitHub organization. It installs from PyPI with pip and requires Python 3.11 or newer, so a shared standard can be set up on any host that meets those requirements.

Teams usually need this when a scan has to serve more than one purpose. Shared scan standards require every application team to run the same baseline. Audit evidence requires that an assessor can see which settings produced a given report. Scheduled rescans require that a job run next month with the same settings as this month, so any change in results can be attributed to the model or application rather than to a flag someone remembered to drop. Before you adopt this approach, confirm which settings your team must fix (for example, the generator, the probe selection and the output locations) and which may vary per application. Ask who owns the file, how changes are approved, and where the file lives so that the reports it produces can be traced back to a specific version.

The configuration does not change what garak tests. It sets how consistently the same tests are selected and run. A config file records choices, but the probes, detectors and generators it names are still the ones shipped in the installed garak version, so the version itself belongs in the record. Pin the garak release you used, since the project publishes its changes on its NVIDIA/garak releases page, and check the garak user guide when you need the exact keys your version accepts. If a rerun differs from an earlier one, the config file narrows the search to the model, the endpoint, the installed garak version or the environment, which is the point of keeping it under control.

Configuration options and when each fits

This table compares the four places garak settings can live: run config files, the site configuration, command-line flags and the REST generator's endpoint file. Read each row for what it is for, who edits it and whether it should be fixed in version control or overridden per run. The main takeaway is that anything a rerun depends on belongs in a version-controlled file, with flags kept for one-off changes.

Configuration sourceWhat it is forWho edits itTrade-off and when to choose it
Run config file (YAML or JSON)Fixes the settings for one scan, such as generators, probes and run optionsSecurity or ML engineers running the scanBest for repeatable scans. Commit it to version control so a rerun uses the same values. Check docs.garak.ai for exact keys.
Site configurationSets organization-wide defaults that apply to every run on a host or teamPlatform or security team owning the scanning hostKeeps shared defaults in one place, but a change affects all runs that inherit it. Record its contents alongside scan reports.
Command-line flagsOverrides a single value for one invocationAnyone running garak interactivelyFast for experiments. Flags are easy to forget, so a rerun without them can produce a different scan. Avoid them for recurring scans.
REST generator endpoint fileDescribes a short YAML endpoint so garak can call a REST API that returns plaintext or JSONEngineers who own the application's APISeparate from the run config. Keep it in version control with the run config and confirm the endpoint keys in the user guide.
Priority order across sourcesDecides which value wins when the same setting appears in more than one placeEveryone who writes a configConfirm the five-level order at docs.garak.ai before relying on it. Verify the effective values in the run log and report.

How garak resolves the five-level priority order

garak takes its settings from several places, and when the same key appears in more than one of them, a single value wins. The order runs from the lowest layer, which is the built-in defaults shipped with the package, up to the highest, which is the command-line flags passed to the run. Between those two ends sit the site configuration, the run configuration, and one further layer that sits above the run config and below the flags, which you should confirm in the documentation for your version. Reading the layers from the bottom up tells you what a scan would use if nothing else were set.

  • Built-in defaults: values compiled into garak, such as the default generations per prompt, which the README gives as 5.
  • Site configuration: organization-wide defaults, such as a standard generator or report location, applied to every run on the host.
  • Run configuration: the YAML or JSON file that describes one scan, kept in version control with the scan record.
  • Higher-precedence layer: the additional layer between the run config and the flags, which you should identify in your version's docs.
  • Command-line flags: values typed at invocation, which win over every file.

Before relying on any layer, check the exact order for the release you pin, because precedence can change between releases.

Setting up a versioned site config and run configs

This sequence takes garak from a pinned Python environment to a run config and a site config kept in version control. The result is a baseline JSONL report and a set of files that another person can rerun and compare against.

  1. Create a pinned Python environment

    Create a virtual environment on Python 3.11 or newer, since the PyPI package requires that version, then install garak with pip. Pin the exact garak version you tested in a requirements file so every host runs the same build. Check the installed version and the interpreter version against the pin. Done when a fresh environment reports the pinned garak version on Python 3.11 or newer. Your platform team owns this step, and it repeats whenever you choose to upgrade. Package details are on garak on PyPI.

  2. Run a small test scan

    Run a short scan against the generator you plan to test, using a small probe selection and default settings so the run finishes quickly. Pass credentials through environment variables and keep them out of any file you will commit. Watch the console for the generator name and for attempts with pass or fail results. Done when the run writes a JSONL report to its output location and the console shows no generator connection errors. Keep this output as the first record for later comparison.

  3. Write a run config for one target

    Create a YAML or JSON run config that names one generator, the probes or spec to run, and the generations per prompt. Set the generations value explicitly even though the default is 5, so reviewers can see it. For a REST endpoint, reference a short YAML file that describes the endpoint. Keep the config to one target so a diff shows exactly what changed. Done when garak loads the file without errors and the effective settings printed at startup match the values you wrote.

  4. Move organization defaults into the site config

    Move settings that every run should share, such as log location, report directory and common generator options, into a site config file. Keep target-specific values in the run config so the two layers stay separate. Confirm the exact file name and the location garak searches in the garak user guide before you rely on it. Done when removing a shared setting from the run config still produces the same effective value from the site config. Your security or platform owner should approve changes to this file.

  5. Check effective settings and priority order

    Work through the five-level priority order in the user guide and test one override at each level in a throwaway run. For each override, read the effective settings garak reports at startup and confirm which value won. Record the order in the repository README so reviewers know which layer takes precedence. Done when every override behaves as the documented order predicts. If a value differs from what a file says, treat it as a defect in your config and resolve it before any scan that matters.

  6. Confirm garak.log continues across runs

    Run the same config twice and open garak.log after each run. The file continues across runs, so the second run should append to the entries from the first. Check that each run also writes its own JSONL report with a distinct name. Done when both runs appear in order in the log and each has a separate report. Store the log with your run artifacts, since it is the debugging record for those scans.

  7. Verify a rerun produces a comparable report

    Rerun the unchanged config and compare the new JSONL report with the baseline. Probe names, detector names and attempt counts should match, and pass or fail results should fall close together, since generations are stochastic. Where the target supports it, fix the seed and system prompt in the config, and record the garak and generator versions with each report. Done when the rerun has the same structure and any differences fall within the variation you expect. Any larger change should trace to a change you made on purpose.

  8. Commit both files to version control

    Commit the run config, the site config, the pinned requirements and any endpoint file to the repository. Exclude credentials, logs and reports, and keep those in your artifact store. Tag the commit that produced the baseline report so a future rescan can start from that exact state. Ask your security team to review the diff for secrets and internal hostnames before the first merge. Done when a clean checkout, installed at the pinned version, is ready to rerun the baseline scan.

Keeping configs in version control so scans rerun exactly

A garak config file records what was asked of the tool, but not everything that shaped the result. The garak version, the generator and model identifier, secrets, and the report itself all affect whether a rerun matches the original. The practices below treat these as one versioned record.

Pin the garak version

Record the exact garak release next to every config, for example v0.17.1, which the releases page dates to 16 October 2026. Probes, detectors and default settings can change between releases, so a rerun on a newer version can shift scores without any change to the config. Install from a pinned version in your environment, and confirm the version in the report header before comparing two runs. Note any upgrade in the same commit that changes the config.

garak releases

Record the generator and model identifier

The config names a generator, but the model behind that name can be updated by its provider or by your own deployment. Store the exact model identifier, endpoint URL, and any model version or revision your provider exposes. For local models, record the file name and checksum. Ask the endpoint owner which identifiers they can confirm for the period of each scan.

Separate secrets from config files

API keys and tokens should not sit in a YAML or JSON config that is committed to a repository. Reference them through environment variables or your secrets manager, and record only the variable name in the config. Check the repository history before publishing, since a key committed once remains in old commits. Rotate any key that was ever stored in a config file.

Tag config changes with the scan report

Each scan report should point back to the commit or tag of the config that produced it. Use a git tag or a recorded commit hash for every run you intend to compare later. A report without this link can show a change in results that you cannot trace to a change in setup. Make tagging part of the scan script rather than a manual step.

Review config changes like code

Changes to probe selection, generation counts, system prompts, or detector thresholds alter what a scan measures, so they warrant the same review as application code. Require a second reviewer to confirm that a change is intentional and that the comparison baseline is still valid. Flag changes that would make a new run incomparable with earlier results, and note them in the pull request.

Store the report with the config hash

Keep each JSONL report alongside a hash of the exact config file and the commit it came from, in the same storage location. The garak.log file continues across runs, so archive it per scan instead of relying on the shared copy. An exact rerun depends on all of these items together: the config alone does not fix the garak version, model, secrets or environment that produced a result.

How configuration layers combine into one scan

The diagram starts at built-in defaults and the site config, then adds the run config file and command-line flags, each layer overriding the one before it. The combined effective settings drive the generator, the probes and the output. Check that the committed files inside the version control boundary hold everything the scan needs, because flags typed at the shell are not recorded unless you copy them into a config file. Inspect the resolved settings before a rerun so you know which layer set each value.

Configuration layers merge into effective settings that drive one scan and its outputs.

Questions teams ask before standardizing garak configs

How much does it cost to set up garak configs?

garak is a free tool. The maintainers describe it as free, and it is licensed under Apache 2.0, so the cost of standardizing configs is mainly staff time: someone to write the YAML or JSON run configs, review them, test them against a target and keep them current. Those hours recur whenever a new target, environment or probe set is added. If you use a partner, the quote follows from the written scope, so ask for each item to be listed separately: target setup, config design, review, documentation and any upgrade work. DeployOpen does not publish a price list. Ask any provider which parts are one-time and which are ongoing.

How long does it take to standardize garak configs?

The duration depends on the number of targets, the number of environments and how your review process works. A single model endpoint with one site config and one run config is a small job. Each additional target adds its own endpoint settings, credentials handling and test runs. Each additional environment, such as development, staging and a production-like system, adds its own overrides and checks. A formal review step, with sign-off from security and the application owner, adds calendar time even when the technical work is short. Agree the number of targets and environments first, because those two numbers shape most of the plan.

What does our team need to provide for a garak config project?

Prepare four inputs before work starts:

  • Target endpoints, with the protocol and any gateway or authentication layer each one sits behind.
  • Credentials for each target, stored in a secrets manager your organization controls, never inside a config file committed to version control.
  • The production system prompt, so that run.system_prompt matches what users actually receive.
  • A named owner who approves config changes and decides which probes and detectors apply to each target.

If any of these are missing, the configs will test something other than your production system. Confirm each item with the application team before the first run.

Can our own engineers standardize garak configs without a partner?

Yes, a capable internal team can do this, provided it has time and a test target. Start with the garak user guide at docs.garak.ai, which covers the configuration options, then build and validate configs against a test target you control before pointing them at production. Use the JSONL report and the garak.log file from each run to confirm that the config did what you intended. Internal teams usually struggle with the review and ownership side more than the syntax, so assign someone to approve changes and keep a record of why each setting was chosen. A partner becomes useful when the target count is high, the deadline is fixed or the team lacks Python and CI experience.

How do garak configs stay in step with garak upgrades?

Treat the garak version as part of the config. Record the installed version alongside each run, and pin it in your environment rather than installing the latest release on every run. Current garak releases are listed on the NVIDIA/garak releases page, and the PyPI package requires Python 3.11 or newer, so check that requirement before upgrading a runner. When you move to a new release, rerun a fixed test target against the old and new versions, then compare the outputs before changing production configs. Keep a changelog entry for every upgrade so that score shifts can be traced to a version change rather than a target change.

Why keep garak configs in version control?

Version control lets you rerun a scan exactly, which matters when you compare results over time or answer an auditor's question about a past run. Store each run config, site config and the system prompt file in a repository, with changes made through reviewed merge requests. Record the garak version, the config commit and the target version in each report. Keep secrets out of the repository and reference them by name instead. Without this history, a difference between two scans could come from a config edit, a model update or a version change, and you would have no way to tell which.

What goes wrong when garak configs are not standardized?

The most common failure is two teams running the same target with different settings and reporting different results. Other frequent problems include a system prompt that differs from production, credentials pasted into a config file, a probe list that silently changed between runs and reports that cannot be traced to a config. Each problem makes results hard to compare and hard to defend. A shared site config, a short review checklist and a rule that every run stores its config with its report prevent most of these issues. Confirm the checklist with your security and compliance leads before rollout.

Where DeployOpen fits when teams want configs built and reviewed

DeployOpen can take over the build and review of your garak configuration if your team would rather not design the run configs, site configuration and version control layout alone. DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks, and it runs security testing, including AI and agent security review. For garak, that means the work sits next to the systems the scans will test, rather than in a separate tool stack that someone has to reconcile later.

A config and site setup is scoped in writing as a fixed-scope engagement. Before work starts, the written scope should name the files to be produced, such as the run configs for each target, the site configuration holding organization defaults, the priority order you intend to rely on, and the repository layout that keeps them under version control. It should also name the review step, the documentation handed over, and what your team must provide, such as access to the target endpoints, the production system prompt, and the list of model versions in scope. Ask for the deliverables and acceptance criteria in that document so both sides can test the result against it. DeployOpen does not publish a price list, so the quote follows from the written scope and you should ask for each deliverable to be priced separately so you can see what the scope includes.

How DeployOpen scopes, delivers and supports garak configuration

DeployOpen treats garak run configs and the organization's site configuration as deployable assets, scoped in writing, built into version control and handed over with a runbook your team can follow. Engagements are fixed-scope, and the written scope sets what gets configured, tested and documented.

How we scope

  • Inventory which garak targets, generators and endpoints the organization needs configured, and who will run them.
  • Agree in writing which probe selections, generation counts and defaults belong in the site config versus per-run files.
  • Confirm the garak version to pin and the Python 3.11 or newer environment each runner will use before work starts.
  • Record which configuration outputs and report locations the written scope covers, so acceptance is clear.

How we build

  • Write run configs in YAML or JSON for each agreed scan, with endpoint details kept separate from secrets.
  • Build the organization-wide site configuration and document the five-level priority order so overrides are predictable.
  • Keep every config in a Git repository with reviewed changes, tagged to the garak version it was tested against.
  • Test each config with a rerun on a non-production target to confirm the JSONL report and garak.log behave as expected.

How we hand over

  • Deliver the config repository, site config and a short runbook explaining how to rerun a scan exactly.
  • Document each config's purpose, its target, and the settings a reviewer should check before changing them.
  • Walk your engineers through the priority order and the process for proposing a configuration change.
  • Provide written records of what was tested, on which garak version and against which endpoint.

How we support

  • Ongoing support is available as a retainer for upgrades, config review and reruns after garak releases.
  • Retainers can cover updating configs when a new garak version changes defaults, after confirming the release notes.
  • Continuous testing can be added so scheduled scans keep running from the same reviewed configuration.
  • Confirm response expectations and the support scope with DeployOpen in the written quote, since these are not published.

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.