Running garak probes as PyRIT scenarios

PyRIT's garak scenario family brings NVIDIA garak's probe ideas into PyRIT's targets, scorers and memory. This page explains what each scenario covers and when to run it in PyRIT rather than garak itself.

On this page

Running garak probes as PyRIT scenarios: what the family covers

Your team already uses PyRIT, or is evaluating it, and wants the attack patterns that NVIDIA's garak is known for without learning a second tool. PyRIT's Garak scenario family answers that need. It implements probes inspired by NVIDIA garak across six areas: encoding, web injection, a Doctor probe that applies the Policy Puppetry bypass, system prompt extraction, package hallucination, an audio probe, and FigStep visual jailbreaks. These probes run through PyRIT's own targets, scorers and memory, so results land in the same store as your other PyRIT work. Treat the family as a reimplementation of those probe ideas inside PyRIT, not a copy of the garak command-line tool. Probe names, detectors and report formats will differ from garak's, and you should confirm the exact probe list in the scenario documentation for your PyRIT version.

The supported way to run these probes is the PyRIT scanner scenario, launched through the pyrit_scan command. Before you start, decide which target the probes will hit, which model or endpoint will score responses, and where the memory database will live, since those choices determine what you can compare across runs. Confirm that your Python version falls within the range the PyPI package supports and that credentials are set in ~/.pyrit/.env rather than in scripts. The scenario only tests what the target returns, so confirm that content filters and system prompts on the target match the configuration you intend to assess. Record that configuration with each run so a later reviewer can reproduce it.

This page covers prerequisites, setup, mapping each probe to the PyRIT components it uses, security considerations for the scan environment and stored results, testing approach, and the failure points teams most often hit. Read it before you commit to running garak-style probes in PyRIT for a production assessment. If your goal is a full garak run with its own harness, reports and plugin set, the garak project's own user guide remains the reference for that workflow.

Which garak-inspired scenarios PyRIT provides

PyRIT's Garak scenario family ports a set of probes inspired by NVIDIA garak into PyRIT's attack and scoring pipeline. The cards below cover each scenario by the attack idea it tests and what a team learns from the result. Exact parameters, probe lists and supported options should be confirmed in the PyRIT 1.1.0 Garak Scenarios documentation before you plan a run.

Encoding probes

The encoding scenario sends the same harmful objective in disguised forms, with 17 encodings including Base64, Base2048, Base16, Base32, ASCII85, hex, ROT13, Braille, Atbash, Morse code, NATO alphabet, Ecoji, Zalgo and leetspeak. The idea is that a model or filter trained on plain text may refuse the plain request but comply when it is decoded in its own reply. Teams learn whether their guardrails inspect only surface text. Confirm which encodings are enabled by default in the documentation.

Garak Scenarios docs

Web injection probes

Web injection probes place attacker instructions inside content the model is asked to read, such as a page or document, rather than in the user prompt. The attack idea is indirect prompt injection: the model follows instructions it encountered while doing a task. For applications that summarize web pages, read email or retrieve documents, this shows whether retrieved content can override the system's intent. Check how the scenario delivers the injected content to your target and whether your application passes that content to the model unchanged.

Doctor probe with Policy Puppetry

The Doctor probe applies the Policy Puppetry bypass, which wraps a request in a fictional or configuration-style frame that imitates an authoritative policy file. The idea is to make the model treat the harmful request as an approved instruction. Teams learn whether their model's refusals hold when the request is framed as a policy override rather than a direct question. Because this technique targets instruction hierarchy, it is most useful for applications where a system prompt sets safety boundaries.

System prompt extraction

The system prompt extraction scenario tries to make the model reveal its hidden instructions. The attack idea is that a model asked to repeat, summarize or translate its setup may disclose operator instructions, internal tool names or business rules. Teams learn whether confidential configuration can be recovered by a user. Treat any leaked content as a finding even if it seems harmless, because it shows what an attacker can read and reuse in later prompts.

Package hallucination probes

Package hallucination probes ask a model for code that depends on libraries, and check whether it invents package names that do not exist. The risk is that an attacker registers a malicious package under a name the model tends to invent, and a developer installs it from the model's suggestion. Teams learn how often their coding assistant produces unverified dependencies and whether their build pipeline checks package origin. Review the scoring logic in the documentation to see how a nonexistent package is detected.

Audio and FigStep visual jailbreaks

