garak vs Meta Purple Llama

Choose garak to scan a model endpoint for prompt injection, data leakage and jailbreaks before release. Choose Purple Llama classifiers or LlamaFirewall to filter traffic at runtime, and check each component's license.

On this page

garak vs Meta Purple Llama: when to choose each

garak and Purple Llama are complementary, and they are seldom direct substitutes. A team with both on its shortlist is usually deciding where each one belongs in the release cycle. garak is a command-line scanner. Its probes generate attacks against a model or REST endpoint, its detectors judge whether the target failed, and it writes a JSONL report of every attempt. Purple Llama supplies runtime safeguards: Llama Guard 4, Prompt Guard 2, CodeShield and the LlamaFirewall framework, which filter prompts, responses and agent actions while the application runs. In short, one tests for weaknesses before release and the other enforces controls on live traffic.

Choose garak when the question is what the model does before release. Use it to produce testing evidence: point it at a Hugging Face, OpenAI, AWS Bedrock or llama.cpp model, or at a custom REST endpoint described in a short YAML file. Each run writes a JSONL report of every attempt and its evaluation, which gives your security team a record to review and compare across model, prompt or tool changes. Choose Purple Llama when the question is what happens to live traffic. Llama Guard 4 classifies prompts and responses against the MLCommons hazards taxonomy, Prompt Guard 2 labels prompts benign or malicious to flag injection and jailbreak attempts, and LlamaFirewall layers these scanners across chat models and agents. Any classifier placed in the request path becomes part of your production system, so confirm its latency and failure behavior in your own environment before go-live.

The decision usually turns on two questions: whether you need both, and which license terms apply to each piece. Production teams often need both, with garak run before release and again after each guardrail change. The license split inside Purple Llama matters here. Its evals, benchmarks and CodeShield are MIT licensed, and LlamaFirewall is MIT licensed, but Llama Guard 4 and Prompt Guard 2 ship under the Llama 4 Community License Agreement. garak is Apache-2.0. Before you ship either Llama classifier inside a product, have counsel review the license for each classifier in the Purple Llama repository and confirm that the version you deploy matches the file you reviewed.

Which scenario favors garak and which favors Purple Llama

This table maps eight team scenarios to the better fit between garak and Meta's Purple Llama safeguards, with the reason for each and the condition that would reverse the answer. Read each row as a decision rule that holds only while its stated condition is true. Most teams with both needs combine a scanner for pre-release evidence with a runtime filter for production traffic.

ScenarioBetter fitWhyWhat flips the answer
Pre-release scan of a model endpointgarakIts generators connect to Hugging Face, OpenAI, Bedrock, llama.cpp and REST endpoints for probe runs.A target garak cannot reach through a built-in generator or REST configuration. Confirm endpoint support first.
Red team evidence for a customer or internal security reviewgarakEach run writes a JSONL report of every attempt plus a hit log of attempts that found a vulnerability.A reviewer who wants scores on Meta's published benchmarks, where CyberSecEval in Purple Llama is the relevant suite.
Runtime prompt injection filteringPurple Llama (Prompt Guard 2 or LlamaFirewall)Prompt Guard 2 labels prompts benign or malicious for injection and jailbreak attempts. garak is a scanner and does not filter live traffic.Inputs longer than the 512-token context window, which need chunking or another filter. Confirm your input sizes.
Auditing a tool-using agentPurple Llama (LlamaFirewall AlignmentCheck)AlignmentCheck audits agent reasoning. garak's probes judge model outputs.AlignmentCheck requires a Together API key. If sending agent data to that service is not approved, consider garak's REST generator against the agent.
Screening LLM-generated codePurple Llama (CodeShield)CodeShield statically analyzes generated code in 8 languages using Semgrep and regex rules.Languages outside those eight, or rules your secure coding standard requires. Confirm coverage against your stack.
Python 3.10 or 3.11 constraintPurple Llama if the runtime is 3.10. garak needs 3.11.LlamaFirewall needs Python 3.10 or later. The garak PyPI package requires Python 3.11 or newer.A runtime of 3.11 or newer. Then both tools install and this constraint no longer decides the choice.
License-sensitive deploymentgarakgarak is a single Apache-2.0 tool. Purple Llama code is MIT, but its model weights carry Llama community licenses.A need for runtime filtering, which requires Prompt Guard or Llama Guard weights under Llama terms. Have counsel review those terms.
Identity and SSO integrationConfirm with the vendorsNo supplied fact covers SSO or user identity for either tool.Ask NVIDIA and Meta how each tool authenticates users and what it logs before you scope the work.

