Testing DAN jailbreaks with garak

garak's dan module sends a family of long, role-play style jailbreak prompts to a model or application. This page explains what those probes cover, how to configure and read a DAN scan, and when they belong in a routine run.

On this page

When teams run DAN jailbreak testing with garak

Teams that deploy or approve an LLM or chat application often need evidence that it resists well-known jailbreak prompts before a launch or a security review. garak DAN jailbreak testing answers part of that need: garak's dan probes send a library of DAN-style and related jailbreak prompts to the model, and detectors score each response for undesirable output. The test is a black-box check of the model as reached through your configured endpoint, so the result describes that combination and nothing broader.

The test does not show that an application is safe. Results depend on the model version, the system prompt, any input or output filters, and the way the endpoint wraps user messages. A pass on the bundled prompts says little about a prompt the library does not contain, and a fail on an old prompt may matter less than a fail on a technique that targets your own tools or data. Before you cite a result, confirm which garak release, probe set and generator settings produced it, and record the model and system prompt in the same run notes.

Decide up front whether DAN results are a routine signal or a one-off gate. Keep the dan probes in a scheduled scan when the model, system prompt or guardrails change, so you can see drift between releases. Ask the team that owns the application to state which jailbreak families matter for its use case, and treat the DAN results as one input alongside the other probe families in your plan.

Which DAN-family probes garak ships and what each one covers

garak's dan module bundles several families of jailbreak prompts that share one goal: getting a model to drop its guardrails. They differ in where the prompt came from, how it is framed and whether it is fixed text or generated at run time. Knowing which family a probe belongs to tells you what a failure means and how repeatable the result will be.

Named DAN versions 6.0 to 11.0

The Dan_6_0 through Dan_11_0 probes are fixed prompts that follow successive versions of the "Do Anything Now" persona, each asking the model to role-play an unrestricted alter ego. Each version is a separate probe, so a model can pass one and fail another. Check which versions your scan includes, and treat a failure on a later version as a signal that the model has learned to resist earlier wording but not the underlying persona.

garak dan.py source

Related persona variants

DUDE and STAN are persona prompts in the same family as DAN, using alternative names and rules that tell the model it can ignore its normal constraints. AntiDAN takes the opposite framing, which can expose models that treat any mention of a persona as an instruction. Run these together with the named versions, since a model can resist one wording and still follow another that changes only the character's name.

Developer-mode framing

The ChatGPT developer mode variants ask the model to switch into a hidden testing mode that supposedly removes its safety behavior. The claim of special authority is the attack, so these probes are useful for applications where users can paste text that looks like system or admin instructions. Confirm whether your deployment exposes any developer or debug mode, because these prompts are most informative when the model is told that such a mode exists.

Automatically generated prompts

AutoDAN produces new jailbreak prompts by searching for wording that works against a target, so each run can differ. AutoDANCached replays a stored set of those prompts instead. Live generation can find variants a fixed list misses, but results vary between runs and cost more compute. Cached replay gives repeatable comparisons across model versions, so decide early whether you need a stable baseline or broader discovery.

Prompts collected in the wild

DanInTheWild contains jailbreak prompts gathered from public sources where users shared them. These reflect what real users already try, which makes them a practical check on your exposure, but they are long, varied and sometimes repetitive. Because many are long prompts, a run can consume a large share of your token budget and take longer than the short named probes. Review the prompt count and length before adding it to a routine scan.

Fixed versus generated testing

A fixed prompt gives the same input every run, so a change in result points to a change in the model or its configuration. A generated or live prompt tests a moving target, so a pass shows only that this sample did not break the model. Report fixed-prompt results as regression evidence and generated results as discovery, and keep the two in separate reporting sections so a reader does not read a single pass as full coverage.

Why many DAN prompts are long and what that does to a scan

Many DAN-style prompts are long role-play instructions. Before the actual request arrives, they set up a persona, a list of rules the persona must follow, and a reward or penalty structure that pressures the model to comply. The payload that matters often sits at the end of a block of setup text. That means each attempt sends far more tokens than a short direct request would, and the cost of a scan is driven by the length of the prompts as much as by the number of probes. Because garak makes 5 generations per prompt by default, the per-attempt cost multiplies across every generation. Before you schedule the full dan set, confirm the context window and the per-request cost of your endpoint, since a hosted model bills by token and a self-hosted model consumes context and latency on your own hardware.

