Installing garak: Python versions, disk space and environments

garak installs from PyPI or from source and its PyPI package requires Python 3.11 or newer. Choose the install path, isolate the environment and prepare a dedicated scan host before the first run.

On this page

Installing garak on a dedicated host: what to decide first

A team about to run garak against an internal model or application needs an install that someone else can reproduce next month. garak is a command-line tool installed from PyPI with pip, and the PyPI package requires Python 3.11 or newer. The project is developed on Linux and macOS and documented as running test workflows on Linux, Windows and macOS, so the first decision is which of those operating systems your scan host will run, and whether your approved Python 3.11 or newer build is available on it. garak is licensed under Apache 2.0 and probes large language models for weaknesses such as prompt injection, data leakage, jailbreaks and toxic output. It is built from five plugin categories (probes, detectors, evaluators, generators and harnesses), so a scan depends on each of those components loading correctly, not only on the top-level command.

Decide early whether garak gets its own host or a dedicated environment on a shared machine. A separate host or Conda environment is worth the effort when scans send prompts that contain harmful content, when the scan host needs network access only to the model under test, or when several teams would otherwise upgrade Python packages on the same machine. Ask whoever owns the target endpoint which hosts may call it, and record the source address you will scan from. Confirm with your platform team which Python builds, package mirrors and proxy settings the host can use, because a pip install that works on a developer laptop may fail behind a corporate proxy or an air-gapped network. Check free disk space for the virtual environment and for the report and log directories before the first run, since each scan writes its own files.

Before the first install, write down the garak version you will pin, the Python version, the host owner and where reports will be kept. Check the garak releases page for the current version and its change notes, and confirm with your own engineers which release your scan pipeline has been tested against. Pinning a release, rather than installing whatever is latest on each run, keeps probe sets and scores comparable over time. Keep the scan host's configuration in version control so a rebuild after a failure produces the same environment. These choices are one-time setup work, but they recur each time garak is upgraded, so assign an owner for that upgrade cycle from the start.

Install paths for garak and when each fits

This table compares the three ways to put garak on a machine: a PyPI release, a source checkout in a Conda environment, and a shared scan host. Read each row against your need for a stable release, a development build or repeatable results across teams. The main takeaway is that the Python 3.11 floor applies to every path, so confirm the interpreter before choosing.

FactorPyPI release with pipSource checkout in CondaShared scan host
What you getA published release, such as v0.17.1 released on 16 October 2026The main branch or a chosen commit, including unreleased changesWhichever build the host administrator installs and pins
Who maintains itNVIDIA maintainers publish the package to PyPINVIDIA maintainers publish the code; your team owns the local environmentYour platform team owns the install, updates and access
ReproducibilityHigh when you pin the version in a requirements fileLower unless you record the commit hash and environment fileHigh if the host image and version are recorded and changed through change control
Python constraintPython 3.11 or newer, as set in pyproject.tomlPython 3.11 or newer, confirm in the checked-out pyproject.tomlPython 3.11 or newer on the host, confirm before provisioning
Best fitRoutine scanning and CI jobs that need a known releaseDevelopers testing new probes or reproducing a fixTeams that run scheduled scans and share reports
Main riskScores can shift between releases, so pin and note the versionUnreleased code may change behavior between checkoutsOne shared environment can drift if people install into it directly

Install garak in an isolated environment

