Running garak in an air-gapped network

garak can scan models from a host with no internet access, but only if its packages, Hugging Face artefacts and local detector and translation models are staged in advance. This page explains what to stage, where runs fail offline and what to confirm.

On this page

Running garak in an air-gapped network: what it takes

A regulated team that must test an LLM from a host with no internet route can run garak offline, provided its Python dependencies, model artefacts and any detector or translation models are staged in advance. This page covers that staging work, the decisions behind it and the checks that show a scan ran without reaching outside the boundary. garak, the Generative AI Red-teaming and Assessment Kit, is an Apache 2.0 licensed command-line tool that probes LLMs for weaknesses such as prompt injection, data leakage, jailbreaks and toxicity. It is built from plugins in five categories: probes, detectors, evaluators, generators and harnesses. It installs from PyPI with pip and requires Python 3.11 or newer, so the first offline question is which wheels and transitive packages the target host needs, and whether your mirror carries them.

Teams need an offline procedure when the model under test, the scan host or both sit inside a network with no internet route, which is common for regulated workloads that must keep prompts, outputs and model weights inside their boundary. The harder part is that garak does not always stay inside the target endpoint. Some detectors load Hugging Face classifier models, the system prompt extraction probe draws its prompts from Hugging Face datasets, and larger artefacts are kept out of the repository and loaded from Hugging Face Hub. A scan that works on a connected laptop can therefore fail on an isolated host at the first detector load. Confirm, for each probe and detector in your planned configuration, where it fetches its resources, then stage those files into an internal artefact store with checksums you record.

Before you start, decide who approves the transfer of packages and model files across the boundary and how you will verify their integrity, since that approval is the step auditors ask about. Ask your scan team to list every probe, detector and translation component in the planned run, and ask the endpoint owner to confirm the REST or local generator path stays inside the network. Plan for a dedicated scan host with a pinned garak version, so later reruns use the same code. Confirm with the garak maintainers in the garak user guide which resources a given release downloads at run time, because that behavior is the main source of failed offline scans.

How artefacts cross the isolation boundary

The flow starts on a staging host with internet access, where the garak wheel and its Python dependencies are downloaded, along with Hugging Face Hub artefacts such as detector classifiers and translation models. Everything is then packaged and moved across the boundary through a transfer step, where the integrity check on each file should be verified before anything is installed. The air-gapped scan host loads only the staged copies, reaches the target model endpoint on the internal network, and writes the JSONL report and garak.log locally. Confirm that no probe triggers a live download on the scan host.

Artefacts move one way, from staging through an integrity check to the scan host.

Which offline approach fits each artefact

This table compares each artefact a garak run may need offline, the option for staging it, and the main trade-off. Read each row against the probes and detectors you plan to run, because the artefacts a scan needs depend on that selection. The main takeaway is that the Hugging Face and dataset items need staging before the host is disconnected, and the model under test is usually the largest and most variable item.

ArtefactOffline optionPre-stage and trade-off
garak package from PyPIInstall from a local wheel mirror or an internal package indexStage garak and its dependencies on a connected staging host, then transfer them. Confirm the Python 3.11 or newer requirement on the target host. Version drift between staging and target is the main risk.
Hugging Face classifier models used by some detectorsDownload model files in advance and load them from a local pathPull the exact model revisions the detectors use and copy them across. Confirm the offline loading settings and cache paths in the garak user guide and reference. Pinning revisions keeps scores comparable over time.
System prompt extraction datasetPre-download the Hugging Face dataset the probe readsWithout it, the sysprompt extraction probe may fail at run time. Stage the dataset and confirm in the garak source which dataset path the probe expects. Dataset updates on the hub will not reach the isolated host.
Translation support modelsStage the translation model used for non-English probesNeeded only when you run multilingual probes. Stage only the languages you test to limit transfer size. Confirm the model names in the garak translation reference.
Local gguf model under test via llama.cppLoad the gguf file from local disk through llama.cppCopy the model file and the matching llama.cpp build. Model files are large, so plan transfer and storage. This option keeps the model entirely on the isolated host, but it limits throughput to that host's hardware.
Self-served model endpointRun an inference server inside the isolated network and point garak at itStage the serving software, model weights and dependencies together. The scan host stays offline, but the serving host needs its own hardware and monitoring. Confirm the endpoint's offline documentation settings.
REST target on the isolated networkConfigure the REST generator to reach an internal endpointNothing needs to be downloaded for the target itself, but the endpoint owner must agree to the scan and its request rate. Confirm that certificates and internal CAs are trusted by the scan host.

Staging garak for an isolated host

