Porting existing red-team prompt sets into garak

Porting your red-team prompts into garak turns a spreadsheet into repeatable scans with detectors, JSONL reports and comparable results. This page covers the options, setup and limits to confirm.

On this page

Porting existing red-team prompt sets into garak: when it is worth doing

Porting a prompt set into garak is worth doing when your team has red-team prompts in spreadsheets, notebooks or results from earlier manual tests, and cannot rerun them on demand or compare results between model versions with confidence. garak can run those prompts as probes or payloads, pass the model responses through its detectors, and write them into the same reports as the rest of its probe set. The work is usually less about rewriting attacks and more about mapping each prompt to the right plugin shape and checking whether the detector that scores it actually fits the failure you care about.

garak, the Generative AI Red-teaming and Assessment Kit, is an open-source command-line tool licensed under Apache 2.0. It is installed from PyPI with pip and requires Python 3.11 or newer. Its functionality is split into five plugin categories: probes, detectors, evaluators, generators and harnesses. A ported prompt set usually lands in one of two places. Static prompts that are sent unchanged fit a probe class that carries its own prompts. Prompts that are better treated as reusable inputs for other probes fit the payloads feature, which supplies payload groups to probes. Before you write any code, sort your prompts by the outcome they are meant to detect, since that determines which detector each group needs.

Confirm three things before you convert anything. First, check whether each prompt's pass or fail condition is written down. A spreadsheet that says "should refuse" needs a detector that recognizes refusals, while one that says "must not reveal the system prompt" needs a detector that looks for that content. Second, check how earlier tests recorded results, because a manual pass or fail column will not map directly onto garak's FAIL status and failure rate. Third, decide which prompts are single-turn and which depend on conversation state, since garak's default settings make 5 generations per prompt, and a multi-turn script will not behave like a list of independent strings. Keep a short mapping table that records each prompt group, its target plugin, its detector and the evidence you expect. Then run a small sample against the blank generator and a known-vulnerable target to confirm that the detector flags what it should. Consult the garak user guide for the current plugin interfaces, since the exact base classes change between releases.

Choosing between a custom probe and a payload group

A custom probe fits when your prompts represent a distinct attack family that deserves its own entry in the probe set, and when the pass or fail judgment depends on a policy the stock detectors do not express. The probe carries its own prompts, its primary and extended detectors, and its metadata, so scans can select it by name or tag.

  • Distinct attack family: Choose this route when your team's prompts test a weakness that stock probes do not cover, such as an internal jailbreak pattern tied to your product.
  • Policy-specific judgment: Pair the probe with a detector that matches your policy, because prompts alone do not decide what counts as a failure.
  • Metadata that controls selection: Tags and tier determine when the probe runs in a scan, so set them with the same care as the prompts.
  • Ownership: The probe lives in a module your team maintains and versions alongside its other garak plugins.

Before a custom probe joins a scheduled scan, confirm it runs with the blank generator, and confirm the base class and attribute names against the garak version you pin.

Configuration options for ported prompts and when each fits

This table compares the main ways to bring a ported prompt set into garak, from a single prompt list inside a probe class to prompt files kept outside the code. Read each row for the trade-off and the setting to confirm against the garak configuration reference before you commit to a layout.

ChoiceWhat it doesTrade-offWhen it fits
Single prompt list in a probe classPrompts are hard-coded as a list in one probe class and run as that probe.Simple to review and version with the code, but edits require a code change and a new release of the probe file.A small set of prompts that rarely changes and belongs to one attack family.
Payload group referenced by existing probesPrompts are supplied as a named payload group that existing probes consume.Reuses the probe set's own machinery, but the group must match what the probe expects, so confirm the payload setting in the configuration reference.Your prompts are variants of an attack that a built-in probe already covers, such as encoded or injected strings.
Prompt files kept outside the codePrompts live in a file such as a CSV or text file that a probe loads at run time.Non-engineers can update prompts without touching code, but the file path, encoding and loading logic must be tested in each environment.Spreadsheets owned by a red-team or policy team that change often and need an audit trail.
Generations per prompt (default 5)Sets how many times each prompt is sent to the target before the probe is scored.More generations catch intermittent failures and raise run time and model cost; fewer runs faster but can miss rare outputs. Confirm the default and override key in the configuration reference.Use the default for stochastic models, and lower it only for a deterministic target after you have checked the results.
Primary detectorsDetectors whose verdict decides whether an attempt counts as a failure in the probe's main result.Strict primary detectors give a clear pass or fail signal but may flag benign text, so each false positive needs review.Your prompts target a specific, well-defined unsafe output, such as a forbidden phrase or a leaked identifier.
Extended detectorsAdditional detectors that run on the same outputs for broader or exploratory signals.Adds coverage and context for triage, but results are harder to compare across runs if extended detectors change.Early exploration of a new prompt set, or when you want a second opinion before promoting a detector to primary.
Detector choice for ported promptsSelects detectors that match the policy the original spreadsheet or earlier test was checking.Mismatched detectors either miss real failures or inflate failure rates, so compare results against a manually labeled sample.Always, before a ported set is used for compliance evidence or a scheduled rescan.