The audio probe delivers spoken versions of prompts to speech-capable models, and the FigStep probe renders harmful instructions as images with text in them, so that text-only filters do not see the request. The attack idea is that a safety layer tuned for text may not inspect other modalities. Teams learn whether multimodal inputs are covered by their guardrails. Confirm which audio and image formats the scenario accepts and which target types support them before scheduling a run.

When to run garak probes in PyRIT rather than in garak

Run the garak probes inside PyRIT when the evidence has to live in PyRIT. PyRIT keeps every conversation and result in one memory store, which it backs with SQLite or Azure SQL, and its scorers, targets and reporting apply the same way to garak scenarios as to PyRIT's own attacks. Choose this route if your team already runs PyRIT for other red teaming, if your objective targets sit behind Azure or Entra-based access, or if reviewers will work through the results in CoPyRIT, the web GUI for human-led red teaming. A single store also means one place to answer the question an auditor will ask: which prompts were sent, to which target, and what was the verdict.

Run garak itself when you want its own workflow intact. garak runs its default probewise harness, which executes each probe with its recommended detectors, and it writes a JSONL report of every attempt and its evaluation alongside a garak.log file that carries across runs. Its five plugin categories (probes, detectors, evaluators, generators and harnesses) and its default of 5 generations per prompt, which marks a probe as FAIL when any attempt produces undesirable output, are tuned for that model. Teams that already maintain garak configurations, or that want to compare results against the garak community's published probe behavior, will find it simpler to keep those reports as they are. Confirm the generation count and detector set you need before you compare the two sets of results, because a PyRIT scenario and a garak run do not necessarily apply the same settings.

The two tools can be used together, and many teams will want both. The practical question is where the evidence must live. If the evidence goes into a red teaming register, a compliance file or a shared memory store, run the scenario in PyRIT and export the results. If an engineering team needs the raw garak reports for its own triage, keep the garak run as well. Decide this before the first run, record which tool produced which result, and agree which set of numbers is reported upward so that the two outputs are not presented as if they were one result.

How to set up a garak scenario run in PyRIT

This sequence takes a team from a clean machine to a verified garak scenario run inside PyRIT, with credentials, the objective target and memory checked before any wider testing begins.

  1. Install PyRIT on a supported Python version

    The engineer installs the PyRIT package from PyPI with pip into a dedicated virtual environment. The PyPI package supports Python 3.10 up to but not including 3.15, and the PyRIT documentation recommends Python 3.13, so confirm the interpreter version before installing. Done means the package imports cleanly in that environment and the installed version matches the release you intend to test against, such as v1.1.0, which was released on 4 September 2026.

  2. Configure credentials and settings files

    The engineer places API keys and endpoint secrets in ~/.pyrit/.env and sets run defaults in ~/.pyrit/.pyrit_conf. Keep the credentials file out of version control and restrict its file permissions to the account that runs the tests. Done means a short Python check can read the expected variable names without printing their values, and no secret appears in shell history or logs.

  3. Choose and connect the objective target

    The team decides which system the garak probes will attack: an OpenAI or Azure deployment, a Hugging Face model, a custom HTTP or WebSocket application, or a self-hosted endpoint inside your network. Confirm the target's own content filters and rate limits, because they shape the results you will record. Done means one harmless test prompt returns a response through PyRIT and the response is stored in memory.

  4. Select the garak scenario to run

    The engineer opens the Garak Scenarios page in the PyRIT documentation and picks the scenario family that matches the risk under review, such as encoding, web injection, system prompt extraction, package hallucination, the Doctor probe, the audio probe or FigStep. Read each scenario's stated scope and any options it accepts before running it. Done means the scenario name and its configuration are written in the test plan with the owner who approved them.

  5. Run a limited pilot scope

    The engineer runs the chosen scenario with a restricted scope, such as a single encoding or a small subset of prompts, against a non-production target where one exists. The pilot shows how the target responds, how long a run takes on your setup and whether the target's limits interrupt the run. Done means the pilot completes or fails with a readable error, and the team has noted any adjustments needed for the full run.

  6. Verify memory records every conversation and score

    Before scaling, the engineer queries PyRIT memory, which stores conversations and results in SQLite or Azure SQL, and checks that each pilot attempt has a stored prompt, a target response and a score. Compare a sample of stored entries against the raw target output to confirm nothing was dropped or truncated. Done means the record count matches the attempts made and the team can export the conversations for review.

  7. Scale the run and keep the evidence

    Once the pilot checks pass, the engineer widens the scope to the full scenario and keeps the output with the test plan. Confirm with your security or compliance lead which artifacts they need, since the garak-style reports and the PyRIT memory records serve different reviewers. Done means the full run is complete, the memory export is archived with the scenario configuration and the run owner signs off on the results.