This sequence leaves you with a garak install that is pinned to a known release, runs from its own virtual or Conda environment, and writes reports to a location you control. Each step ends with a check so you can confirm the install before any scan touches a model.

  1. Confirm Python 3.11 or newer is available

    On the scan host, check the interpreter version with python3 --version. The garak PyPI package requires Python 3.11 or newer, so an older system Python will not install the release. If the host only has an older interpreter, install a newer one through your OS package manager or a Conda environment, then use that interpreter for the remaining steps. You are done when the reported version is 3.11 or higher and the interpreter you will use is the one you will call from the environment.

  2. Create an isolated Python environment

    Create a dedicated virtual environment with python3.11 -m venv ~/garak-env (or an equivalent Conda environment for the same interpreter), then activate it. Keeping garak in its own environment stops its dependencies from colliding with other tools on the host and makes the install easy to rebuild. Confirm activation by checking that which python points inside the environment directory.

  3. Install the release from PyPI

    Run pip install garak inside the activated environment to install the release published on PyPI. Pip pulls in the dependency set for that release, which can be large, so make sure the host has enough free disk space before you start. To pin a specific release for your team, install with an explicit version such as pip install garak==<version> using the version you have reviewed on the release page. The step is complete when pip reports a successful install without dependency errors.

  4. Record the installed version

    Capture the exact version with pip show garak or python -m pip freeze | grep -i garak and save it with the host details in your runbook. Reports and score comparisons can shift between releases, so the version belongs next to every scan result you keep. Check that the recorded version matches the release you chose on the GitHub releases page. Repeat this record whenever you upgrade.

  5. Confirm the entry point runs

    Run garak --help from the activated environment. A help listing means the command-line entry point is installed and on the path, and that the Python imports for the core package load without error. If the command is not found, check that the environment is active and that the install completed in this environment rather than in the system Python. You are done when the help output prints without a traceback.

  6. Create a clean output location

    Create a dedicated directory for reports and logs, for example with mkdir -p ~/garak-runs, and keep it separate from the install directory. Garak writes a JSONL report for each run and a garak.log file that continues across runs, so a clean location makes it easier to tie each report to a run and to a garak version. Confirm that the directory is writable by the account that runs scans and that it is on a volume with enough space for the reports you expect. Record the path in your runbook so the storage and retention steps can refer to it.

  7. Pin the version in the team runbook

    Write the install commands, the pinned version, the Python interpreter path, and the output directory into the team runbook for the scan host. Note the release page as the place to check for newer versions before any upgrade, and require a review of scan results after changing the pinned version. Your team is done when a colleague can rebuild the same environment from the runbook alone and get the same garak --help result.

How much disk and dependency footprint garak adds

Most of the disk on a garak scan host goes to three things: the Python environment and its dependencies, Hugging Face model artefacts if you test local models, and the output each run writes. The garak package itself is a small share of that total. Before you plan storage, install garak into the environment you intend to use, then record the size of that environment with a tool such as du on the Python environment directory. Repeat the measurement after you add the first local model. The gap between those two numbers is the figure that matters for capacity planning, and it is the number your infrastructure team should confirm for their own hosts.

Local model artefacts usually dwarf the tool. A single Hugging Face model download can be many times the size of the garak install, and the cache it lands in is controlled by your environment settings, so it does not appear in the project directory unless you point it there. Decide where that cache lives before the first download, especially on a host with a small system volume. The same applies to any detector or translation model that garak pulls at run time. If you are scanning hosted endpoints only, this cost largely disappears and the footprint is the environment plus output.

Output grows with every run rather than being fixed at install time. Each scan writes a JSONL report of every attempt and its evaluation, and garak.log is continued across runs, so a host that runs scheduled scans will accumulate both files indefinitely. Report size depends on the probes selected and the generations per prompt, so measure one representative run and multiply by your planned frequency. Set a retention rule and a location for report_dir early, because reports can contain harmful prompts and outputs that need controlled storage. Ask whoever owns the scan host to confirm the volume sizing and the cleanup schedule before the first scheduled job is enabled.

Preparing a dedicated scan host

A garak scan host sends prompts to models that may produce harmful output, and it holds the keys to the systems it tests. Each card below covers one control that keeps the host predictable, isolated and traceable, so the results can be reproduced and defended later.

Pin the OS and Python version

Choose one operating system image and one Python interpreter, then record both in the host build notes. The PyPI package requires Python 3.11 or newer, so a host with an older system Python needs a managed interpreter installed beside it. Check that the chosen interpreter is 3.11 or newer before installing, and keep the same version for every scheduled run so results stay comparable.

Project metadata

Use a separate service account

Run garak under a dedicated, unprivileged account that exists only for scanning. It should have no access to production databases, cloud roles used by applications, or internal admin tools. Its home directory should hold the garak install and the report directory, nothing else. If the host is compromised through a scanned endpoint, this limits what the attacker can reach.

Limit egress to the target

Allow outbound connections only to the model or application under test, plus the package index during installation. Hugging Face, Replicate or other hosted generators need their own explicit allow rules, and any probe that fetches data at run time needs a documented exception. Verify the egress rules with a test from the host before the first scan, because a silent fallback to the public internet is hard to spot later.

Keep a writable, backed-up report directory

