PyRIT vs Meta Purple Llama

PyRIT is an MIT-licensed framework for attacking your own AI systems. Purple Llama is Meta's set of guard models and LlamaFirewall for runtime checks. Pick by whether you need to test or to guard first.

On this page

PyRIT vs Meta Purple Llama: which should you choose?

Choose PyRIT when your team must show that its LLM application resists attacks. Choose Meta Purple Llama when your team must screen prompts and responses while the application runs. PyRIT, Microsoft's Python Risk Identification Tool, is an MIT-licensed attack framework, and its v1.1.0 release was published on September 4, 2026. Purple Llama is a set of Llama-licensed classifiers, including Llama Guard and Prompt Guard, plus LlamaFirewall, which is MIT licensed. So PyRIT fits testing and Purple Llama fits guarding. Many teams need both: PyRIT to find failures before release, and a classifier layer to screen traffic in production.

Three questions decide the choice in practice. First, can your team script and maintain attacks? PyRIT is a Python framework of targets, converters, scorers and multi-turn attacks such as Crescendo, TAP and Skeleton Key, as described in the PyRIT documentation. It pays off when someone on the team writes attack configurations, reviews scorer output and reruns the suite after each model or prompt change. Teams without that capacity should start with a runtime layer or a scanner with ready-made probes, and confirm that the scanner covers the attack classes they need. Second, which license terms can your organization accept? Purple Llama's classifiers ship under Llama Community Licenses, so legal review should happen before adoption. The models you point PyRIT at carry their own terms as well.

Third, can your team host classifier models? Llama Guard 4 is a 12-billion-parameter model, and Prompt Guard 2 comes in 86M and 22M parameter versions. Self-hosting them means GPU or CPU capacity, model serving and patching, all of which is recurring work. PyRIT is not free of this question either, because its LLM scorers need a model endpoint to judge responses. LlamaFirewall's AlignmentCheck scanner requires a Together API key, so confirm that an external service is acceptable before it sits in a regulated data path. If your team cannot host classifiers yet, start with testing and add a runtime layer once hosting and licensing are settled. Confirm exact versions and terms in Meta's model cards before you commit.

Which scenario points to PyRIT and which to Purple Llama

This table matches common team scenarios to the tool that fits each one and states the condition under which that choice holds. Read each row against your own system, since testing attacks and screening live traffic are different jobs. Purple Llama's models carry Llama Community License terms, so check those terms before choosing a model-based guard.

ScenarioBetter fitWhy
Pre-release red teaming of a chatbotPyRITChoose it when you script multi-turn attacks and need results stored in SQLite or Azure SQL for review.
Multi-turn attack testing of a web appPyRITFits when the chat sits behind a web UI, since PyRIT can drive web apps through Playwright and run Crescendo or TAP strategies.
Runtime prompt injection screening before an agentPurple Llama (LlamaFirewall with Prompt Guard 2)PyRIT tests attacks but does not screen live traffic. Prompt Guard 2 ships under Llama 4 Community License terms.
Checking LLM-generated code before it shipsPurple Llama (CodeShield in LlamaFirewall)Fits when generated code is in the eight supported languages and your pipeline can run Semgrep and regex rules. CodeShield is MIT licensed.
Team that must avoid model license terms entirelyPyRITAvoid Llama Guard and Prompt Guard, which carry Llama terms. Confirm the license of any LLM scorer you add.
Scored attack records for an internal compliance reviewPyRITIts memory layer records conversations, scores and results in SQLite or Azure SQL. Confirm what Purple Llama tools log before relying on them.
Self-hosted classifier for prompts and responsesPurple Llama (Llama Guard 4)Fits when you need a 12-billion-parameter classifier scoring prompts and responses. Llama 4 Community License terms apply; confirm hosting capacity.

How PyRIT and Purple Llama are built, and what that means for running them

The two tools are built from different units. PyRIT is one Python framework that you wire to your own targets and memory store, while Purple Llama ships separate models and a framework layer that each need their own install, serving or key management. The cards below set out what each component asks of your infrastructure before you commit.