Length also creates a practical limit. Some endpoints cap the input size, and a prompt that exceeds that cap may be truncated, rejected with an error, or processed without its final lines. A truncated prompt can look like a pass when the model never saw the request, so a clean result proves less than it appears to. Check that errors and truncations are logged in the garak.log file and the JSONL report, and that a rejected request is not recorded as a model that resisted the attack. Ask your endpoint provider or platform team for the maximum input length, whether it counts system prompts and conversation history, and how it reports overflow.

The results also need careful reading when the model sits behind an application. A long DAN prompt sent through a chat interface, a retrieval pipeline or a system prompt that carries its own rules may behave differently from the same prompt sent to a bare model. The application's instructions, filters and context can either blunt or amplify the persona. Treat a bare-model run as a baseline, then rerun the most relevant dan probes against the deployed path, including the same system prompt and input handling your users will hit. Confirm with the application owner which path is in scope before you read the scores as a statement about production.

Configuration options for a DAN scan and when each fits

This table compares the settings that change what a DAN run tests, how many attempts it makes, how results are judged and where output goes. Read each row as a decision: the option, what it changes, when it fits and what it costs in coverage or effort. The main takeaway is that the full dan module suits a routine scan, while narrower selections suit targeted reruns after a change.

OptionWhat it changesWhen it fitsTrade-off
Full dan moduleRuns every Dan_6_0 through Dan_11_0 variant plus DUDE, STAN, AntiDAN, developer mode, AutoDAN and DanInTheWildBaseline scans and first assessments of a new model or endpointBroadest coverage, but many long prompts and the longest run
Single named versionRuns one DAN generation, such as Dan_11_0, or one familyChecking whether a specific fix or model change addressed a known jailbreakFast and focused, but misses other families
AutoDAN and in-the-wild familiesRuns AutoDAN, AutoDANCached and DanInTheWild promptsTesting against jailbreaks seen in use, or sampling realistic attacker wordingTests known patterns only, so new wording can pass
Generations per promptDefault is 5 attempts; any undesirable output marks the probe FAILKeep the default for release gates where one success mattersFewer generations cut time but can hide intermittent failures
Probewise harness and detectorsRuns each probe with its recommended detectorsStandard scans that compare results across runsDetector choice affects scores, so changes shift comparisons
System prompt onPlaces your application instructions ahead of each DAN promptTesting whether your deployed instructions resist overrideResults reflect your prompt and may not transfer to other setups
System prompt offSends DAN prompts to the bare modelMeasuring the model's own baseline resistanceOverstates risk for applications that add their own guardrails
REST endpoint generatorSends prompts to your application through a YAML-described endpointTesting the full stack, including filters and middlewareNeeds endpoint configuration and tests the whole chain, not the model alone
OpenAI, Hugging Face, Bedrock or LiteLLM generatorsCalls a hosted or proxied model directlyComparing model providers or routing optionsResults may not match what end users reach through your application
Local gguf through llama.cppRuns a local quantized modelAir-gapped or data-restricted testingQuantization can change behavior relative to the served model
JSONL report and garak.logRecords every attempt and evaluation, and keeps debug output across runsKeeping evidence for reviews and comparing runs over timeReports contain full prompts and outputs, so storage needs access control

How a DAN probe travels from garak to the target and back to a report

The run starts on the operator's test host, where the command-line tool loads the dan probes from its module and hands each prompt to a generator. The generator sends it across the trust boundary to the target's model API or REST endpoint, where the system prompt and guardrails shape the reply. Detectors score each response on the test host, and results land in a JSONL report and a continuing garak.log. Check which side of the boundary holds the API key and which logs contain prompt text.

Data and credential paths for one DAN scan, with the trust boundary marked.

How to set up and run a first DAN scan