How a garak-style scenario moves through PyRIT

A garak-style scenario starts by selecting probe prompts and applying converters such as the encodings in the garak.encoding family. The transformed prompt crosses into the objective target, which is the only component that talks to the model or application under test. The response then goes to a scorer, and the attempt and its evaluation are written to PyRIT memory in SQLite or Azure SQL. Check that the credentials file and the target endpoint sit inside the boundary you intend to test, and that memory is stored where your evidence rules require.

Data flow for one garak-style attempt, with the target endpoint and credentials file inside a trust boundary.

Mapping scenario inputs, targets and results

This table maps the parts of a garak run to their PyRIT equivalents: target setup, credentials, scoring, memory and where results are read. Use it to check which garak outputs you can rely on inside PyRIT and which ones your team must confirm before treating a PyRIT run as comparable to a garak run.

ElementIn garakIn PyRIT garak scenarios
Target configurationGenerator selected on the command line or in a YAML config for REST and other endpointsTarget object configured in Python or through PyRIT settings; confirm which target classes the garak scenario accepts
Credentials fileProvider keys read from environment variables or garak configurationKeys read from ~/.pyrit/.env; confirm the variable names the scenario expects
Settings fileRun options passed as command-line flags or config filesSettings read from ~/.pyrit/.pyrit_conf; confirm which garak-specific options are honored
Probe selectionProbes chosen by module name, such as garak.encoding, on the command lineProbe families chosen as scenario components; confirm which encodings and probes are included in your version
Scorer choiceDetectors attached to each probe by the default probewise harnessScorers chosen for the scenario; confirm whether the garak detector logic is reproduced or replaced by a PyRIT scorer
Attempts per promptDefault of 5 generations per prompt, with FAIL marked on any undesirable outputConfirm how many attempts a scenario runs per objective and how that changes the failure rate
Memory locationRun results held in the JSONL report and garak.log in the run directoryConversations and scores stored in PyRIT memory, SQLite or Azure SQL; confirm the database path for your setup
Where results are readOpen the JSONL report and garak.log written for each runQuery PyRIT memory or export conversations; confirm that a per-attempt record with its evaluation is available for every run

Securing the target, credentials and results

Running garak probes through PyRIT puts model keys, endpoint configuration and every conversation the probes produce into one workflow. The four cards cover where credentials live, how the scan authenticates, what the stored records expose and how to report a flaw in PyRIT itself.

Keep credentials in one file

PyRIT reads credentials from ~/.pyrit/.env and settings from ~/.pyrit/.pyrit_conf, so every scenario that runs on that machine inherits the keys in that file. Restrict it to owner-only access for the account that runs the scan, keep it out of shared repositories and CI logs, and include only the keys each target needs. Scenarios that call a hosted model or a REST endpoint depend on this file, so a leaked key exposes every run that uses it. Rotate keys when someone leaves the team or when a shared workstation is retired.

PyRIT documentation

Prefer Entra ID and Key Vault

Where a target supports Microsoft Entra ID or Azure Key Vault, use it instead of a static key kept in the environment file. Identity-based access leaves no long-lived secret on the scanning machine and lets administrators revoke access centrally. Confirm support for each target on your scenario list, because some accept a token and others accept only a key. Where only a key is possible, keep it in Key Vault and load it at run time. Also review the YAML file that describes a garak REST endpoint, since any authentication headers in it carry the same risk as a stored key.

Treat stored conversations as sensitive

PyRIT memory records prompts, responses and scores in SQLite or Azure SQL. Garak-derived scenarios such as system prompt extraction or encoding probes can store payloads that try to expose hidden instructions or sensitive data, and responses may quote your application's own output. Treat the memory database as both evidence and exposure. Decide where the database lives, who can open it and how long it is kept before the first run. If a run also writes garak report and log files, give those the same handling, since they record every attempt and its evaluation.

Report PyRIT vulnerabilities privately

If a test shows that PyRIT itself is vulnerable, such as a flaw in how it handles credentials or stored records, do not open a public issue. Report it privately through the Microsoft Security Response Center under the project's security policy, which the repository README describes. Keep the finding and the payload that triggered it within your team until a fix is available. Weaknesses in the model or application under test follow your own disclosure process with that system's owner.

PyRIT repository