PyRIT is a Python framework

PyRIT is a library of targets, converters, scorers, attacks and memory that your team assembles into tests. You can run it through pyrit_scan, through CoPyRIT for human-led red teaming, or through custom Python. Operationally, every model or web app under test needs a reachable endpoint configured as a target, and credentials are read from ~/.pyrit/.env. Conversations and scores go to a memory store in SQLite or Azure SQL, which holds attack prompts and model outputs, so decide who can read that database before the first run.

PyRIT docs

Llama Guard 4 is self-hosted

Llama Guard 4 is a 12-billion-parameter classifier pruned from Llama 4 Scout. It labels both prompts and responses against the MLCommons hazards taxonomy, and it replaces Llama Guard 3-8B and 3-11B-vision in one model. Your team must host it, so you own the GPU capacity, model serving, scaling and the latency budget for every request the classifier screens. Measure that budget on your own hardware, and confirm the Llama 4 Community License Agreement fits your use before deployment.

Llama Guard 4 model card

Prompt Guard 2 for injection

Prompt Guard 2 comes in 86M and 22M sizes. Each labels a prompt benign or malicious to flag prompt injection and jailbreak attempts, within a 512-token context window. The 22M version is based on DeBERTa-xsmall, and its model card says it cuts latency and compute by 75% with minimal performance trade-offs, while the 86M version is multilingual. Choose the size by weighing language coverage against latency, decide how to handle inputs longer than 512 tokens, and verify both choices on your own traffic.

Prompt Guard 2 model card

LlamaFirewall layers scanners

LlamaFirewall is an MIT-licensed framework, installed with pip install llamafirewall, that layers PromptGuard 2 for direct prompt injection, AlignmentCheck for auditing agent reasoning, CodeShield for insecure generated code, and regex or custom scanners. It runs inside your application process and needs Python 3.10 or later. AlignmentCheck requires a Together API key, which adds an external service dependency and a credential to manage. Enable only the scanners you need, because each one brings its own model, service or rules to maintain.

LlamaFirewall README

How a PyRIT test run and a LlamaFirewall check fit into one stack

The top path is the red team loop. PyRIT attacks and converters send prompts to a target application inside your network, and PyRIT scorers judge each response and store conversations and results in PyRIT memory, which uses SQLite or Azure SQL. The bottom path is runtime. A user prompt passes through LlamaFirewall scanners before it reaches the LLM application, and the draft reply goes to an output classifier before the user sees it. If the application calls an external model API, that call crosses the trust boundary out of your network. Confirm how your framework wires the output check and where it sits relative to the model call.

Red team testing and runtime checks run as two separate paths in one stack.

PyRIT vs Meta Purple Llama, capability by capability

This table compares PyRIT and Meta Purple Llama row by row, from primary job to Python requirements and external dependencies. Read each row as a question about which tool you would run in your own pipeline, and treat any cell that says to confirm as an open item for your own tests. The main takeaway is that PyRIT is an attack-automation framework for red teams, while Purple Llama supplies guard models and scanners that you place in front of or beside a production application.

CapabilityPyRITMeta Purple Llama
Primary jobScripted multi-turn attacks and scoring against generative AI targets, for red teamersGuard models and scanners that classify prompts, responses, agent reasoning and generated code
LicenseMIT license; development continues at microsoft/PyRIT after the Azure repository was archivedMIT for CodeShield and LlamaFirewall; Llama 4 Community License for Llama Guard 4 and Prompt Guard 2
Attack or detection coverageAttack generation across content harms, psychosocial risks and data leakage datasets; scorers judge responsesDetection: Llama Guard 4 MLCommons hazard labels, Prompt Guard 2 injection labels, CodeShield insecure code
Multi-turn attack strategiesCrescendo, TAP and Skeleton Key attack strategies built inNot described as a multi-turn attack generator; confirm in the repository and your own tests
Runtime guard modelsDoes not act as a runtime guard; it tests targets and scores responsesLlama Guard 4 12B classifies prompts and responses; Prompt Guard 2 has 86M and 22M versions
Agent reasoning audit and generated code scanningScorers use LLMs, Azure AI Content Safety or custom logic; confirm whether any is built for agent auditsAlignmentCheck audits agent reasoning; CodeShield scans generated code in 8 languages with Semgrep and regex
Python requirementsPyPI package supports Python 3.10 up to but not including 3.15; docs recommend 3.13Python 3.10 or later, installed with pip install llamafirewall
Persistence and operator interfaceMemory stores conversations, scores and results in SQLite or Azure SQL; CoPyRIT provides a web GUIConfirm in the repository whether it stores results and whether a GUI is included
External service dependenciesScorers may call Azure AI Content Safety or an LLM; confirm which calls leave your networkAlignmentCheck needs a Together API key; confirm which other scanners call outside services