This sequence takes a team from a clean host to a verified first run of garak's DAN probes against a target model or endpoint. Each step ends with a check, so the team knows the generator, detectors and report work before it reads any scores.

  1. Confirm the host and Python version

    Confirm that the scanning host runs Linux or macOS and that Python 3.11 or newer is installed, since the PyPI package requires that version. Run python3 --version and record the result with the host name and date. The step is done when the version check passes on the same host that will run the scans, and the team has noted any proxy or outbound network rules that could block calls to the target.

  2. Install garak from PyPI

    Create an isolated virtual environment and install garak with pip install garak so the scanner and its dependencies stay separate from system Python. Run python -m garak --help to confirm the command loads. The step is done when the help output lists the command options and no import errors appear. Record the installed version with pip show garak, because scores and probe behavior can change between releases.

  3. Describe the target in a generator configuration

    Choose the generator that matches the target. For a model hosted on a supported provider, use that generator directly. For an application behind a REST endpoint, write a short YAML file that describes the URL, headers, request body and the JSON path or plaintext format of the response. Store the file under version control, and keep API keys in environment variables rather than in the file. The step is done when the configuration file is saved and the team can state which endpoint and model it targets. Confirm exact generator options in the garak user guide before writing the file.

  4. Run one DAN probe as a smoke test

    Run a single DAN probe, such as one of the Dan_ probes from the dan module, against the configured generator. Use a small run so that a failure is quick to diagnose. Open the JSONL report and confirm that each attempt contains a real prompt and a real model response, not an error message or empty string. Check garak.log for connection errors, authentication failures or parsing problems. The step is done when the report shows genuine responses and the log contains no errors for that run.

  5. Check that detector verdicts match the responses

    Before trusting any result, read several attempts that the probe marked as FAIL and several that it marked as PASS. Confirm that the response in a FAIL attempt really shows the undesirable behavior, such as the model adopting the DAN persona and producing content it should refuse, and that the PASS responses are genuine refusals or safe answers. Note any misclassified attempts, since they show whether the detector suits this application. The step is done when the team has reviewed a sample of both outcomes and recorded whether the verdicts are trustworthy.

  6. Run the wider dan probe set

    After the smoke test passes, run the full dan module with the same generator and the same configuration file so that the results can be compared later. Keep the run identifier, the garak version and the configuration file together in your records. Expect the run to take longer than the smoke test, and watch garak.log for rate limit or timeout messages during the run. The step is done when the run completes and the JSONL report contains an entry for each probe in the set.

  7. Review the report and plan the next read

    Open the JSONL report and the failure rates for each probe, then confirm that the counts match the number of attempts configured. Compare the findings with the sample reviewed earlier, and flag any probe whose failures look like detector noise rather than real model output. Save the configuration, the report and the log as a baseline. For exact flags, generator options and report fields, use the garak user guide at docs.garak.ai before changing the setup or scheduling repeat runs.

Reading DAN results for a bare model and for a deployed application

When garak sends DAN prompts straight to a model with no system prompt, no retrieval and no tools, a FAIL reflects the model's own alignment under a jailbreak framing. The result answers a narrow question: did this model produce undesirable output when a known jailbreak template asked it to ignore its training? Nothing in the result shows what an application built on the model would do, because the application's guardrails were never in the request path.

  • Trace the failure: Open the JSONL report and filter for entries whose probe name begins with dan.. Each record names the probe class, the prompt sent and the output, so you can see which DAN version or variant produced the failure.
  • Check the failure rate: garak makes 5 generations per prompt by default and marks a probe as FAIL when any attempt is undesirable. Divide the failing attempts by the total generations for that probe before you describe the result as occasional or consistent.
  • Record the model identity: Store the exact model name, version, quantization and generator configuration with the run, since a bare model result is only valid for that artifact.
  • Keep the logs: Retain the garak.log file and the report together so a reviewer can match each attempt to the run that produced it.

Before you cite a bare model result as evidence, confirm with the model provider which version you tested and whether your deployment adds any safety layer of its own.

When DAN probes belong in a routine scan

Keep the DAN probes in a recurring garak scan whenever the thing being tested has changed or when the results will be read by someone outside the team. The four triggers that matter are a model or model version change, a change to the system prompt or guardrail configuration, a release that puts the application in front of outside users, and any scheduled rescan that feeds evidence into a security review. A jailbreak family that passed last quarter says little about a model that was swapped for a newer checkpoint, and a guardrail edit can reopen a path that a previous run had closed.