Common failures when running garak scenarios in PyRIT

This table lists the failures teams most often hit when running garak scenarios in PyRIT, with the likely cause and a practical fix for each. Read it before a first run, and again when a scenario fails or returns results that look wrong. Confirm version requirements and configuration keys against the PyRIT 1.1.0 documentation before you change your environment.

FailureLikely causeFix
Install or import failsThe Python version is outside the range the PyPI package supports, which is 3.10 up to but not including 3.15Check the interpreter version first. Use Python 3.13, the version the documentation recommends, in a clean virtual environment, and confirm the supported range in the 1.1.0 docs.
Scenario stops with an authentication errorCredentials are missing or misnamed in ~/.pyrit/.env, or the file is read from a different home directory than you expectConfirm the variable names the 1.1.0 documentation lists for your target, verify the file path under the account that runs the job, and never paste keys into scenario files or logs.
Target returns errors or empty repliesThe endpoint URL, path or request body does not match what the target expects, such as a chat completions path on a base URL or a missing JSON fieldSend one plain prompt to the endpoint with curl or the target's test call. Match the path, headers and body format exactly before running any garak encoding or probe.
Encoded prompts rejected or garbledEncodings such as Braille, Morse, Zalgo or Ecoji produce text that the target's input filter, tokenizer or length limits refuse or mangleRun a small subset of encodings first. Treat rejections as a finding to record, separate them from true refusals, and check the target's input length limits.
Scorer output is unclearThe scorer was not matched to the probe's expected output, or the detector returns a verdict the team cannot interpretReview a sample of attempts by hand, confirm the scorer and its criteria for each probe family, and record the reasoning with each verdict before you report a rate.
Results missing from memoryThe run used a different memory location than the one you query, or the memory database was not initialized in that sessionConfirm the memory backend (SQLite or Azure SQL) and its location in the 1.1.0 documentation, then query memory with the same configuration used for the run.
Failure rate looks inflated or inconsistentMultiple generations per prompt count any undesirable output as a failure, so one sample can drive the resultNote the generation count used in each run, compare runs with the same settings, and report the attempts behind a rate rather than the rate alone.

Questions buyers ask before running garak scenarios

Are PyRIT garak scenarios free to run?

The software is free to use. garak is licensed under Apache 2.0 and PyRIT is open source under the MIT license, so neither tool charges a license fee. The recurring costs come from the target and the models around it. Every probe attempt sends a request to the system under test, which may be billed per token or per call if it is a hosted model or a cloud endpoint. Scorers that use an LLM judge add more model calls on top. Infrastructure to run the tests, storage for the SQLite or Azure SQL memory, and the time of the people who review findings are also real costs. Ask your team to estimate attempts per scenario against the pricing of each model it calls before approving a run.

What drives the cost of a garak scenario run up?

Three factors matter most. The first is target choice: a hosted frontier model, a cloud endpoint and a local model on your own hardware carry very different per-call costs and rate limits. The second is the number of attempts. By default garak makes 5 generations per prompt, so the number of prompts in a scenario, multiplied by that generation count and by the number of encodings or variants selected, sets the request volume. The third is scorer model calls: an LLM-based judge adds a request for each response it scores. Reducing the scenario to the probes that match your application, and using a local scorer where your policy allows it, are the usual levers. Ask for the expected request count before the run starts.

How long does a first garak scenario run take?

Duration depends on the size of the scenario and on the rate limits of the target. A small encoding run against a local model can finish quickly, while a broader run against a rate-limited hosted endpoint can take much longer because retries and throttling add waiting time. Confirm the timing in your own environment: run one small scenario, record the time per attempt, and then multiply by the planned attempt count. Include time for setting up credentials, the endpoint configuration and the review of the JSONL report and garak.log output. The first run is usually the slowest because the team is also learning the setup.

What does the team need to provide before a run?

Four things are needed before a run. Endpoint access: a network path and a working test endpoint for the system under test, with a clear statement of what it is allowed to receive. Credentials: keys or tokens stored in ~/.pyrit/.env or a secrets manager, with the least privilege the test needs. A test plan: which probes or scenarios apply to the application, what counts as a failure, what data may appear in prompts and responses, and when testing may run. An owner for findings: a named person who triages results, decides which failures matter, and assigns fixes. Without the last item, a run produces a report that nobody acts on.

Can our team run garak scenarios in PyRIT on its own?