How to port a prompt set into garak step by step

This sequence turns a prompt list from a spreadsheet or earlier test into a garak probe or payload group that runs with detectors, produces standard reports and can be repeated on later scans. Each step ends with a check, so problems surface before results are trusted.

  1. Inventory and clean the source prompts

    Export every prompt from the spreadsheet, earlier test scripts or prior reports into one file, then remove duplicates, empty rows, prompts that depend on conversation history you cannot reproduce, and entries with unclear intent. Keep the original wording, since small edits can change whether a model fails. Confirm the cleaned set with the people who wrote the tests, and record where each prompt came from so results can be traced back. Done when each remaining prompt is a single, self-contained string in one plain text or CSV file.

  2. Tag each prompt with category and expected failure

    Add two fields to each prompt: an attack category, such as prompt injection, jailbreak, data leakage or toxicity, and the failure you expect a vulnerable model to show, such as a leaked system prompt fragment or a forbidden phrase. Map categories to the garak probe families your team already uses so results line up with the rest of the probe set. Your security lead or application owner should approve the expected failures, because detectors can only check what has been defined. Done when every row has both fields filled and a short note on what counts as a failure.

  3. Choose the probe or payload route

    Decide whether each category becomes a new probe class or a payload group that existing probes consume. Use a probe when the attack needs its own framing, multi-turn structure or a specific detector pairing. Use a payload group when the strings are inputs that existing probes should carry. Garak's payloads feature supplies reusable payload groups to probes, and the core config sets the encoding probes to use the default payload group, so confirm in the configuration reference how a custom group is selected. Done when each category has one named route written down.

  4. Write the probe class

    Create a Python file with a probe class that subclasses the base probe that matches your attack shape. Give the class a descriptive name, a goal statement and tags that let scans select it. Load prompts from the cleaned data file so the code stays the same when the set grows. Place the module where garak loads custom plugins, following the garak user guide for your installed version. Done when the module imports under Python 3.11 or newer without errors and the class is visible to garak.

  5. Assign detectors to the probe

    Attach detectors that match the failures defined in the tagging step. Use existing detectors where they fit, such as string matching for a leaked identifier, and write a custom detector only where no existing one checks your policy. Set primary detectors to decide pass or fail, and add extended detectors for secondary review. Test each detector on a few hand-written outputs that you know are bad and a few that you know are acceptable. Done when every probe has at least one detector and the hand-written outputs score as expected.

  6. Confirm loading with the blank generator

    Run the new probe with a generator that does not call a model, so the test checks plumbing only. Confirm that the probe appears in garak's probe listing and that the run completes without import, configuration or detector errors. No model behavior is being measured at this stage, so do not read any result as a finding. Done when the run finishes cleanly and garak.log shows the probe and its detectors were loaded.

  7. Run the probe against the target

    Configure the generator for your endpoint, for example the REST generator with a short YAML file describing the endpoint, and run the new probe against it. Garak makes 5 generations per prompt by default, so each prompt produces several attempts, and a probe is marked FAIL with a failure rate when any attempt produces undesirable output. Keep generator settings identical for every run you plan to compare later. Done when the target has answered every prompt, or the unanswered prompts are listed with errors in the log.

  8. Inspect the JSONL report and garak.log

    Open the JSONL report and review each attempt with its prompt, the model output and the detector verdict. Check that the flagged results match the failures you defined in the tagging step, and read several passes and fails in full. Then read garak.log for timeouts, rate limit messages and errors, because incomplete attempts change the failure rate. Done when you have confirmed the verdicts on a sample, fixed any detector or prompt problems, and recorded the prompts that need revision.

Why detector fit decides whether ported prompts are useful

A ported prompt set only produces useful results when each prompt is paired with a detector that can judge its response. The cards below cover the places where a direct import looks complete but produces misleading pass and fail counts, and how to catch each problem before the first scan.