This sequence builds a complete garak install, its Python dependencies and the Hugging Face artefacts it needs on a connected staging host, moves them across the approved transfer process, and proves the scan host can run a small probe set end to end without internet access.

  1. Match the staging host to the scan host

    The engineer building the staging host starts from the same operating system family, CPU architecture and Python interpreter that the isolated scan host runs. garak requires Python 3.11 or newer, and the package is developed on Linux and macOS, so confirm the Python version on both machines before anything is downloaded. Record the OS version, Python version and pip version in the build log. The step is done when the scan host's values match the staging host's values and the interpreter reports 3.11 or newer.

  2. Build a wheelhouse of garak and its dependencies

    On the connected staging host, create a clean virtual environment and install the garak release you have approved, such as v0.17.1 released on 16 October 2026. Then download every wheel and source distribution into a single directory with pip download, so the scan host can install without contacting an index. Check the release notes on the NVIDIA/garak releases page before pinning the version, and keep the exact version string for later comparison. The step is done when the wheel directory contains the garak package and every transitive dependency listed by pip freeze.

  3. Fetch Hugging Face artefacts garak will load

    Some garak detectors load Hugging Face classifier models, and the system prompt extraction probe sources its system prompts from Hugging Face datasets. Identify every model and dataset used by the probes and detectors in your planned scan set, then download them to a local directory with the Hub tooling and set the cache location explicitly. Review the garak translation and probe documentation to confirm which artefacts a given probe needs at run time. The step is done when each named model and dataset exists in the staging directory with a recorded revision hash.

  4. Record checksums and approve the transfer manifest

    Generate SHA-256 checksums for every wheel, model file and dataset, then write a manifest that lists each file, its size, its source and its checksum. Have the security or compliance owner review the manifest against your software intake rules, since the NERC CIP-013-2 supply chain requirement expects verification of software integrity and authenticity before packages cross an isolated boundary. Ask the owner to confirm which signatures or attestations your organization requires for upstream packages. The step is done when the reviewer has signed the manifest and every checksum has been recorded.

  5. Transfer media through the approved process

    Move the signed archive, wheel directory and artefact directory to the isolated network using your approved media process, such as a controlled transfer station or a one-way data diode. Keep the manifest with the media and log who handled it and when. Confirm the transfer method with your security team, because allowed media types and scanning requirements differ between organizations. The step is done when the media has been received on the isolated side and the manifest accompanies it.

  6. Verify checksums and install into an isolated environment

    On the scan host, recompute the checksums of every transferred file and compare them with the signed manifest. Any mismatch stops the process and goes back to the reviewer. When all checksums match, create a dedicated virtual environment and install garak from the local wheel directory using the no-index option so pip cannot reach an external index. Place the Hugging Face artefacts in the directory that garak and the Hugging Face libraries will read, and set offline environment variables so loaders do not attempt network calls. The step is done when pip reports a successful install and the version reported by garak matches the approved release.

  7. Run a small probe set end to end

    Start with a deliberately small probe set against a local or internal test target that you control, so any failure is easy to isolate. Run the scan from the isolated environment and confirm it completes without network errors. Afterward, open the JSONL report and check that each attempt and its evaluation are recorded, then review garak.log for missing model, dataset or connection messages. Repeat this check after each change to the environment. The step is done when the run finishes cleanly, the JSONL report contains entries for every attempted probe, and garak.log shows no unexpected fetch attempts.

  8. Document the staged build for future transfers

    Record the approved garak version, the Python version, the artefact revisions, the checksum manifest and the test scan results in the build record for the isolated host. Store the record with the scan host configuration so future upgrades start from the same inventory. Ask your team to confirm how often staged updates are approved in your change process, since that cadence is set by your organization rather than by garak. The step is done when the build record is filed and a second engineer can rebuild the environment from it.

Where an offline garak run is most likely to fail

The most common failure in an isolated garak run is a network call the scan does not expect. Several garak components reach outside the host at run time: some detectors load Hugging Face classifier models, and the system prompt extraction probe sources its system prompts from Hugging Face datasets. On a host with no route to the Hub, these calls either fail or hang until a timeout. Before the formal scan, list every detector and probe in the planned configuration, then check each one for Hub dependencies using the garak user guide and the probe source code. Treat any component that loads a model or dataset by name as a dependency you must pre-stage, not as something that will be fetched when needed.

Non-English probes add a second group of dependencies. garak's translation support uses local translation models for some languages, so a probe set that works in English can fail as soon as it includes a translated prompt set. Dependencies with platform-specific wheels are the third risk: a package built for one Python version, operating system or CPU architecture on the staging machine will not install on the isolated host. Confirm that the Python version and platform of the air-gapped host match the ones used to download packages, since the PyPI package requires Python 3.11 or newer. The fourth risk is the target itself. A REST generator or hosted generator needs a route to the endpoint, and an isolated network often has none unless the owner of that endpoint has deliberately opened one.