How garak probes a model while Purple Llama classifies traffic

garak sends attacks at a model from outside and reports what got through, so it runs as a scheduled or on-demand job. Purple Llama's classifiers sit between users and the model, so they run on every request and need hosting that stays online. The cards below show where each part of both stacks runs in your environment.

garak runs as a batch job

garak is built from probes that generate attacks, detectors that judge the output, generators that connect to the target and harnesses that run them. The default probewise harness runs each probe with its recommended detectors. Each scan is a batch job against a target, so schedule it against a test endpoint or pre-production model. Confirm the target is reachable from the scanner host, and that the host runs Python 3.11 or newer, the minimum for the PyPI package.

garak user guide

JSONL report and garak.log

Each run writes a JSONL report of every attempt and its evaluation, plus garak.log, a debugging file that continues across runs. By default garak makes 10 generations per prompt and marks a probe FAIL when any attempt produces undesirable output, so one failed attempt is enough to fail a probe. Plan where these files are stored, how long you keep them, and whether the prompts they contain fall under your data handling policy.

Classifiers run in the request path

Llama Guard 4 is a 12-billion-parameter multimodal classifier that labels both prompts and responses against the MLCommons hazards taxonomy. Prompt Guard 2 comes in 86M and 22M parameter versions that label prompts benign or malicious, and the 22M version is the smaller, lower-latency option. Both run on every request, so you need inference hosting in your own network, sized and kept available for live traffic.

Llama Guard 4 model card

AlignmentCheck needs a Together key

AlignmentCheck audits the reasoning of an agent, which makes it relevant once you run agents rather than chat alone. Its scanner requires a Together API key, so each check depends on an external API call. Confirm with Meta and Together what data leaves your environment per call, then set key storage, egress rules and vendor review in the design before you enable it on agent traffic.

CyberSecEval benchmarks models

CyberSecEval is the benchmark part of Purple Llama, used to measure cyber-related behavior in a model. It is a benchmark, not a runtime control, so its results feed a model selection or pre-release decision. Check which tasks it covers against your own threat model, and run it on the exact model version and configuration you plan to deploy, since results apply only to that setup.

LlamaFirewall layers the scanners

LlamaFirewall is an MIT-licensed layered framework that runs Prompt Guard 2 for direct prompt injection, AlignmentCheck for agent reasoning, CodeShield for insecure generated code, and regex or custom scanners. CodeShield statically analyzes generated code in 8 languages using Semgrep and regex rules. Install with pip install llamafirewall, which needs Python 3.10 or later. Pin the scanner set in your own config and test it in the same environment as your application.

LlamaFirewall README

Where garak and Purple Llama sit in one LLM application

This illustrative diagram starts with a user request that passes an input check (Prompt Guard 2, which LlamaFirewall can run) before it reaches the model endpoint. The model's output then passes an output check (Llama Guard 4, with CodeShield for generated code). A separate garak run sends its generated attacks to the same endpoint and writes a JSONL report and a hit log inside the client's infrastructure. AlignmentCheck, if you use it for agent reasoning, calls a third-party service through the Together API, which crosses a trust boundary. Check whether your garak runs go through the same input and output checks as users do, since a result without the guards tests the model alone.

Illustrative layout of guard checks and a garak run around one model endpoint.

garak vs Meta Purple Llama capability by capability

This table compares garak and Meta Purple Llama across purpose, coverage, operation, licensing, runtime, output, extensibility and deployment. Read it as a choice between a batch scanner that probes a model endpoint and a runtime guard layer that filters prompts and agent actions. Identity integration is not a stated capability for either side, so confirm SSO and access controls with each vendor before you plan a rollout.