The cost of a full run is the main reason teams narrow the set. The dan module includes Dan_6_0 through Dan_11_0, DUDE, STAN, AntiDAN, the ChatGPT developer mode variants, AutoDAN, AutoDANCached and DanInTheWild, and many of these prompts are long, so each generation consumes more tokens and time than a short probe. Run the full family at release gates and in periodic audits, then select the families that match the application's exposure for routine runs. For example, an internal tool with no public access may justify a smaller subset than a public chat interface. Confirm the exact probe names and their prompt lengths in your installed version before you set a budget, because both change between releases.

Make results comparable over time. Store the JSONL report from every run, and compare failure rates by probe between runs rather than reading one run in isolation. Because garak marks a probe as FAIL when any of its default five generations produces undesirable output, a rise in failure rate is the signal to investigate. Treat garak upgrades as a change in their own right: a new release can alter prompts, detectors or scoring, so run the previous and new versions against the same target before attributing a shift to the model. The garak user guide is the place to check release-specific behavior before you pin a version for the recurring schedule.

Security and operational considerations for DAN testing

DAN probes send deliberately adversarial prompts to a live model and keep the full transcript of every attempt. The cards below cover the credentials, stored evidence, host access, authorization and human review that surround a scan, so the test itself does not create new exposure.

Keep endpoint credentials out of config files

garak's REST and hosted-provider generators read API keys and endpoint tokens from configuration, so a scan config committed to a repository can expose them to everyone with read access. Load secrets from environment variables or your secrets manager at run time, and check that the config file, shell history and CI logs contain no key. Confirm the key scope is limited to the test target.

Treat reports and logs as sensitive data

The JSONL report and the garak.log file record the full DAN prompts, including long role-play text, and the model's replies, which may include restricted or personal content. Store them in an access-controlled location, set a retention period agreed with your data owner, and avoid copying them into tickets or chat. Confirm who can read and delete them.

Restrict access to the test host

The machine running garak holds credentials, outbound network access to the target and the evidence from every run. Limit login to the people running scans, keep the host patched, and separate it from the production network where possible. Record who ran each scan and from which host so results can be traced.

Scan only systems you are authorized to test

DAN prompts are designed to push a model past its safety behavior, and a scan against a third-party API or a model you do not own can breach provider terms and contracts. Get written approval that names the endpoint, the owner and the test window before the first request. Confirm the provider's acceptable use policy allows adversarial testing.

Plan for quota and logged traffic

A live scan sends many long prompts to the endpoint, which can consume rate limits, token quota and budget, and can trigger alerts in the provider's or your own monitoring. It also places attack traffic in production logs and may affect real users. Run first against a staging or dedicated endpoint, agree a window with operations, and confirm the expected request volume with the team that pays for it.

Review flagged outputs before reporting

garak's detectors mark an attempt as a failure based on pattern matching, so a flagged reply may be a false positive, such as a refusal that repeats the prompt's wording. A named reviewer should read each flagged output in context before it appears in a finding or is sent to a model owner. Record the reviewer's decision next to the automated result.

Limits of DAN testing and what to confirm in your environment

A clean DAN run is evidence about known prompts, not a guarantee against new jailbreaks. The dan module is a fixed or generated set of prompts with a known age, written against the models and filters that existed when each version was authored. A model that resists every probe may still fall to a phrasing nobody has published, and a model that fails one may be patched by the time you read the report. Treat the result as one signal in a wider test plan, and record which garak version and probe set produced it so the result can be compared fairly later.

The verdict also depends on two things you control. First, detectors decide what counts as a FAIL, and their notion of harmful output may not match your organization's policy. A response that a detector scores as compliant could still be unacceptable for your use case, and the reverse is also true. Second, results move with generator settings and the system prompt. Sampling parameters, the number of generations per prompt, and the instructions wrapped around the model all change what the model says. Keep these fixed across runs, and rerun the same configuration on the same model version before you draw conclusions about a change.

Before you rely on a run, confirm the following in your own environment. List the exact probe names and count for the garak version you installed, using the garak releases page for the version in use, because probe sets change between releases. Check which detectors are bound to each DAN probe in your run. Find out whether the target enforces a context limit, since long DAN prompts that get truncated test something other than what you intended. Finally, agree in writing how your team will treat FAIL results under its own policy: who reviews them, what severity they carry, and whether a failure blocks release or opens a remediation ticket.

Questions teams ask before running DAN jailbreak tests

What drives the cost of a garak DAN scan?