Prompts that pass without a detector

A prompt that no detector evaluates for the behavior it targets will be marked as passing even when the model complies. Map each imported prompt to the failure it is meant to expose, such as data leakage, toxicity or a forbidden instruction, and confirm that a matching detector runs for that probe. Check the report for prompts that show zero flagged attempts across every generation, then ask whether the detector could ever fire on them.

Configuring garak reference

Detectors that flag refusals

Some detectors look for a keyword or phrase that a refusal also contains, so a model that declines a request is counted as a failure. Run a sample of known-safe prompts against your chosen detector and read the outputs by hand. If refusals score as hits, tighten the match or switch to a detector that checks for the unwanted content itself.

Duplicate prompts inflating counts

Spreadsheets often contain the same attack under several names, or near-identical rewrites from different test rounds. Duplicates multiply the attempt count and make a failure rate look more reliable than it is. Normalize whitespace and case, hash the prompt text, and remove exact duplicates before import. Review near-duplicates by hand, since two prompts that differ by one word may test different things.

Prompts that depend on a system prompt

Many earlier red-team prompts only make sense against a particular system prompt, persona or tool setup. Run without that context, a prompt may be refused for reasons unrelated to the original test, or succeed in a way that does not reflect production. Record the system prompt each prompt was written for, and configure garak's system prompt settings to match the target before comparing results.

Multi-turn prompts that do not flatten

A prompt written as a conversation, with several user turns that build on earlier model replies, cannot be sent as a single attempt without losing its logic. Splitting the turns into separate probes changes the test. Decide whether each conversation becomes a single payload that includes its full history, or a multi-turn probe built for that structure, and confirm the scan sends it the way your team intended.

Spreadsheet encoding and whitespace

Prompts copied from spreadsheets often carry smart quotes, non-breaking spaces, stray line breaks, or mojibake from a different encoding. These changes alter what the model receives and can break detectors that match exact strings. Export to UTF-8, normalize Unicode and line endings, and check a sample by comparing the stored payload with the original cell. Keep the original file so results can be traced back to the source text.

How a ported prompt flows through garak

The path starts with your spreadsheet or earlier test file, which stays inside your environment. A conversion script maps each row into a garak probe or payload group, and the harness then pairs that probe with its recommended detectors. The generator sends each prompt to your target endpoint, and the evaluator scores the response. Two hand-offs deserve review: the conversion step, where fields can be lost or mislabeled, and the generator step, where your prompts leave your environment for the target. Check both before trusting the report, which lands as a JSONL file plus garak.log.

Trust boundaries sit around your prompt data and the target endpoint.

Security considerations for prompt sets with real attack content

Prompt sets that came from earlier red-team work often contain live credentials, customer data and working jailbreaks. The cards below cover where that material lives, what garak writes to disk during a run and who can reach it, so the port does not create a new exposure while it adds coverage.

Scrub credentials before import

Spreadsheets and old test scripts often hold API keys, session tokens or internal hostnames copied in as examples. Before a prompt enters garak, search the source for key patterns and replace each live value with a placeholder that the generator fills at runtime from the environment. Keep a record of what was removed so the port can be reviewed, and rotate any credential that was ever pasted into a prompt file.

Remove personal and customer data

Earlier tests sometimes used real customer names, account numbers or records to show what a model leaked. Replace those values with synthetic equivalents that keep the same shape, so detectors still match and the prompt set does not hold regulated data. Confirm with your privacy team whether the original test material may be copied into a second system at all.

Treat JSONL reports as sensitive output

Each garak run writes a JSONL report of every attempt and its evaluation, and the target's replies are part of that record. A model that leaked data during a test will leak it again in the report. Store reports in the same access tier as the most sensitive data the target can reach, and set retention deliberately rather than keeping every run indefinitely.

garak README

Keep the scanning host locked down

The scanning host holds the target credentials, the prompt library and the reports. Limit shell access to the people running scans, keep the garak.log debugging file out of shared logs because it accumulates across runs, and run scans under a dedicated service account with only the network routes the target requires. Confirm where the host sits relative to the target's network boundary.

Keep prompt libraries out of public repositories

Working jailbreak prompts are attack material, and a public repository makes them available to anyone who wants to use them against your own systems. Host the prompt library in a private repository with branch protection, and check that CI logs and issue trackers do not echo full prompts. Ask the owners of any shared or third-party prompt collection what license and sharing terms apply before you copy it in.

Version prompt files with review