CapabilitygarakMeta Purple Llama
Primary purposeScans an LLM for weaknesses by sending attack prompts and judging the responsesSafeguard components that classify prompts and outputs, plus benchmarks and code checks
Attack or risk coverageHallucination, data leakage, prompt injection, misinformation, toxicity and jailbreaksPrompt injection and jailbreaks (Prompt Guard 2), hazards in prompts and responses (Llama Guard 4), insecure generated code (CodeShield), agent reasoning (AlignmentCheck)
Batch or runtime operationBatch command-line runs against a target, producing a report per runRuns as a guard layer around chat models and agents
LicenseApache-2.0, developed in NVIDIA's GitHub organizationLlamaFirewall is MIT. Prompt Guard 2 and Llama Guard 4 models use Llama 4 Community License terms
Model or code artifactsPython CLI that calls the models you point it atPython package plus separate model cards for Prompt Guard 2 and Llama Guard 4 classifiers
Runtime requirementPython 3.11 or newer, installed with pip, developed on Linux and macOSPython 3.10 or later, installed with pip; AlignmentCheck needs a Together API key
Output formatJSONL report of every attempt and its evaluation, plus a hit log of failing attemptsClassifier labels such as benign or malicious from scanners for the calling application to act on
ExtensibilityFive plugin types (probes, detectors, evaluators, generators, harnesses) and YAML config for REST endpointsRegex and custom scanners within LlamaFirewall; other Purple Llama tools have their own interfaces
Deployment target and identity integrationRuns on a workstation or CI host against a model endpoint. Identity integration is not stated; confirm with NVIDIA.Installs into your application or agent service. Identity integration is not stated; confirm with Meta.

Which Purple Llama components carry MIT and which carry the Llama license

garak is the Apache-2.0 licensed scanner developed in NVIDIA's GitHub organization. Its maintainers describe it as a free tool. The latest release at the time of writing is v0.17.1, published on October 16, 2026, so teams that already have Apache-2.0 on their approved open-source list can start the review from that baseline.

  • License: Apache-2.0 covers the garak code. Your legal team still needs to check any third-party model or endpoint you connect it to, because those carry their own terms.
  • Maintainer: NVIDIA's GitHub organization hosts the repository, issues and releases, so the release history is public and easy to follow.
  • Cost: The maintainers describe garak as free. Your recurring costs are the compute for scan runs, the usage fees on any hosted target, and the staff who review the reports.
  • Install: garak installs from PyPI with pip, requires Python 3.11 or newer, and is developed on Linux and macOS.

Check the license file in the repository, the Python version on your build image, and the terms of every model provider your scans will reach before you approve the tool.

What drives running cost for garak and Purple Llama

garak has no licence fee, since its maintainers describe it as a free tool, so its running cost is engineering time, compute for probe runs and access to the target. Compute grows with the number of attempts. garak makes 10 generations per prompt by default and marks a probe as failed when any attempt produces undesirable output, so a probe set with many prompts makes far more model calls than the prompt count suggests. Before you budget, confirm the generation count you plan to run and the number of probes and detectors in each harness. Target access is a separate cost: garak tests your model or endpoint but does not host it, so you pay for API calls or GPU hours on the system under test. Engineering time covers writing the YAML file for a custom REST endpoint, reviewing the JSONL report and hit log after each run, and rerunning tests after every model or prompt change. That work recurs with each release cycle, not only at setup.

Purple Llama costs come from separate components. Llama Guard 4 is a 12-billion-parameter classifier, so you pay for inference capacity to host it on your own GPUs or a managed endpoint, and that capacity runs every time the guard sits in the request path. Prompt Guard 2 is the main lever on that cost. Its model card says the 22M version cuts latency and compute costs by 75% with minimal performance trade-offs, and the 86M version is the multilingual option. Choosing the size is a one-time evaluation task: run both against your own prompts and attack samples, and record the detection results before you commit. AlignmentCheck in LlamaFirewall requires a Together API key, so its usage is billed by Together. Confirm the Together pricing model and expected call volume with Together and your team, because that cost grows with agent traffic.