Why the Purple Llama license depends on which component you ship

PyRIT is a testing framework. You script attacks against a target, review the scored results, and run it from your own environment, so it does not sit in your request path as a filter. Its code is MIT licensed. The original Azure/PyRIT repository was archived on 27 March 2026 and is read-only, so development continues at microsoft/PyRIT.

  • Repository location: Update git remotes, CI pins and package references that still point to the archived Azure path, or your builds will track a repository that receives no changes.
  • Current release: v1.1.0 was released on 4 September 2026. Check the releases list before you pin a version for production testing.
  • Runtime: The PyPI package supports Python 3.10 up to but not including 3.15, and the documentation recommends Python 3.13.
  • Memory and credentials: Conversations and scores are stored in SQLite or Azure SQL, and credentials are read from ~/.pyrit/.env. Attack transcripts can contain sensitive material, so confirm where the database sits and who can read it.
  • Cost components: PyRIT itself is MIT licensed, and this page lists no paid edition. Your recurring costs are staff time and the model endpoints you use as targets and scorers, so ask Microsoft directly about any commercial support options.

Before rollout, confirm that the MIT license covers the exact package version you deploy, and have legal confirm the terms of every model endpoint PyRIT calls.

What drives the running cost of each, and what to put in a quote

The two tools cost money in different places. PyRIT spend sits mostly in model calls and in the engineers who script and review attacks, while Purple Llama spend sits mostly in hosting classifiers and integrating them into your request path. Each card marks what is one-time and what recurs, and the quote should price every line.

Hosting for the classifiers

Hosting recurs for as long as the guardrail runs. Deploying Llama Guard 4 and Prompt Guard 2 is a one-time setup, but Llama Guard 4 is a 12-billion-parameter model, so you carry GPU or CPU capacity, storage and the model server for production traffic. Prompt Guard 2 is lighter. Its model card says the 22M version, based on DeBERTa-xsmall, cuts latency and compute costs by 75% with minimal performance trade-offs. Ask the quote for the hardware profile, the replica count at peak load, and who patches the model server. This line belongs to the Purple Llama side.

Prompt Guard 2 model card

Model API calls and scoring

Model API calls recur and scale with test volume. PyRIT sends requests to an attacker model that writes prompts, to the target under test, and to any LLM scorer that grades responses. Those calls go to providers such as OpenAI, Azure, Anthropic, Google or Hugging Face, and you pay each provider through your own account. Multi-turn strategies such as Crescendo, TAP and Skeleton Key make many calls per objective, so spend follows attack count and conversation length. Ask the quote for the expected call count per test run, the model assigned to each role, and whose provider keys are used.

PyRIT documentation

Engineering time for attacks

Engineering time recurs because models and targets keep changing. With PyRIT, engineers script attack flows, keep target connectors working, and review scorer output and stored results after each run. A model upgrade can change a target's responses and break a script, so that work repeats. Purple Llama moves most of the effort into integrating classifiers into your request path and tuning them against your own traffic. Ask the quote for the named roles, the expected work after each model change, who reviews results, and who owns the scripts after handover.

Third-party accounts and databases