Yes, for a pilot against a standard target. PyRIT installs with pip on a supported Python version and the garak scenarios run from the same framework, so a security or ML engineer who is comfortable with the command line can start with a single endpoint and a small set of probes. Effort rises when the target is custom. An application behind its own API, a WebSocket service or a web chat that only exists in a browser needs a configured target, request parsing and a way to handle sessions, which takes more engineering. Plan for review time as well, because deciding which failures are real and which are false positives is the work that most often stalls internal teams.

Should we run garak scenarios in PyRIT or in garak itself?

Run them in PyRIT when you want the scenario results stored in PyRIT memory, when you need to combine garak probes with PyRIT attacks, scorers or converters, or when your team already uses PyRIT for other red teaming. Run garak directly when you want its own command-line workflow, its full set of probes and generators, or its JSONL report and garak.log without an extra layer. Both routes can reach the same kinds of targets. Choose one as the default for each program so results stay comparable across runs. The garak user guide at docs.garak.ai covers the standalone tool in detail.

What risks should we check before running probes against production?

Probes are designed to elicit unsafe or unexpected output, so they can produce harmful text, leak data that appears in prompts, or trigger rate limits and cost alerts on a live system. Run against a staging deployment that matches production controls wherever possible. Confirm with the model provider that automated adversarial testing is permitted under its terms. Restrict the credentials to the test environment, log every run, and agree on a stop condition. Treat generated content and reports as sensitive, since they can contain the prompts and responses that exposed weaknesses.

How DeployOpen scopes garak scenario testing in PyRIT

DeployOpen fixes the scope in writing before any scenario runs. The written scope names the target systems that PyRIT will reach, which garak scenario families apply to each (encoding, web injection, Doctor, system prompt extraction, package hallucination, audio and FigStep), and the evidence the client's security or compliance team needs at the end. For each target we confirm how it is reached, whether it is an OpenAI-compatible endpoint, a custom HTTP or WebSocket app, a web chat UI or a local model, because that choice determines which PyRIT target and garak scenario configuration is used. The scope also records who owns the objective, adversarial and scoring models, and whether any of them may call a public API.

Configuration happens inside the client's infrastructure. DeployOpen installs PyRIT, sets up its credential file at ~/.pyrit/.env and settings at ~/.pyrit/.pyrit_conf on hosts the client controls, and confirms the Python version against the PyPI package requirements and the PyRIT documentation before testing. Each scenario run is then executed and its outputs are kept in the client's storage, including the attempt records and evaluations PyRIT stores in memory. Scenario choices, probe selection and any data handling constraints are recorded so the run can be repeated. Where the client needs garak's own report format for a particular scenario, we confirm that with the client before the run rather than assuming it.

Findings are delivered as a written report that lists each failing probe family, the evidence behind it, the suggested fix (such as system prompt hardening, input filtering or a configuration change in the target) and a retest of the fixed behavior. The client should confirm before signing off which items count as acceptable residual risk and who signs that decision. Ask any quote to state the number of target systems, scenario families and retest rounds in scope, because those items drive effort. Dates for the work are agreed in the written scope, not estimated here.

How DeployOpen delivers PyRIT and garak red teaming

DeployOpen plans, builds and documents PyRIT and garak red teaming inside infrastructure you control, so the scenario runs fit your models, endpoints and review process. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we scope

  • Written scope names the target systems, the garak probe families to run through PyRIT, and the models used as objective, adversarial and scoring components.
  • We confirm which scenarios apply, such as encoding, web injection, Doctor, system prompt extraction, package hallucination, audio or FigStep.
  • Scope records where the garak.encoding scenario and other probes will run, and which evidence the results must produce.

How we build

  • We configure PyRIT's Garak scenarios against your target endpoints, keeping credentials in your secret stores rather than in scripts.
  • We set scorer choices, concurrency and retry behavior, and check that each probe's detectors match the output your team needs to review.
  • We run a pilot scenario and review the JSONL reports and PyRIT memory records for correctness before the full run is scheduled.

How we hand over

  • You receive the scenario configuration, run instructions and a written record of which probes ran against which targets.
  • Findings documentation explains each failed attempt, the probe that produced it, and the fix or retest path agreed in scope.
  • Your team gets a walkthrough of how to rerun scenarios, read PyRIT memory and compare garak output across runs.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, covering new PyRIT and garak releases as your targets change.
  • Retests confirm whether fixes changed the results for the probes that failed in the original run.
  • Support scope is agreed in writing, so your team knows which scenario changes and upgrades are included.

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.