Separate one-time and recurring costs before you compare totals. One-time items include integrating garak's generators or LlamaFirewall's scanners into your systems, the Prompt Guard size evaluation, and a licence review of the Llama 4 Community License that covers Llama Guard 4 and Prompt Guard 2, which you should confirm with counsel. Recurring items include hosting for Llama Guard 4, Together usage, garak run time and upgrades. Both stacks need runtime maintenance: garak requires Python 3.11 or newer, LlamaFirewall requires Python 3.10 or newer, and LlamaFirewall 1.0.3 is the latest release on PyPI, so plan for dependency updates as well as model updates. For a written quote, ask the implementer to state the scanners and model sizes in scope, the generation count and target count per test run, who pays for GPU capacity and Together usage, how upgrades and retests are priced, and who signs off on the Llama licence terms.

Moving between garak and Purple Llama without rebuilding everything

Teams that already run garak scans or Purple Llama guards can add the other side without starting over. The sequence keeps test evidence and attack configurations, then puts a guard in front of the model and reruns the same probes so the effect is measured. Expect to rebuild thresholds, application integration and CI jobs.

  1. Inventory probes, detectors and generator configs

    List every garak probe the team runs, the detectors each one uses under the default probewise harness, and the generator configuration that connects garak to the target. For a custom REST endpoint, that configuration is a short YAML file, so keep it in version control beside the scan commands. Then list each Purple Llama component in use, such as Prompt Guard, Llama Guard or LlamaFirewall, and note where it sits in the request path. The two tools are not interchangeable: garak generates attacks to test a model, while Purple Llama classifies inputs and outputs at runtime. Done when one inventory maps every check to its tool, its target and its owner.

  2. Archive existing JSONL reports and garak.log

    Copy every existing JSONL report, which records each attempt and its evaluation, along with the hit log and garak.log into a dated evidence store before any new run starts. garak.log continues across runs, so a new scan would otherwise append to a file that reviewers may be reading. Record the garak version, the target model or endpoint version and the probe list beside each archive so the evidence stays readable later. Done when the team can open an archived run and confirm which target and configuration produced it.

  3. Re-run the garak baseline against the target

    Run the same probes, with the same generator configuration, against the model endpoint as it runs today, before any guard is added. garak makes 10 generations per prompt by default and marks a probe FAIL when any attempt produces undesirable output, so the baseline should use the same settings as the archived runs or the comparison will mislead. Record the failure rate for each probe from the new report. Done when the baseline report sits beside the earlier runs and the team has confirmed its settings match the old ones.

  4. Add Prompt Guard 2 or LlamaFirewall in front

    Place the guard between users and the model, in the application or gateway code path. Prompt Guard 2 comes in 86M and 22M versions, and LlamaFirewall bundles PromptGuard 2 with other scanners. It installs with pip install llamafirewall on Python 3.10 or later, while garak needs Python 3.11 or newer, so keep them in separate environments. AlignmentCheck requires a Together API key, so confirm the data flow with your security team before enabling it. Switching usually means adding a second tool, because the guard filters traffic at runtime and does not generate attacks. Done when staging blocks a set of known injection prompts and each block is logged.

  5. Rerun garak against the guarded stack

    Point the same garak configuration at the guarded application endpoint so the scan measures what users actually reach. Compare the new JSONL report and hit log with the baseline, probe by probe. Expect fewer hits on prompt injection and jailbreak probes, and check any probe that now fails more often, since that can point to a guard that rewrites output or fails open. Done when the team has a per-probe table of baseline and guarded failure rates, archived with both runs.

  6. Retest and recalibrate classifier thresholds

    Send a benign set of representative business prompts through the guard alongside the garak attack prompts, because a threshold that blocks every attack may also block legitimate requests. Adjust the Prompt Guard score cutoff or the LlamaFirewall configuration in small steps, rerun garak after each change, and log the false positive count. Threshold values do not carry over from garak, so the team rebuilds them and the guard integration code. Done when the threshold set is documented with its benign and attack results and the owner has signed off.

  7. Wire checks into CI and retire old ones

    Keep the archived JSONL evidence, attack configurations and written policies, since those transfer to the new setup. Rebuild the CI jobs: add the garak scan as a scheduled or pipeline job against the guarded endpoint, and add guard tests to the application pipeline. Keep the old check running in parallel until the new jobs complete the cycle the team agreed on, then retire it and mark it retired in the inventory. Done when every check is listed as active, replaced or retired, and each replacement has a passing run in CI.