The garak.log file is the main diagnostic tool. It is continued across runs, so the failing request, the missing model name or the connection error usually appears there with a timestamp that places it in the right run. Search it for Hugging Face hostnames, OSError messages and connection timeouts before changing anything else. Because each failure type points to a different fix, record which component failed and whether the cause was a missing file, a missing route or a missing dependency. Then run a short smoke test with a probe set that touches each dependency: one detector that loads a model, the system prompt extraction probe, a non-English probe, and a request to the target endpoint. A failure in this smoke test costs minutes, while the same failure halfway through a formal scan wastes the endpoint owner's time and leaves an incomplete report.

Security controls for the isolated scan host

An air-gapped garak host holds the tool, its model artefacts and the reports of every harmful exchange, so it needs its own controls. The cards below cover the boundary, the data it produces and the access paths that remain once the network is closed.

Verify packages before they cross the boundary

Every wheel, model file, dataset and detector artefact carried into the enclave is a supply chain input. Record a checksum for each file at the point it leaves the connected staging host, and verify it again on the isolated host before installation. NERC CIP-013-2 makes verification of software integrity and authenticity a procurement control for vendor software and patches, and the same idea applies to garak's dependencies. Confirm that your transfer process keeps the manifest and the files together.

CIP-013-2 text

Block outbound access from the host

Air-gapping should be enforced by the network, not assumed. Deny all egress from the scan host except to the model endpoint under test, and confirm that no package index, Hugging Face Hub or dataset URL resolves or connects. Garak probes that fetch datasets at run time will fail or hang in this setup, so test a full run in the isolated network before you rely on it. Ask your network team to show the firewall rules and a failed connection test.

Protect reports and logs with harmful content

The JSONL report holds every attempt and its evaluation, and garak.log accumulates across runs. Both can contain jailbreak prompts, toxic output and sometimes leaked data, so they need the same handling as sensitive test evidence. Restrict read access, encrypt the volume at rest, and set a retention period agreed with your compliance team. Keep the report directory on a path you control so it can be moved and purged deliberately.

Scope credentials for the target endpoint

The scan host usually needs an API key, a bearer token or a client certificate to reach the model under test. Issue a dedicated credential with the smallest permissions the endpoint allows, and give it a rotation schedule. Keep the secret in a file or secret store with restricted permissions rather than in a shell history or a command line. Make sure the credential cannot be reused for production traffic, and confirm with the endpoint owner how it will be revoked after the scan.

Limit who can log in to the host

Anyone who can reach the scan host can start runs, read reports and change the probe configuration. Restrict interactive access to a named group of operators, use individual accounts with central logging instead of shared logins, and remove removable media access where transfers happen through a controlled process. Review membership on a set schedule. Ask your identity team which group owns the host and how access is removed when someone leaves the project.

Record artefact versions for each run

A scan result is only comparable with another if you know which garak release, Python version, detector models and probe data produced it. Keep a run manifest that lists the garak version, the installed package hashes, the model file versions and the endpoint configuration used. Store it alongside the JSONL report and garak.log. Garak 0.17.1 was released on 16 October 2026, so a run record should name the exact version rather than a range.

garak releases

Questions teams ask before an offline garak scan

Does garak run with no internet access at all?

Not by default, and the answer depends on the target and the probes you choose. garak itself is a command-line tool installed from PyPI with pip, so the host needs its package and dependencies staged ahead of time. Beyond installation, some probes and detectors need outside resources: some detectors load Hugging Face classifier models, and the system prompt extraction probe sources system prompts from Hugging Face datasets. If the model under test is reached over an internal REST endpoint, that path can stay inside the network. Confirm each probe and detector in your planned run against its source, because a single missing artefact can stop a run partway through.

What should we stage on the isolated host before the first scan?

Stage everything the run will touch, then test the run on a connected staging host with the same Python version. The list usually includes:

  • The garak package and its dependencies, from PyPI, for Python 3.11 or newer
  • Hugging Face model files and datasets used by detectors and probes, stored locally and loaded from disk
  • Local detector and translation models, if your scan uses translated prompts
  • The garak version you intend to use, recorded so reports can be compared later

garak keeps larger artefacts such as model files out of its repository and can load them from Hugging Face Hub, so you will need to fetch and copy them yourself. Ask the team that owns the target endpoint what network path it needs.

How much effort does an offline garak setup take, and what drives it?

The effort depends mainly on how many external artefacts your chosen probes need and how your transfer process works. garak is free and licensed under Apache 2.0, so the software itself adds no license cost. The work is in transfer and verification: listing every dependency and model, moving them across the boundary, and confirming each one loads offline. Effort rises with the number of probes that fetch datasets or classifiers at run time, with the number of languages in translated scans, with how strict your change control is, and with how many hosts need the same bundle. Ask for a dependency and artefact list before estimating time, and confirm which parts are one-time (the initial bundle) and which recur (each garak upgrade and probe data refresh).

