Why garak role-play and rephrasing jailbreaks matter for guarded models
If your team runs a guarded model or application, the question to answer is whether cheap, single-turn disguises still get past its refusals. In most cases they can, and a scan that skips them leaves a known gap untested. garak, the Generative AI Red-teaming and Assessment Kit, is an open-source command-line scanner licensed under Apache 2.0. It sends a library of prompts (probes) to a model or application, evaluates the responses with detectors, and writes the results to a report you can keep as evidence. Because the tool is free to run in your own environment, the cost of testing these techniques is mostly the time to configure, review and act on the results.
The role-play and rephrasing probe families test different disguises. The grandma probes ask the model to adopt a relative telling a story, a framing that tries to pull contentious information out through an emotional or familiar voice. The doctor probes present the requester as a medical professional, including Policy Puppetry variants, to argue that the normal safeguards should not apply. The phrasing probes restate an unsafe request in the past or future tense, which can slip past a filter tuned to the direct form. The SATA probe hides harmful text and attaches it to a simple assistive task, so the model focuses on completing the task rather than on the content it is decoding.
These techniques keep working for a reason that matters to your design. Guardrails are often trained or configured against direct, familiar phrasings, so a request that changes its framing, persona or grammatical tense can land outside the patterns the guardrail recognizes while still asking for the same content. Each attempt costs little to write, so attackers can try many variants. Confirm with your model provider or platform team which safety layers sit in front of your model, such as a system prompt, an input filter or an output classifier, and run these probes against the full path your users take, not only the bare model.
How a rephrasing or role-play probe reaches the guarded model and comes back scored
The flow starts with a garak probe that builds the role-play or rephrased prompt, then hands it to a generator that sends it to the target endpoint. The target application's guardrails sit inside a trust boundary, so the reply is produced only after they have had their chance to refuse. The detector then scores each reply, and the run writes every attempt and its evaluation to the JSONL report. Check that the generator points at the same endpoint your users reach, and that the detector is the one recommended for the probe.
A probe's prompt crosses the target's guardrails before a detector scores the reply.
What each probe family sends
The grandma probes in probes/grandma.py wrap a request inside a familiar, emotionally framed role. The model is asked to speak as a grandmother who tells a story, shares a memory or offers comfort, and the sensitive request sits inside that persona. The attack idea is to move the model from refusing a direct question to continuing a warm, cooperative character. This family tests guardrails that judge requests mainly by their surface wording and that can weaken when a request is framed as harmless storytelling or personal care. Chat assistants tuned mostly on direct requests often show this gap.
- Persona framing: the model is cast as a relative, so refusing can feel like breaking character.
- Emotional register: warmth and nostalgia are used to lower the model's caution.
- Contentious topics: the probes target information a policy should withhold even when it appears in narrative form.
- Single-turn delivery: each attempt is one prompt, which makes repeated generations inexpensive.
Before treating a hit as a policy failure, read the output in the report, because a fictional or generic answer may not disclose anything usable. Confirm which content categories your garak version covers in this family.
The doctor probes in probes/doctor.py pose as a physician or other professional with a legitimate-sounding need, and they include Policy Puppetry variants that format the prompt to look like authoritative policy or configuration text. The attack idea is to borrow authority. If the model treats a claimed professional role or a policy-shaped block as trusted instructions, it may set aside its own safeguards. This family tests two things: how the model weighs claimed credentials against its safety policy, and how it handles instructions that arrive inside user content rather than from the system prompt. Applications that let users paste documents or templates are exposed to the second point.
- Claimed authority: a professional identity is used to justify a request that would otherwise be declined.
- Policy-shaped text: Policy Puppetry variants present instructions as formal rules the model should follow.
- Instruction hierarchy: the probes test whether user-supplied text can override system-level instructions.
- Mixed content: the same pattern can arrive through pasted documents, forms or retrieved content.
Check the exact prompt structure of each variant in the source file, and confirm how your application separates trusted instructions from user input before deciding which results matter.
The phrasing probes in probes/phrasing.py rewrite unsafe requests in the past or future tense. A request to perform a harmful task becomes a question about how someone did it historically, or a description of what someone will do. The underlying ask stays the same, but its grammatical frame changes. The attack idea is that many guardrails learn to recognize direct, present-tense imperatives, and a reframed sentence can fall outside those learned patterns. This family tests whether safety behavior depends on the request's meaning or on its phrasing. It is a useful check for input filters, keyword rules and classifiers trained on common request styles.
- Tense shift: the same content is recast as historical or hypothetical.
- Meaning preserved: the probe keeps the underlying intent, so a refusal should still hold.
- Classifier brittleness: intent detectors trained on direct phrasing may miss reframed text.
- Low cost: rephrasings are short, cheap to generate and easy to repeat across many variants.
After a run, compare the flagged responses with the unrephrased versions of the same requests, so you can see whether the change in tense alone altered the model's behavior.
The SATA probe in probes/sata.py masks the harmful text so it does not appear in plain form in the prompt, then links the masked text to a simple assistive task, such as filling in blanks. The model is asked to reconstruct the hidden content and then act on it. The attack idea is that input filters scanning for harmful strings see only fragments, while the model performs the reconstruction itself. This family tests two layers: whether input scanning catches masked content, and whether the model checks what it reconstructs before completing the task. It is especially relevant to applications where a model is asked to fill, complete or transform text.
- Masked input: the sensitive phrase is hidden from plain-text filters.
- Assistive framing: the request is presented as a helpful completion task.
- Reconstruction step: the model must rebuild the text before it can respond, which is a point where a check can occur.
- Output scanning: detectors read the response, so they can catch harmful content even when the input looked harmless.
Confirm whether your application scans inputs, outputs or both, because a masked prompt can pass input rules and still produce content that output checks should catch.
Why cheap single-turn disguises still break guarded models
The techniques in this group are cheap, single prompts that wrap a request in a new framing. The explanations below are hypotheses about why such framings still get past guarded models, so treat each one as something to check against your own garak results rather than as established fact.
Safety training covers known framings
Refusal behavior is often tuned on the wording and framings seen during training. A grandmother story, a clinician persona or a tense shift can move a request just far enough from those examples that the refusal does not fire. Compare the grandma and doctor probe results against a plain version of the same request to see how much the framing alone changes the outcome.
grandma probe sourceGuardrails match surface wording
Keyword or pattern filters look for trigger words in the prompt. Rephrasing a request in past or future tense keeps the intent but changes the surface text, which can slip past a filter that never saw that phrasing. Check whether your guardrail reads intent or only text by running the phrasing probes with and without your input filter in place.
phrasing probe sourceInstruction following pulls against refusal
Models are trained to be helpful and to complete tasks. A SATA prompt frames harmful text as a simple assistive fill-in task, so the model may weigh task completion above the refusal it would give to a direct request. Test whether your model's helpfulness training makes it more likely to complete a masked task than to decline it.
SATA probe sourcePersona overrides the system role
A doctor or expert persona asks the model to adopt a role that may seem to carry authority. In an application, that persona can compete with the operator's system prompt about what the assistant is allowed to do. Confirm whether your application's instructions still hold when a user claims a professional role, using the doctor probes against your deployed system prompt.
doctor probe sourceSingle turns skip context checks
A single prompt gives the model no earlier exchange to notice drift, so each framing is judged fresh. Because these attacks cost one request each, they are cheap to repeat at volume, and a failure rate from several generations per prompt can reveal inconsistency that a single answer would hide. Review the per-attempt records in the JSONL report before judging a model on one response.
garak user guideConfiguration options and when each fits
This table compares the configuration choices that shape a role-play and rephrasing jailbreak run in garak, and shows which setting suits a routine scan and which suits a focused test of a guardrail. Read each row as a decision: the default is a reasonable starting point for broad coverage, while narrower settings give a sharper answer about one control. The main takeaway is that the same probes can answer different questions depending on how you select them, how many generations you request, and which detectors score the output.
| Option | Routine scan | Focused guardrail test |
|---|---|---|
| Probe selection by family | Run the grandma, doctor, phrasing and sata families together to cover the range of role-play and rephrasing attempts | Select only the family that matches the guardrail under test, such as sata alone when checking masked-text handling |
| Generations per prompt | Keep the default of 5 generations, so any single undesirable output marks the probe as FAIL | Raise generations for a guardrail that is intermittent, and compare failure rates across runs to see whether a fix held |
| Detector choice in the probewise harness | Accept the recommended detectors that the probewise harness applies to each probe | Name detectors explicitly so scoring matches the harmful content your policy defines, and confirm them against sample outputs first |
| Generator: built-in versus REST | Use a built-in generator when the model is hosted on a supported service, so setup stays short and repeatable | Use the REST generator with a YAML endpoint file when the guardrail sits in front of the model, so the filter is part of what gets tested |
| Scan frequency and scope | Schedule the same family set on each release to catch regressions in general resistance | Run a narrow set after each guardrail change, then retest the failing prompts only once the fix is in place |
| Reading the report | Compare failure rates per probe across runs, using the JSONL report and the garak.log file | Inspect individual attempts in the JSONL report to confirm whether a FAIL reflects the guardrail or a scoring error |
How to set up and run these probes
This sequence takes you from a clean Python environment to a finished garak scan of role-play and phrasing probes against your target, with a report you can read and a log you can debug from. Each step ends with a check so you know it is safe to move on.
Confirm the Python and operating system prerequisites
The engineer running the scan checks that the host runs Linux or macOS and that Python 3.11 or newer is available, since the PyPI package requires that version. Garak is developed on those two platforms, so a Windows host is not the path this sequence assumes. Confirm with
python3 --versionthat the interpreter reports 3.11 or higher. You are done when that command returns the right version on the machine that will run the scan.Install garak from PyPI into an isolated environment
Create a dedicated virtual environment so garak and its dependencies stay separate from system packages, then install the tool with
pip install garak. The package is published on PyPI and is licensed under Apache 2.0. Confirm the install by runninggarak --helpand checking that the command lists its options. You are done when the help output appears without import errors.Define the target generator in a YAML file
Choose the generator that matches your target. Hosted models such as OpenAI API or AWS Bedrock models have their own generator types, while an internal chatbot or guarded application is usually reached through the REST generator. For a REST endpoint, write a short YAML file that names the URL, the request body template, the headers (including credentials read from environment variables, not typed into the file) and the path to the response text. Confirm the file by making one manual request to the endpoint with the same payload and checking that the response matches the path you configured.
Run a generator smoke test before the full scan
Start with a single small probe so you can see whether the target answers and whether garak parses the reply correctly. Point garak at the generator config with a narrow probe selection and review the terminal output for connection errors, authentication failures or empty responses. Your target's own logs and rate limits are the place to confirm that the traffic arrived as expected. You are done when the smoke test completes and the responses shown are the target's real answers, not error text.
Select the role-play and phrasing probes
Pass the grandma and doctor probe families for role-play, and the phrasing and SATA probes for past and future tense rephrasing and masked text. Garak lists available probes, so run its list command first to confirm the exact probe names in the version you installed, since names can change between releases. Record the selection in a config file so the same probes run on every repeat scan. You are done when the listed probes match your selection and the config file is saved in version control.
Run the scan and keep the default generation count
Launch the scan with the chosen generator and probe selection. By default garak makes 5 generations per prompt and marks a probe as FAIL when any attempt produces undesirable output, so leave that setting in place for a first baseline unless your team has a reason to change it. Note the start time, the garak version and the target version, because these details matter when you compare runs later. You are done when the run finishes and the terminal shows a per-probe result for each selected probe.
Review the JSONL report for each attempt
Open the JSONL report that the run wrote. It contains every attempt and its evaluation, so you can see the exact prompt sent, the response received and the verdict for each one. Read the failed attempts first and check whether the flagged output is a real policy breach or a detector false positive. You are done when you can point to at least one attempt, read the prompt and response, and explain the verdict in your own words.
Check garak.log for errors and archive both files
Open garak.log, the debugging file that continues across runs, and search it for errors, timeouts or retries that may have skewed results. Then store the JSONL report, the log and the config file together under the same run identifier so the evidence can be reproduced. Confirm that the archive contains all three files and that the config reproduces the same probe selection when run again. You are done when the archived set is complete and a second run from that config starts without manual edits.
How to read a FAIL on a role-play probe
A FAIL on a role-play or rephrasing probe does not mean the model failed most of the time. garak marks a probe as FAIL with a failure rate as soon as any attempt produces undesirable output, and by default each prompt gets 5 generations. A probe that fails one of five attempts is still a FAIL, so the failure rate tells you how often the model was pushed past its guardrails, not how severe the breach was. Read the rate together with the count of attempts behind it, and check whether the failures cluster on one prompt template (for example, a grandmother persona) or spread across the whole family.
Open the JSONL report for the run and inspect the individual attempts before drawing conclusions. Each record holds the prompt as sent, the model's output and the detector scores that decided the outcome. For grandma and doctor probes, confirm the output actually supplies the contentious content rather than a refusal that quotes the persona back. For SATA probes, check whether the model decoded the masked text and acted on it, because a model that answers the assistive task while refusing the harmful part is different from one that completes the harm. Also check the detector: a keyword or refusal-style detector can score a safe answer as a hit, so mark those as false positives and confirm the detector's accuracy for this probe before counting them. The garak.log file helps when a result looks odd.
Decide what a failing rephrasing means for the application, not only for the bare model. Ask whether your deployed system prompt, input filter or output scanner would have stopped the same text, because a bare-model FAIL may be fully handled by a guardrail in production. If the guardrail misses a past- or future-tense rewrite that the model answers, that is a gap to fix in the application layer, and a retest after the fix is the evidence to keep. Record the findings, the affected prompt families and the decision taken, so that a later garak upgrade or rescan can show whether the same rephrasing still gets through.
Security and operational considerations for scanning
Scans of role-play and rephrasing probes produce attack transcripts, model outputs and credentials-in-use that need the same care as any security testing data. The cards below cover where that data lands, who can read it, what a live target can absorb, and how to keep secrets out of shared files.
Treat the JSONL report as sensitive
Each garak run writes a JSONL report of every attempt and its evaluation. For grandma, doctor and Policy Puppetry style prompts, that file holds the exact harmful-looking requests and any model replies that slipped through. Store it in the same access tier as the target's own logs, and decide retention before the first scan rather than after the report has been copied into a ticket.
- Generations per prompt
- 5
Review garak.log before sharing
The garak.log debugging file is continued across runs, so it accumulates entries from every scan in that working directory. It can contain prompt text, endpoint URLs and error payloads. Keep one working directory per target and check the log for pasted secrets before sending it to a vendor, a contractor or an issue tracker.
Limit who sees attack transcripts
Transcripts of successful jailbreaks show exactly how a model was pushed past its guardrails, which makes them useful to attackers as well as defenders. Restrict read access to the security and model owners, and agree in writing who may receive transcripts from an outside tester. Redact or summarize findings for broader audiences such as product or executive reviews.
Scan staging before production
Single-turn role-play probes are cheap, but they still send traffic that a production guardrail or moderation system will log, flag or count against quotas. Run the first scans against a staging endpoint with the same system prompt and model version, confirm the expected request volume with the owner of the production service, and schedule any live run for a window the operations team has approved.
Budget for repeated generations
Every probe prompt is sent several times by default, so one scan multiplies into many model calls. Metered APIs bill per call, and hosted endpoints may enforce rate limits that cause retries and skewed results. Ask the provider for its rate and quota terms, set a generations value that matches the question being answered, and track call counts per run.
Keep credentials out of shared configs
REST generator configuration files describe how garak reaches the endpoint, and it is easy to paste them into a ticket with an API key or bearer token still in the headers. Reference secrets through environment variables or your secrets manager, keep the config file free of values, and rotate any key that has appeared in a shared file.
garak user guideQuestions buyers ask before adding these probes to a scan
Can our internal security team run these garak probes on its own?
Yes, a capable internal team can install garak and run the role-play and phrasing probes, because garak is a free, Apache 2.0 licensed command-line tool installed from PyPI on Python 3.11 or newer. The harder part is what surrounds the run: writing a REST generator configuration for your endpoint, deciding which detector results count as real failures, and fixing the application so the same prompts stop succeeding. Ask whether your team has someone who can own each of those three steps before the first scan starts.
What drives the effort of a garak jailbreak assessment?
Effort is driven less by the probes themselves than by the work around them. The main drivers are:
- Endpoint setup: how many model or application interfaces you must connect, and how much authentication, session handling or response parsing the REST generator needs.
- Detector review: how carefully someone checks whether a flagged response is a genuine policy failure or a false positive from a detector.
- Remediation and retesting: how many failures need system prompt, filter or model changes, and how many retest cycles are needed before results are stable.
A narrow scope against one endpoint is far smaller than a multi-application programme, so ask for the scope in writing.
What does our team need to provide for these probes?
Plan to provide three things before work starts. First, endpoint access: a way to reach the model or application, with credentials and documentation of the request and response format. Second, a test environment that mirrors production guardrails, system prompts and tool settings, so results mean something for the live system. Third, a named owner who can make decisions about which failures matter and approve changes. Without the owner, detector results tend to sit unreviewed. Confirm also whether scans may send high volumes of prompts to the endpoint and whether that is allowed by your provider terms.
How long does a garak scan take?
Scan time grows with the number of generations per prompt and the number of probes selected. By default garak makes 5 generations per prompt, so a run that includes many role-play and rephrasing prompts multiplies quickly against a slow or rate-limited endpoint. Reducing generations or narrowing the probe list shortens runs, but fewer generations can hide intermittent failures, since a probe is marked FAIL when any attempt produces undesirable output. Ask for a timing estimate based on your endpoint's measured response time and rate limits, not on a generic figure.
Do we need a partner to fix the failures these probes find?
Not always. Many failures, such as a weak system prompt or a missing output filter, can be fixed by your own engineers once the failing prompts are clear. A partner is useful when fixes touch several layers at once, such as guardrail configuration, tool permissions and model choice, or when your team lacks time to retest. Whatever you choose, agree in writing who makes each change and who runs the retest. DeployOpen plans and delivers this work as fixed-scope engagements, and ongoing retesting is available as a retainer.
Are role-play and rephrasing probes enough to test a guarded model?
No single probe family is enough. Role-play probes, such as the grandma and doctor probes, and the phrasing probes, which rephrase requests in past or future tense, test a specific kind of single-turn bypass. They should sit alongside probes for direct prompt injection, encodings and multi-turn attacks, chosen to match how your application is exposed. Ask your reviewer to map each probe family to a risk in your threat model so the scan covers the paths that matter for your users.
How should we handle results from role-play probes in a compliance review?
Keep the JSONL report from each run, record the garak version, the probes and generations used, and the reviewer's decision on each flagged result. garak writes a JSONL report of every attempt and its evaluation, plus a garak.log file continued across runs, and these files are the raw evidence. Scores can shift between garak releases, so record the version, such as v0.17.1 released on 16 October 2026, with every run. Confirm with your auditor which evidence format they expect, since DeployOpen prepares evidence but does not issue audit reports or certifications.
Turning a failing role-play result into a guardrail fix
Start by reproducing the failing prompt outside the full scan. garak's JSONL report records every attempt and its evaluation, so copy the exact prompt, the generation that failed and the detector that flagged it from that report. A FAIL in the summary marks a probe where at least one of the default five generations produced undesirable output, so confirm which generation failed before you change anything. A grandma, doctor, tense-rephrasing or SATA prompt that succeeds once in five attempts is still a real weakness, and a single replay tells you whether the failure is stable or intermittent. Record the model version, system prompt and endpoint settings alongside the prompt, because a fix that only works against a different configuration proves nothing.
Then decide where the fix belongs. A system prompt change can tell the model to refuse persona-based or hypothetical framings that ask for the same content, but it is the weakest control against role-play because the attack is written to override instructions. An input filter can catch recurring templates such as a claimed medical credential or a past-tense reframing of a restricted request, though a rephrased version may slip past it. Output scanning checks what the model actually produced, which helps when the wording of the attack keeps changing. Model choice matters when the same failure appears across all your guardrail layers. Test one change at a time where you can, and note which layer you changed, so the evidence shows which control closed the gap.
Rerun the same probes with the same configuration to confirm the fix. Keep the same generator settings, system prompt, generation count, detectors and any buffs or harness options, and point the run at the same endpoint, because changing these alters the comparison. Compare the new failure rate with the baseline report and check that the fixed prompt now passes while nearby variants in the same probe family still fail or pass as before. If the rerun changes the probe set or the garak version, the scores may not be comparable, so confirm the version with your team before reading the difference as a fix. Keep both reports together so an auditor or reviewer can see the before and after.
How DeployOpen scopes and delivers garak jailbreak testing
The sequence turns a request to test role-play and rephrasing jailbreaks into a written scope, a scan inside your environment, findings with fixes, and a retest. Each step closes with a named output so both sides can confirm progress before the next one starts.
Confirm the target and its exposure
DeployOpen and your team identify the exact system under test: the model or endpoint, whether a system prompt, guardrail layer or content filter sits in front of it, and which user groups can reach it. Your team confirms the access method, such as an API key or a REST endpoint described in a short YAML file. The step closes with a written target description that names the deployment, its guardrails and the owner who approves testing.
Select the role-play and rephrasing probes
DeployOpen maps the application's realistic misuse cases to garak's grandma, doctor, phrasing and SATA probes, then adds or removes probe families that overlap with the topic. Detector choices and the number of generations per prompt are recorded alongside the probe list, because the default is 5 generations per prompt and any single undesirable output marks a probe as FAIL. The step closes with a probe plan that lists each probe, its purpose and the detectors that score it.
Agree the scope and deliverables in writing
DeployOpen issues a written scope that covers targets, probes, generations, the environment where runs execute, the report format and the retest terms. Your procurement, security and legal contacts review the document before work starts, and any change to the scope after signing is recorded as a written amendment. The step closes with a signed scope and a quote derived from it. DeployOpen does not publish a price list, so cost follows from the scope rather than a fixed rate.
Prepare the environment and run the scan
DeployOpen installs garak from PyPI in an environment you control, using Python 3.11 or newer, and connects it to the target through a generator configuration. Runs happen inside your network or cloud account, and your team confirms that prompts, responses and logs stay where your data handling rules require. The step closes with completed runs that each produce a JSONL report of every attempt and a garak.log file that accumulates across runs.
Review attempts and validate failures
DeployOpen reviews the JSONL output for each probe, checks whether a FAIL reflects genuine undesirable content or a detector false positive, and records the failure rate per probe. Successful grandma, doctor, past tense and SATA attempts are grouped by technique so your team sees which framings the guardrails missed. The step closes with a validated list of confirmed failures, each linked to the attempt that produced it.
Report findings with fixes
DeployOpen delivers a findings report that describes each confirmed failure, the affected probe family, the reproduction steps and the severity your organization assigns. Each finding carries a recommended fix, such as tightening the system prompt, adding an output filter, changing the guardrail configuration or restricting the role-play surface of the application. The step closes with a report your engineering and security teams can assign and track.
Retest after fixes are applied
After your team applies the agreed fixes, DeployOpen reruns the same probes with the same generation settings and compares results against the baseline run. Because garak scores can shift between releases, the retest notes the garak version used for both runs so differences are not mistaken for fixes. The step closes with a retest report that marks each finding as resolved, partly resolved or still open.
Move to continuous testing if needed
Where the application changes often, DeployOpen and your team can agree a retainer for recurring scans, probe updates and retesting after model or prompt changes. The retainer scope, cadence and reporting are set in writing, and your team decides whether scheduled rescans run in your CI pipeline or on DeployOpen's schedule within your environment. The step closes with a recurring scope document and a named schedule for the next scan.