Where garak and Purple Llama projects usually run long

garak projects usually stall at the target endpoint, and installing the tool is the smallest step. The package installs from PyPI with pip and requires Python 3.11 or newer, so confirm that runtime on the host that will send the attacks. The slower work is the generator configuration. For an internal service, garak needs a short YAML file describing the REST endpoint, including how requests are shaped and where the plaintext or JSON response is read. Ask the application owner for a non-production endpoint that runs the same model version and guardrails as production, plus a test identity with the permissions an ordinary user has. Settle report retention before the first run too. Each run writes a JSONL report of every attempt, and a garak.log file carries across runs. Both can contain sensitive prompts and model outputs, so decide where they are stored, who can read them and how long they are kept.

Purple Llama is a set of components, so its setup begins with choices. Pick the models first: Llama Guard 4 is a 12-billion-parameter multimodal classifier, and Llama Prompt Guard 2 comes in 86M and 22M parameter versions, where the 22M version trades minimal performance for lower latency and compute according to its model card. Then decide where inference runs, since hosting the classifiers in your own infrastructure is part of the design. LlamaFirewall README installs with pip install llamafirewall on Python 3.10 or later, and its scanners must be wired into the agent or chat loop. That wiring is application engineering your team or partner owns. If you enable AlignmentCheck, it needs a Together API key, so confirm with security and procurement where that traffic goes and whether your data rules allow it. Finally, review the Llama license for every model you deploy, since Llama Guard 4 and Prompt Guard 2 fall under the Llama 4 Community License Agreement.

Four things stretch both projects: access to the target endpoint, detector tuning, agreeing who triages findings and license review. garak's default harness runs each probe with its recommended detectors, and a probe is marked FAIL when any of its 10 generations per prompt produces undesirable output. Teams therefore spend time deciding which flagged outputs are genuine failures. Purple Llama's classifiers need the same calibration against your own traffic, including which labels your application blocks on. Before the first run, name one owner for each finding, who can accept a risk and how retests get scheduled, because unresolved triage blocks sign-off. Confirm the timeline against the written scope before work starts. Most DeployOpen engagements are fixed-scope, so endpoint access, triage ownership and license review should be written into that scope with dates agreed up front.

How much effort does garak vs Meta Purple Llama take to run?

Can garak and Meta Purple Llama run together in one pipeline?

Yes, they can, because they do different jobs at different points in the stack. garak sends attack prompts to a target and reports which attempts got through, so you point it at a model endpoint or application. LlamaFirewall or Llama Guard sits in the request path and screens prompts and responses while the application runs. A common arrangement is to scan the endpoint with garak before release, then place the Purple Llama components in front of production traffic and re-run garak against the protected endpoint to see what changed. Whether that works depends on how your serving path is built, so confirm where the guard can be inserted before you plan the test.

Does garak replace a runtime guardrail like Llama Guard?

No. garak is a scanner that finds weaknesses by running attacks and recording the results, while a runtime guardrail such as Llama Guard or Prompt Guard classifies live inputs and outputs and decides what to block. garak uses detectors to judge each response and writes a JSONL report of every attempt plus a hit log of attempts that found a vulnerability. That output feeds a fix backlog but does not stop traffic on its own. Teams that need blocking at runtime still need a guardrail, and teams that need pre-release evidence still need a scanner. Ask your team whether the goal is evidence of weakness, live protection, or both, because that answer decides whether you budget for one tool, the other, or both.

What drives the effort to run garak?

The main drivers are the target you connect, the probes you select, and how many attempts each run makes. garak installs from PyPI with pip, and the package requires Python 3.11 or newer. Hosted models on supported generators are usually a configuration task. A custom application needs a REST generator, described in a short YAML file that matches your endpoint's request and response format. By default garak makes 10 generations per prompt, so wider probe sets multiply the calls your model receives, which matters if the endpoint is metered. The garak user guide covers the generator options. Each run also writes a JSONL report and a garak.log file, so someone on your team must read the hit log and decide which findings are genuine defects. Ask any partner to scope the target types, probe set and triage workflow in writing before work starts.