Each external dependency adds a setup task and an ongoing account. LlamaFirewall's AlignmentCheck scanner requires a Together API key, so you need an account, key rotation, and a check of what content is sent to that service before you enable it. PyRIT memory runs on SQLite or Azure SQL. Switching from SQLite to Azure SQL is a one-time integration, while the database service, backups and access reviews recur. Ask the quote who provisions and pays for each service, and where the credentials live, including entries in ~/.pyrit/.env.

LlamaFirewall README

Moving from PyRIT to Purple Llama, or the reverse: what transfers and what gets rebuilt

PyRIT and Purple Llama usually complement each other, so moving between them often means adding the other tool rather than replacing one with the other. The sequence below shows which artifacts carry over, which controls must be rebuilt, and how to confirm that coverage holds after cutover. The same steps apply in reverse.

  1. Inventory current controls and their owners

    Before either tool changes, list every test and control that depends on PyRIT or Purple Llama. Include target configurations, converters, scorers, multi-turn attack strategies such as Crescendo, TAP or Skeleton Key, and any scheduled runs. Record one named owner for each item, the team that reviews its results, and whether it tests the system (PyRIT) or checks traffic at runtime (Purple Llama). Done when every item has an owner and a stated purpose.

  2. Export datasets, scorer criteria and memory records

    Keep the attack datasets, the scorer criteria and the conversation and score records exported from PyRIT memory, which is stored in SQLite or Azure SQL. Store them as plain files labeled with the PyRIT version that produced them, such as v1.1.0 released on September 4, 2026, so results stay traceable. These artifacts transfer. The memory schema, the Python environment pins and the license acceptance do not, so the new environment starts from a clean install and imports records through a script your team writes and tests. Done when a sample of exported records opens without PyRIT installed and the record counts match the source database.

  3. Rebuild targets as guards where needed

    A PyRIT target sends attacks to a system under test, so it does not carry over as a runtime control. Keep scheduled red teaming in PyRIT, and add a guard only where the application needs a check in the request path. Prompt Guard 2 labels prompts as benign or malicious for prompt injection and jailbreak attempts, and LlamaFirewall layers scanners across chat models and agents. Confirm licenses before adoption: Llama Guard 4 and Prompt Guard 2 ship under the Llama 4 Community License Agreement, while LlamaFirewall is MIT licensed. Done when each guard has a documented call point, a named owner and a completed license review.

  4. Map Llama Guard categories to your policy

    Llama Guard 4 classifies both prompts and responses against the MLCommons hazards taxonomy, and it replaces the earlier Llama Guard 3-8B and 3-11B-vision models in one model. Your policy has to be mapped onto those categories, so build a table that lists each category, the action your application takes and any blocking threshold you set. Treat the thresholds as your team's decision and review them with compliance. Confirm with the vendor, and with your own tests in your languages and content, how the model behaves before you rely on it. Done when every category has a documented action and a reviewer has approved the threshold settings.

  5. Rerun the same attack set after cutover

    Run the exported attack dataset against the system with the new controls in place, using the same targets, scorer settings and record format as the baseline run. Compare results category by category so that each difference can be traced. Expect some differences because PyRIT scorers and Purple Llama classifiers judge output in different ways, so a changed result needs review before it is treated as a regression or an improvement. Done when both runs are stored with their tool versions and each difference has a written explanation.

  6. Decommission the retired tooling

    Once the rerun meets the acceptance criteria your team agreed on, retire the old pipeline. Remove scheduled jobs that call the retired tool, revoke the credentials kept in ~/.pyrit/.env on test hosts, and delete any setting in ~/.pyrit/.pyrit_conf that no other job uses. Archive the final memory database under your retention policy before deletion, and confirm the archive opens. If the red team still uses PyRIT for scripted attacks, keep that installation and document its scope. Done when no scheduled job references the retired tool, the credentials are revoked and the archive is readable.

Where PyRIT and Purple Llama projects usually run long