Can our internal team set up garak offline without outside help?

Often yes, if the team has Linux administration skills, Python packaging experience and someone who owns the transfer process. The hard parts are rarely the install command. They are finding every runtime download a probe makes, proving that a model loads with no network, and documenting the process so that a second person can repeat it. Teams that already run offline package mirrors or internal model registries usually have the basic building blocks. Confirm three things before deciding: who will own the bundle, how the scan host will be tested without internet access, and how often the team expects to refresh garak and its data.

How do garak and probe data updates reach an isolated host?

Updates arrive as a new bundle that you build on a connected host, verify, and carry across the boundary. Each garak release is published on GitHub and PyPI, and the release notes show what changed. Probe data and detector models can change independently of the tool, so the bundle should record versions for each item. Pin the garak version and its dependencies in the bundle, rerun a short known-good scan after every import, and compare the report format with the previous run before using the results for decisions. Your change-control process should cover the integrity checks applied to each imported package, a pattern that matches the software integrity and authenticity expectations in NERC CIP-013-2 for utilities and similar sectors.

What would an outside partner need from us to scope offline garak work?

A partner needs enough information to write a fixed scope before touching your network. Expect to provide:

  • The target model or application and the endpoint path the scan will use
  • The host or enclave where garak will run, its operating system and Python version
  • Your transfer procedure, approval steps and where bundles are stored
  • The probe families you want to cover and any data classification rules for saved reports
  • Names of the people who will review results and approve updates

DeployOpen plans and delivers this work as fixed-scope engagements with scope, deliverables and timelines agreed in writing before work starts. Ask for a written quote that lists each artefact, each transfer step and each handover item.

Does an air-gapped garak setup help with compliance evidence?

It can help, because a documented, repeatable offline process produces the records auditors ask about: what was installed, from which versions, and how integrity was checked. It does not make a scan compliant on its own, and DeployOpen does not issue audit reports or certifications. Independent auditors and certification bodies make those determinations. For regulated environments, confirm which frameworks apply to the system under test, and confirm with your assessor which records of the transfer process and scan runs they will accept as evidence.

How offline scanning connects to the rest of garak operations

An air-gapped scan host changes more than the install step. Every operational habit that assumes network access, from pulling a new garak release to fetching a Hugging Face classifier on first use, has to be redesigned so the isolated host can run the same scan on the same inputs every time. Decide early whether the scan host is dedicated to garak or shared, because that choice sets how much of the dependency tree you must stage and how often you will need to move new packages across the boundary.

Scheduled regression scans are the operational point where offline work pays off or fails. A CronJob or cron entry on an isolated host can only repeat a scan if the probe set, garak version, detector models and generator configuration are all frozen in the staged bundle. Before you schedule anything, confirm that the scan will not reach out for a dataset or model at run time, and record the garak version in each run so later comparisons are not confounded by an upgrade. Plan who approves each import of a new garak release, since NERC CIP-013-2 expects software integrity and authenticity to be checked for vendor software carried across an isolated boundary.

Where the model under test runs changes what must be staged. A local GPU host needs the model weights, tokenizer files and any classifier the detectors load on the same isolated network, while a hosted or self-served endpoint means the scan host only needs a route to that endpoint inside your perimeter. Either way, report and log storage on the isolated host is part of the same design, because the JSONL report and garak.log will hold harmful prompts and outputs that cannot simply be shipped to a central service. For installation and report storage, see the other guides in this group, which cover the environment setup and log locations in detail.

How DeployOpen scopes and delivers offline garak scans

DeployOpen approaches offline garak scanning as a planned transfer and verification exercise. We agree the scan scope in writing, prepare every package, model and dataset the scan needs before it crosses the boundary, and document how the scan runs inside your network. Engagements are fixed-scope, with the deliverables and timelines agreed before work starts.

How we scope

  • Written scope lists the garak probes, generators and detectors your air-gapped scan will use.
  • We inventory which probes fetch datasets or Hugging Face artefacts at run time, and which must be pre-staged.
  • The scope names the target model or application endpoint and the hosts where garak will run.

How we build

  • We stage garak, its Python dependencies and required Hugging Face artefacts on a transfer medium for review.
  • Local detector and translation models are prepared and tested offline before the first scan.
  • We configure the scan host, report paths and logging so results stay inside your controlled storage.

How we hand over

  • Deliverables include the staged artefact manifest, install and run runbook, and a record of checks performed.
  • We document how each package and model was verified before import, for your supply chain review.
  • Your team receives a tested offline scan run, with the report and log locations confirmed.

How we support

  • Ongoing support is available as a retainer, covering updates to staged artefacts and garak versions.
  • Re-staging for a new garak release is scoped as a separate, written piece of work.
  • Retesting after changes to the endpoint, detectors or scan host can be agreed in the retainer.

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.