What does Meta Purple Llama take to run in practice?

Effort depends on which component you adopt, because Purple Llama spans evaluations, classifier models and a framework. LlamaFirewall installs with pip install llamafirewall, needs Python 3.10 or later, and ships demos for OpenAI Agents and LangChain. Its AlignmentCheck scanner requires a Together API key, so review that external dependency and its data handling before you enable it. Llama Guard 4 is a 12-billion-parameter model, so you need inference hosting with enough hardware for it, and you should confirm the sizing against the model card. The Prompt Guard 2 model card says the 22M version cuts latency and compute costs by 75% with minimal performance trade-offs, which lowers hosting effort if it meets your accuracy bar. Plan the work around model hosting and scanner tuning, and treat the pip install as the smallest step.

Can our team run these tools without an implementation partner?

Often yes, for a team with Python skills and a named owner for findings, but the answer also depends on your environment. A team that can install packages, write a generator config and read a JSONL report can run a first garak scan. Running Purple Llama components in production adds model hosting, access control, logging and change control, and that is where internal effort usually grows. A partner earns its place when you need the work scoped, tested and documented for an assessment. DeployOpen plans, implements, integrates, hardens and documents self-hosted open-source platforms inside the client's own infrastructure, and it also runs AI security testing. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. DeployOpen does not publish a price list, so a quote follows from that written scope.

Does the Llama license allow commercial use, and who should decide?

The answer depends on which component you deploy, so confirm each one before you ship. Purple Llama licenses its evals, benchmarks and Code Shield under MIT, but its models use the matching Llama Community License, such as the Llama 3.2 Community License for Llama Guard 3 and Prompt Guard. Llama Guard 4 and Llama Prompt Guard 2 ship under the Llama 4 Community License Agreement, and LlamaFirewall is MIT licensed. garak is Apache 2.0, which is a separate decision. Read the license text for the exact model version you deploy, because model terms can differ from repository terms. Your legal or procurement team should make the call, with the security lead supplying the list of components and versions in use.

Do garak or Purple Llama support SSO or identity integration?

Confirm SSO or identity integration for both tools with each maintainer before you plan access control, because it is not something to assume for command-line tools and libraries. garak runs from a command line, so access control usually sits with the host, the CI runner and the credentials for the model endpoint it calls. Purple Llama's components are libraries and models, so any login or SSO comes from the application or serving layer you build around them. Ask whether any admin interface or hosted service exists for either tool, and ask your partner how scanner credentials, API keys and report storage will be restricted. Document the answer for your access review, since auditors will ask who can run scans and read the hit logs.

How DeployOpen helps choose, implement and test these tools

DeployOpen starts by sorting out which tool tests your models and which one guards them at runtime, because garak is a scanner and Purple Llama bundles benchmarks with safeguards. We then plan, build and document the chosen tools inside your own infrastructure, with scope agreed in writing before work starts.

How we scope

  • The written scope names which garak probes or Purple Llama classifiers cover your models and applications.
  • License review covers garak's Apache-2.0 terms and Purple Llama's split between MIT tools and Llama Community License models.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any work starts.

How we build

  • Install garak from PyPI on Python 3.11 or newer and configure a generator for each endpoint under test.
  • Place Llama Guard 4 or LlamaFirewall in the request path and log their decisions to your own systems.
  • Confirm the Together API key requirement for LlamaFirewall's AlignmentCheck before approving any data flow.

How we hand over

  • Handover documents the garak JSONL attempt report and hit log, so your team can read each failed probe.
  • Runbooks record which Llama Community License terms apply to each model file kept in your environment.
  • Written documentation supports your compliance team's review, though DeployOpen does not issue audit reports or certifications.

How we support

  • Retainers can cover upgrades as garak and Purple Llama publish new releases in their repositories.
  • Continuous testing can rerun garak scans on a retainer schedule, with fixes retested after each change.
  • Ask whether the retainer covers Llama model license changes and garak probe updates before signing.

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.