garak writes a JSONL report and a garak.log file for every run, and those files contain the harmful prompts and outputs the scan produced. Give the service account write access to one dedicated directory on a volume with enough free space for repeated runs. Back it up on a schedule that matches your retention policy, and confirm where the output lands before the first scan so the report is not lost on a full disk.

garak user guide

Keep API keys out of logs

Load provider keys from a secrets store or a root-owned environment file that the service account can read, not from inline shell commands. Commands typed with a key on the line end up in shell history, and key values can leak into CI job logs or process listings. Confirm that garak.log and the report files do not echo credentials, and rotate any key that was ever pasted into a terminal.

Record the garak version with each report

Save the exact garak version, the Python version and the installed dependency set with every report, for example from a generated environment lock file kept beside the output. Scores can shift between releases, so a report without a version cannot be compared with a later run. Garak releases are listed on GitHub, and the version you install should match the one written into the report metadata.

garak releases

How the install, environment and report paths fit together

The flow starts on the scan host, where garak is installed into a dedicated Python environment from PyPI or from a source checkout. garak then sends prompts over the network to the target endpoint, which sits across a trust boundary that your team does not fully control. Each attempt and its evaluation are written to the report directory as a JSONL report, while garak.log accumulates debugging output across runs. Check that the environment's Python meets the 3.11 minimum, that the report directory has room and is writable, and that nothing in the path leaves the host unexpectedly.

Install sources, the scan host, the target endpoint and where output lands.

Questions teams ask before installing garak

Which Python version does garak need, and why 3.11 or newer?

The PyPI package of garak requires Python 3.11 or newer, so any host running a Python version older than 3.11 needs a newer interpreter before pip will install it. The requirement comes from the project's packaging metadata, so it is a hard floor for the release you install. Check the requires-python value in the release you plan to use, because the project can change it between versions. On a shared host, install a separate interpreter with a version manager or Conda instead of replacing the system Python, since other tools on the host may depend on the existing one. Confirm the interpreter with python3 --version inside the environment that will run the scan.

Should we install garak from PyPI or from source?

For most teams, install the release from PyPI with pip, because a tagged release is easier to pin, reproduce and document in a change record. Installing from source, using a clone of the GitHub repository in a Conda environment, suits engineers who need unreleased fixes or plan to write custom plugins. The trade-off is that a source install tracks a moving branch unless you pin a commit, and its results can shift from one run to the next. Record the exact version or commit in your scan configuration, and keep the same method across scans so comparisons stay valid. The garak release notes on GitHub list the versions you can pin.

How long does a garak install take, and what drives the effort?

The install itself is a single pip command, so the time is driven by everything around it: preparing the host, creating an isolated environment, and getting network access to the package index and any model hosts. Approvals often take longer than the technical steps, particularly when the host must join a segment that already holds regulated data. Effort rises when the host is shared, when outbound access must go through a proxy, or when the scan must run without internet access, where you must stage packages and model artefacts in advance. Ask your team to list those dependencies before scheduling the work, and confirm each one in your own environment rather than relying on a general estimate.

Can our team install and run garak without outside help?

Yes, a single engineer with Python experience can usually install garak on one dedicated host and run a first scan without outside help. The effort grows with the surrounding controls: a shared scan host needs access rules, a separate service account and agreed storage for reports that contain harmful prompts and outputs. An air-gapped host needs a staged copy of garak, its dependencies and any Hugging Face artefacts, which must be built on a connected machine and moved across under your change process. Decide early which of these your team owns, because the gaps usually appear in access and storage rather than in the install command.

What does the garak installation need from our team?

Prepare four things before the install starts. First, a host with enough disk space and memory for the Python environment and the scan workload, with the size confirmed against the packages your chosen configuration pulls in. Second, a supported Python interpreter, which must be 3.11 or newer for the PyPI package. Third, a dedicated service account that owns the environment and the output directory. Fourth, a target endpoint, such as a REST service, a hosted API or a local model server, with its address and credentials agreed with the team that runs it. Ask the endpoint owner about request limits before the first run, because the install does not reveal them.

Does DeployOpen install garak for clients?

Yes. DeployOpen plans and runs security testing with open-source tools, and installation of garak on a scan host in your own infrastructure can be part of a fixed-scope engagement. The written scope would name the host, the Python version, the environment method, the target endpoint and the storage location for reports, and it would give the deliverables before work starts. DeployOpen does not publish a price list, so the cost follows from that written scope. Ask for the scope to list the environment and dependency steps separately, so you can see what your team keeps running after handover.