PyRIT projects usually spend their longest stretch on target connectors, and the install is the short part. Pin the interpreter first: the PyPI package supports Python 3.10 up to but not including 3.15, and the documentation recommends Python 3.13, so set that version in your build image. Then check the two local files PyRIT reads, ~/.pyrit/.env for credentials and ~/.pyrit/.pyrit_conf for settings, since shared jump hosts make these files easy to copy and overwrite. Built-in targets cover OpenAI, Azure, Anthropic, Google and Hugging Face models, but a custom HTTP or WebSocket endpoint must be mapped to your request and response format by hand. Playwright-driven web apps behind SSO often take longer, because the test session needs an identity that your identity team agrees to provision and rotate.

Purple Llama projects run long on decisions that sit outside the code. Llama Guard, Prompt Guard and the other classifiers are models you host, so the client's platform team sets serving hardware, latency targets and capacity for prompt and response traffic. Confirm license acceptance for each model before anything is pulled into a build: Llama Guard 4 and Llama Prompt Guard 2 ship under the Llama 4 Community License Agreement, per the license files in the PurpleLlama repository, and your legal team has to accept those terms. Thresholds come next. Prompt Guard 2 labels prompts benign or malicious, and the cut-off that blocks a request is a risk decision that should be tuned on your own traffic and recorded alongside the test set used to set it.

AlignmentCheck, the scanner in LlamaFirewall that audits agent reasoning, requires a Together API key, so it adds an external service to the data path. Put that dependency through security approval before design starts, and write down which data classes may reach it, how long they are kept and who owns the key. Ask the implementation partner to list these as separate line items in the written scope, along with the connector work and the classifier hosting plan, since these items usually decide the timeline. This page does not give a duration. For PyRIT, clone from microsoft/PyRIT on GitHub; the original Azure/PyRIT repository was archived on 27 March 2026 and is read-only.

Can one team run PyRIT and Purple Llama, and what does it take?

Can our own engineers run PyRIT and LlamaFirewall ourselves?

Often yes, if one team has Python skill, security testing experience and enough time to own the work over the long term. PyRIT installs with pip on Python 3.10 up to but not including 3.15, and its documentation recommends Python 3.13. LlamaFirewall also installs with pip and needs Python 3.10 or later. The harder work is the surrounding setup: choosing targets, configuring scorers, storing results in SQLite or Azure SQL, and deciding who reviews findings. A workable split is one engineer building the test harness and a security reviewer judging the results. If one of those pieces needs skills your team lacks, plan outside help for that piece only.

What drives the cost of running PyRIT and Purple Llama?

Most of the open-source code is free to use, so the cost comes from people, compute and external services. PyRIT and LlamaFirewall are MIT licensed, but Purple Llama's models use Llama community licenses, so review those terms as part of cost planning. The main cost drivers are:

  • Engineering time to build targets, scorers and identity connections, which grows with the number of applications tested.
  • Compute to host guard models such as Llama Guard or Prompt Guard, sized to your traffic.
  • Usage fees when PyRIT scorers or attack models call a hosted LLM, billed under that provider's terms.
  • A Together API key for LlamaFirewall's AlignmentCheck scanner, billed under that provider's terms.

Ask for any quote to show engineering, hosting and third-party usage as separate lines.

Which parts of a PyRIT rollout are one-time and which recur?

Setup work is one-time, while hosting, usage fees and retesting recur. One-time work includes target and scorer design, identity integration, memory setup, the first test suite and documentation for your reviewers. Recurring work includes:

  • Hosting and monitoring of any guard models in your request path.
  • Usage fees for scorer and attack model calls.
  • Upgrades when PyRIT changes, including v1.0.0 on July 24, 2026 and v1.1.0 on September 4, 2026. Confirm you track microsoft/PyRIT, since the original Azure/PyRIT repository is archived. PyRIT releases on GitHub
  • Retesting after model, prompt or tool changes.

Ask which items sit in the first quote and which move to a retainer.

What sets how long a first PyRIT deployment takes?