The cost comes from compute, endpoint usage and the people time needed to set up and read the results. The main drivers are the number of probes selected from the dan module, the generations per prompt (garak makes 5 by default), and the model you test. A local model costs hardware and power, while a hosted endpoint bills per token or request and may be limited by rate limits. Long DAN prompts also consume more tokens per attempt. Ask for a quote that states which probes are included, the generation count, the endpoint type and the expected number of runs per month, since these settings decide most of the bill.

How long does setup take for a DAN test?

Setup length depends on the environment more than on garak itself. garak installs from PyPI with pip and needs Python 3.11 or newer, so a clean Linux or macOS host can be ready quickly. The slower work is connecting the target: writing the REST generator YAML for your endpoint, handling authentication, confirming that responses come back as plaintext or JSON, and agreeing on a test window with the team that owns the model. Air-gapped hosts, private network routing and access approvals add time. Confirm these items with your own platform team before estimating a schedule.

What does our internal team need to provide?

A DAN test needs four things from your side:

  • Endpoint access, including a test environment, credentials with the right scope and network routes from the scanning host
  • The system prompt and any guardrail layers the application uses, so results reflect the real deployment
  • A named owner who reads the JSONL report and decides what to fix
  • A written policy that defines what counts as a FAIL for your use case, since garak marks a probe as failed when any attempt produces undesirable output

Without the last item, a scan produces numbers that nobody can act on.

Can our team run DAN jailbreak tests without a partner?

Yes, a team with Linux or macOS skills and access to the target can install garak and run the dan probes. garak is free and Apache 2.0 licensed, and the user guide at docs.garak.ai covers configuration. The harder parts are repeatable configuration, interpreting FAIL results against your policy, deciding which long prompts belong in a routine scan, and keeping reports comparable across garak upgrades. Teams without an owner for these tasks usually find the work stalls after the first run. Your engineers can do it alone if they have time to own those steps.

Does DeployOpen run DAN jailbreak tests for us?

DeployOpen can take on the DAN test as part of a fixed-scope security testing engagement. The written scope would name the target application or model, the probe selection, the generator settings, the endpoint and access details, the report format and the retest, if included. DeployOpen tests applications and APIs, AI systems and agents, and it delivers findings with fixes. DeployOpen does not issue audit reports or certifications, so any evidence you need for an assessment should be confirmed with the assessor beforehand. A quote follows from that written scope.

Should long DAN prompts stay in a routine scan?

Many dan probes use long, persona-based prompts, so they add cost on every run without always adding signal for your application. Keep them in a routine scan when your model is exposed to end users who could paste similar text, or when a previous run showed a weakness in this family. Consider moving them to periodic deeper scans if your model sits behind a guard, or if an endpoint charges heavily per token. Record the decision and the reason in your scan plan so the choice can be reviewed later.

Which settings make DAN results repeatable?

Repeatable results depend on fixed settings. Pin the garak version, since scores can shift between releases, and record it with each run. Keep the generator YAML, the system prompt, the generation count and the probe list in version control. Store the JSONL report and the garak.log file from each run. Note any change to the target model or guardrail, because a new model version can change the outcome even when the scan settings stay the same. Ask your engineers to confirm these controls before you compare runs over time.

How DeployOpen scopes and delivers garak DAN testing

DeployOpen plans, runs and documents garak DAN testing as a fixed-scope engagement, agreed in writing before work starts. The work covers the garak setup, the probe selection, the run design and the evidence your security and governance teams need to review.

How we scope

  • Confirm which application endpoints, models and system prompts the DAN probes will target
  • Agree which dan probe families and long prompt runs are in and out of the routine scan
  • Record the generator configuration, endpoint access and data handling rules in the written scope

How we build

  • Install garak in your environment and configure the REST generator for your endpoint
  • Build a repeatable run configuration with fixed probe selection, generation counts and detectors
  • Test the setup on a small sample before running the full DAN probe set against your target

How we hand over

  • Deliver the JSONL reports, garak.log files and a written reading guide for the DAN results
  • Document the run configuration so your team can rerun the same scan on a schedule
  • Walk your engineers through failures, false positives and the fixes we recommend

How we support

  • Offer ongoing support and scheduled rescans as a retainer after the engagement closes
  • Plan garak upgrades so that score changes between releases are explained to your team
  • Retest the application after fixes are applied and document the results for your review

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.