Security considerations for the scan host

A garak host sends attack prompts to models, stores the outputs and holds credentials for the systems under test. The cards below cover the risks that follow from that role, and each one names the check to make before the first scan.

Verify the package source

Install garak from the official PyPI package or from a reviewed checkout of the NVIDIA repository, pinned to a known release. Compare the installed version against the release notes before you scan, and record the hash or version in your build record. A package pulled from an unknown index or a fork can run code with the scanner's permissions, so confirm the index and the publisher before adding it to a host that holds API keys.

Minimum Python
3.11
garak on PyPI

Pin dependencies across hosts

Two scan hosts with the same garak version can still differ in transitive packages, which changes detector behavior and makes scores hard to compare. Keep a lock file or a frozen requirements list per environment, and rebuild hosts from that file rather than installing by hand. Ask whoever maintains the host which versions of Python and the supporting libraries are in use, and check them after every upgrade.

Protect harmful probe output on disk

garak writes a JSONL report of every attempt and its evaluation, plus a garak.log file that persists across runs. Those files can contain harmful prompts and model outputs, so they need the same handling as sensitive data. Set a dedicated report directory on an encrypted volume, restrict read access to the scan team, and decide a retention period before the first run, not after the files have accumulated.

Keep API keys out of shared environment

Keys for hosted generators are often exported as environment variables, which other users on the same host can read through process listings or shell history in some configurations. Load credentials from a restricted file or a secrets manager at run time, scope each key to the minimum quota and endpoint the scan needs, and rotate keys after any shared use. Confirm with the endpoint owner which key is in use and who can revoke it.

Dedicate the host to scanning

A general-purpose machine carries browsers, personal tooling and unrelated services, each of which widens the attack surface and mixes unrelated packages into the garak environment. Run garak in its own virtual environment on a host used only for scanning, with outbound access limited to the models under test and the package index. Ask your platform team to confirm the host is in the same patch and backup cycle as other scan infrastructure.

Development builds versus release builds

The choice between the PyPI release and a source install from main is mainly a choice about evidence. A tagged release is the reproducible option: the same version number gives the same code for every host, which makes it the right basis for scans that may end up in compliance files, audit requests or vendor security reviews. Record the exact version you installed (for example, with pip show garak) and keep it with the report so the result can be reproduced later. The maintainers' release history is on the NVIDIA/garak releases page, where you can choose a version and read its notes before pinning it.

A source install from the main branch gives you the newest probes, detectors and fixes before they reach a release, but it also means the code can change between two installs on the same day. Unreleased changes may alter probe behavior, detector thresholds or report fields, and scores from a development build may not match scores from a release. If your team needs unreleased fixes, pin a specific commit rather than tracking main, and note the commit hash in your scan records. Treat development builds as a testing track for your own environment, not as the build that produces formal results.

Before you rely on either build, read the documented behavior for that version in the garak user guide rather than assuming a feature from the repository history is available. Confirm that the release you pin matches the documentation you cite in your evidence pack. Also confirm the Python requirement for the version you choose, because the requirement in the package metadata can change between versions, and check it on the scan host before the install is approved.

How DeployOpen scopes and delivers garak installs

DeployOpen plans the garak installation as part of the scan host and its environment, not as a single pip command. The written scope covers the Python version, the Conda or virtual environment, the storage for reports and logs, and the handover to the team that will run scans.

How we scope

  • Confirm the Python version the scan host will use, against the 3.11 or newer requirement for the PyPI package.
  • Agree whether the install follows the PyPI release or a source build, and why that choice fits your change process.
  • Record disk, memory and network needs for the host, including where reports and garak.log will be kept.

How we build

  • Create a dedicated Conda or virtual environment on the scan host and pin the garak version used for each engagement.
  • Install garak from PyPI or from source, then confirm the command-line tool starts and lists its plugins.
  • Test the install against the endpoint or model under test, using a small probe set before any full run.

How we hand over

  • Deliver a written install record covering the host, Python version, environment name, garak version and dependency list.
  • Document the upgrade steps, including how to rebuild the environment and where report directories are configured.
  • Walk your platform or security team through the install and the commands they will use day to day.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer for garak hosts you operate.
  • Ask any provider to confirm in writing who maintains the environment after handover and who answers install failures.

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.