The length of a first deployment depends on scope, the number of targets, identity setup, scorer design and hosting, so no single duration applies across teams. Each factor changes the work:

  • Scope: how many attack categories and multi-turn strategies, such as Crescendo, TAP or Skeleton Key, you test.
  • Targets: each model endpoint, custom HTTP or WebSocket service, or web app driven through Playwright needs its own connection and checks.
  • Identity: SSO, service accounts and the local credentials file under ~/.pyrit/.env must match your security standards.
  • Scorer design: LLM judges, Azure AI Content Safety or custom logic each need validation against known outcomes.
  • Hosting: where the memory database, the runner and any guard models sit.

Ask for a written timeline tied to these factors, since DeployOpen agrees scope, deliverables and timelines in writing before work starts.

What skills does a team need to run PyRIT and LlamaFirewall?

Your team needs four skill sets, and at least one person should hold each before the project starts:

  • Python, to write targets, converters, scorers and custom attacks in PyRIT and to wire LlamaFirewall into your application.
  • Security testing, to design attack scenarios, judge scorer output and turn findings into fixes.
  • Model hosting, to run guard models and any local targets on infrastructure you control.
  • Identity administration, to connect SSO, service accounts and role access so tests run under the right identities.

Check each skill against your team roster, because a gap in any one of them usually stretches the first deployment.

Can Purple Llama replace PyRIT for multi-turn attack testing?

Probably not. Based on its component list, Purple Llama provides classifiers, benchmarks and a guard framework, with no multi-turn attack engine comparable to PyRIT's. Confirm this against the current Purple Llama repository before you decide. The tools answer different questions. PyRIT tests whether your system can be pushed into unsafe behavior across a conversation, using strategies such as Crescendo, TAP and Skeleton Key. LlamaFirewall and Llama Guard screen traffic at runtime, including prompt injection, risky agent actions and insecure generated code. Many teams therefore evaluate both: PyRIT before release, and guard models in the request path after release.

Should we review Llama license terms before rolling out Purple Llama?

Yes, review the license terms before rollout, because Purple Llama's components do not share one license. Its evals, benchmarks and Code Shield are MIT licensed, while its models use the matching Llama community license. Llama Guard 4 is listed under the Llama 4 Community License Agreement in the repository's LICENSE file, Llama Guard 4 LICENSE. Older Llama Guard and Prompt Guard releases can carry different terms, so check the license file for each model version you deploy. PyRIT is MIT licensed, so its review focuses on the external model services you connect it to. Ask counsel to confirm that your use and products fit the terms, and record that decision for your compliance team.

When should we hire an implementation partner for PyRIT?

A partner or managed service makes sense when your team lacks one of the skills above, or when the first deployment must finish against written deliverables. DeployOpen plans, implements, integrates, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, and most engagements are fixed-scope. Ongoing support, upgrades and continuous testing are available as retainers. DeployOpen does not publish a price list, so a quote follows from the written scope. For compliance, DeployOpen prepares systems, controls and evidence for assessments, but independent auditors and certification bodies issue the reports. Ask any partner to document the work so your team can run it after handover.

How DeployOpen helps choose, implement or migrate without favoring either tool

DeployOpen helps you choose between PyRIT and Meta Purple Llama, or implement or migrate to either, by first mapping the attack testing and guardrail needs in your environment. We do not start from a preferred tool, and we implement only the components your written scope names. DeployOpen is a Chainscore Labs company and is not a partner or reseller of either project.

How we scope

  • We start by mapping whether you need attack testing, guardrails or both, since the tools answer different questions.
  • The written scope names the endpoints, data stores and identity settings each tool will touch.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • For PyRIT, we set up the Python framework, memory database and target connectors inside your own infrastructure.
  • For Purple Llama, we deploy the classifiers or LlamaFirewall components you select and wire them into your application path.
  • We document each license that applies, since Purple Llama models and code carry different license terms.

How we hand over

  • Handover covers configuration files, runbooks, access settings and the audit logging you need for review.
  • You receive a record of the PyRIT version and Purple Llama components deployed, with their licenses.
  • Security testing findings come with the attack methods used, the evidence and suggested fixes.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • PyRIT's original Azure repository is archived, so confirm the upstream source before each upgrade.
  • AlignmentCheck needs a Together API key, so confirm that dependency with your security team before scoping.

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.