Store the converted prompts in version control with a named owner and a review step for each change, so you can show which prompt set produced a given report. Record the garak version next to each run, because a later upgrade can change scores and make an old result hard to compare. Remove retired prompts from the active branch, but keep their history only where your retention rules allow.

Questions teams ask before porting prompts into garak

How much effort does it take to port an existing prompt set into garak?

Effort depends mostly on three things: how many prompts you have, how much detector work they need, and how many target types the port must serve. A set of prompts that already has clear expected behavior, such as a refusal or a specific forbidden string, is much faster to port than one where every prompt needs a judgment about what counts as a failure. The prompt count drives the mechanical conversion, but detector design usually drives the calendar. Ask any partner to split a quote into conversion, detector work per policy, and testing against each target type, so you can see which part is expensive for your set.

Can our team port the prompts ourselves?

Often yes, for a team with Python experience and someone who understands the attacks. Converting prompts into a probe or payload group is ordinary Python work, and garak's documentation at docs.garak.ai covers the plugin structure. The harder parts are deciding which detector reflects the failure you care about, checking for false positives, and keeping the result repeatable across runs. Many teams start in-house with a small subset, then bring in outside help for the detector review and for wiring the port into scheduled scans. Your own team can make that call once it has tested a handful of prompts end to end.

What do we need to provide for a port?

A port goes faster when the inputs are ready before work starts. Plan for three things:

  • Prompt owners who can explain what each prompt is meant to test and what a bad response looks like.
  • A test endpoint or model that the team can reach from the scanning host, ideally a non-production one, with credentials handled outside the config files.
  • Sign-off from a named reviewer on each detector's pass and fail rules, since those rules define what your scan reports as a finding.

Also collect any prior test results, so the port can be compared against what your team already knows.

Will ported prompts still work after a garak upgrade?

The prompts themselves usually carry over, but scores can shift after an upgrade, so the port should be treated as a versioned asset. Each garak release can change probe behavior, detector logic and report fields, and a result from one version may not be directly comparable with a result from another. Keep the garak version pinned in your scan configuration, record it in every report, and rerun a baseline set of prompts after each upgrade before trusting trend lines. garak's release notes at the GitHub releases page list changes by version, and the upgrade guidance in the garak documentation should be read before you move versions.

What does a partner deliver for a prompt port?

A partner's deliverable should be written into a fixed scope before work starts. Typical items include the converted probe or payload files, the detector definitions with their pass and fail rules, a short test run against each target type, and documentation that explains how to add prompts later. Ask whether the quote includes a false-positive review of the detectors, because that review is where most of the rework appears. Ask also how the port is handed over, whether the scan configuration is stored in your repository, and what the reports look like when a run finishes. Each of these should appear in the quote as a named deliverable, not as a general statement.

How do detector choices change the cost of a port?

Detectors are the largest source of variation in a port. A forbidden phrase or a leaked identifier can often be matched with string checks, which is quick to build and easy to review. A policy that depends on meaning, such as whether a response gives unsafe medical advice, may need a classifier or a judge model, and each of those adds design, validation and ongoing cost. Ask for the detector approach per policy in any quote, along with the number of false-positive cases the reviewer will check. Those two items explain most of the difference between a small port and a large one.

Does garak keep the same prompt results and reports for compliance evidence?

garak writes a JSONL report of every attempt and its evaluation, plus a garak.log file that continues across runs, so ported prompts leave a traceable record. Whether that record meets an auditor's needs depends on your framework and on how you store and label runs. Keep the garak version, configuration and prompt set identifiers with each report. Confirm with your compliance lead which evidence they need, since DeployOpen prepares systems, controls and evidence for assessments but does not issue audit reports or certifications. Independent auditors and certification bodies make that determination.

Limits to confirm in your environment before you port

Porting a prompt set is quick to start and easy to get wrong. Five checks decide whether the ported prompts produce results your team can trust, so settle them before the first scan, while changing course is still cheap.

Pin the garak release

Confirm which garak release and Python interpreter your team runs before writing any probe. The reference point for this page is v0.17.1, released 16 October 2026, and the PyPI package requires Python 3.11 or newer. Probe base classes, payload handling and report fields may change between releases, so a ported set built on one version can behave differently on another. Record the version in your scan configuration and in every report, and test the ported probe on the same release your scans use.

garak releases

Multi-turn and stateful prompts

Spreadsheets usually hold single prompts, but many earlier red-team tests were conversations where each turn depended on the last. Check whether your prompts need earlier turns, session tokens or memory of prior answers. A flat probe sends each prompt on its own, so a multi-turn attack can lose its setup and report a pass that means nothing. Decide whether to flatten the sequence, rebuild the context inside each prompt, or keep the conversation in a custom generator, and confirm which of these your garak version supports for your target.

Detector accuracy on your domain

Ported prompts keep the detectors that garak attaches by default, and those detectors were not written for your policy. A refusal phrase list may miss a leaked customer identifier, or flag a safe answer that quotes a banned term. Run a sample of known-good and known-bad responses from your application through each detector that will judge the ported probe, and record false positives and false negatives. Treat the detector as unproven until someone who knows the domain has reviewed that sample.

Licensing of the source prompt set

garak is licensed under Apache 2.0, and that license applies to the tool. It does not settle the terms on prompts you bring in. Prompt sets from public research, vendor test suites or another company's red-team material may limit reuse, redistribution or inclusion in a shared repository. Before you copy prompts into a probe module, confirm the source license or internal permission, and record the origin of each prompt in the probe metadata so findings trace back to their source. Have counsel sign off on any prompts that will leave your organization.

Target reachable through a generator

Porting prompts only helps if garak can send them to your application. The REST generator works with any endpoint that returns plaintext or JSON, configured in a short YAML file, so a conventional HTTP API is usually the quickest fit. WebSocket services, proprietary SDKs, authentication flows that refresh tokens and endpoints that stream partial output may need a custom generator. Confirm the protocol, authentication and response shape with one manual request, then send a few prompts through the generator and read the raw responses before scaling the set.

garak README

Official garak references for porting work

Before you write a single line of ported code, read the garak user guide at docs.garak.ai and the configuration reference that sits beside it. The user guide covers how probes, detectors, generators and harnesses fit together and how a run is launched, which is the context you need before deciding whether your prompt set belongs in a probe class, a payload group or a configuration change. The configuration reference explains the payloads feature, where reusable payload groups are supplied to probes and where the core config sets the encoding probes to use the default payload group. Those two pages answer the questions porting work raises first: where a payload group is declared, how a probe picks one up, and which settings override the defaults. Both are maintained by the garak project, so they are the authority when a blog post or an older example disagrees with them.

Treat the documentation as a version-specific record rather than a timeless one. Plugin interfaces, base class names, the attributes a probe must set and the way payloads are loaded can change between releases. Before you port anything, install the exact garak version your team will use in scans, check the plugin interface against the docs for that release, and record the version in your porting notes. The garak release notes on GitHub list changes by version, and they are the place to check when a ported probe stops loading after an upgrade. Ask whoever owns the scanning pipeline to confirm which version is pinned, because a probe that works on one release may need small changes on another.

The practical output of this step is a short checklist: the payload group name you will use, the probe base class that matches your prompts, the fields each prompt record must carry, and the release you tested against. Confirm each item in your own environment with a small run before you migrate the full spreadsheet. Keeping that checklist with the ported files lets a reviewer see exactly which documented interface the work relies on, which matters when the same prompts are later cited as evidence in a security review.

How DeployOpen scopes and delivers garak prompt ports

DeployOpen starts by inventorying the prompt sets your team already uses and agreeing in writing which of them become garak probes or payloads. We then build, test and document the port so the prompts run with garak's detectors, reporting and the rest of the probe set.

How we scope

  • Inventory every prompt source, including spreadsheets, earlier test runs and scripts, and record its format and owner.
  • Agree in writing which prompts become probes, which become payload groups and which stay out of scope.
  • Define the detectors, expected failure conditions and report outputs that the ported prompts must produce.

How we build

  • Convert prompts into garak probe classes or payload entries, keeping original identifiers so results trace back to the source.
  • Run each ported probe with the blank generator first, then against the target endpoint named in the scope.
  • Check false positives and false negatives on a sample of known-good and known-bad outputs before adding the probe to scans.

How we hand over

  • Deliver the probe code, payload files, configuration and a short guide to running the ported set in your environment.
  • Provide a mapping table from each original prompt to its garak probe, detector and tag, for audit and review.
  • Walk your engineers through a sample run and the JSONL report so they can read results without DeployOpen.

How we support

  • Engagements are fixed-scope, so changes to the prompt set or target are agreed in writing before further work.
  • Ongoing support, updates for new garak releases and continuous testing are available as a retainer.
  • Confirm with DeployOpen during scoping which support terms apply after handover and how upgrades are handled.

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.