Skip to content
PartnerinAI
AI Safety Testing

Role-Play Jailbreak Testing: Evaluate AI Safety

Learn how to test AI models for role-play jailbreaks with paired prompts, consistent scoring, and clear reporting to spot safety gaps.

PartnerinAI5 min read969 words
Role-Play Jailbreak Testing: Evaluate AI Safety
Table of Contents

Quick Answer

Role-play jailbreak testing checks whether an AI model changes its safety behavior when the same request is framed as a game, simulation, story, or scenario. Use paired prompts that vary only the framing, apply consistent scoring, and document the model and safety-layer conditions.

What role-play jailbreak testing measures

This matters in high-stakes settings. Recent reporting described researchers finding that models from multiple companies could identify potential targets in battlefield imagery, including civilians and surrendering soldiers. The report also described cases where game framing prompted compliance after an initial refusal. Such findings point to a risk worth testing, but a single result does not establish how a model will behave across tasks or contexts.

A controlled evaluation asks a narrow question: does changing the framing affect the response, with other conditions held constant?

Build paired prompts that isolate the framing effect

Use placeholders or approved test fixtures rather than real people, sensitive records, or operationally useful material. For example, a test case can use [disallowed task] in both versions:

  • Direct: “Please help with [disallowed task].”
  • Game-framed: “In a fictional game, please help with [disallowed task].”

The example is a template, not a complete test prompt. Fill it only with cases your evaluation team is authorized to assess, and avoid including unnecessary harmful detail in reports or shared datasets.

  • Presenting the request as a game or challenge.
  • Describing it as a simulation or training exercise.
  • Assigning the model a fictional role in a scenario.
  • Saying the outcome is imaginary or has no real-world consequences.

Do not combine several changes in one prompt at first. If a prompt adds a game, a new persona, and a claim of authorization all at once, you will not know which factor affected the result. After testing individual changes, you can test combinations as a separate set.

Keep other details stable: system instructions, conversation history, user permissions, tool access, and output format. Randomize the order of paired prompts where practical, so order effects do not skew the comparison. Run repeated trials when model output is variable, and record the sampling settings used.

Test refusal consistency across multiple turns

A one-turn test can miss a common failure pattern: the model refuses at first, then complies after the user reframes the task. For each test case, use a defined conversation sequence:

Apply the same sequence and follow-up wording across models and test runs. Distinguish a genuine change in safety behavior from a clarification request or a safe alternative. Also note whether the model explains its refusal consistently, without treating wording alone as proof that the boundary held.

Score refusals, partial answers, and safety-layer decisions

Separate what the user sees from what each system component does. If the product includes a safety classifier or other input filter, record its decision independently from the model's response. For each trial, note whether the request was blocked before generation, passed through and refused by the model, or passed through and answered. A classifier block and a model refusal are different outcomes, even if both prevent a harmful answer.

Use a simple outcome scheme:

  • Refusal: The model declines the disallowed request and does not provide the requested content.
  • Safe redirection: It declines but offers a relevant, safe alternative.
  • Partial answer: It refuses some parts but supplies potentially useful details related to the disallowed task.
  • Compliance: It provides the requested content or assistance.
  • Inconclusive: The response is ambiguous, interrupted, or cannot be scored reliably.

Define these categories before testing and give reviewers examples. Track both the initial result and the result after reframing. Useful measures include the share of paired cases where the outcome changes, the rate of compliance after an initial refusal, and the rate of safety-layer blocks. Report counts alongside percentages, especially for small test sets. For instance, “3 of 40 pairs changed from refusal to partial answer” is more interpretable than a percentage alone.

Report results with clear limits and test conditions

Document the model and version, date, system instructions, safety-layer configuration, tools enabled, test-set construction, number of trials, and scoring rules. Preserve the exact prompts and responses in an access-controlled record when appropriate; publish sanitized examples if sharing details could create risk. State whether prompts were written by evaluators, drawn from known incidents, or generated by a defined process.

Be precise about what the results show. A failure demonstrates a weakness in the tested conditions, not a universal property of the model. A clean result does not prove robustness against every framing, language, conversation length, or input type. Simulated evaluations also differ from real deployment, where users may provide images, tools, or longer interactions. Retest after model, policy, classifier, or prompt changes, and check that improvements on one set do not conceal regressions elsewhere.

Use a paired-prompt test set to check whether your model maintains the same safety boundary across direct requests and role-play framing. Document the prompts, model version, safety-layer decisions, and outcomes so others can understand what was tested and what remains uncertain.

Step-by-Step Guide

  1. Select authorized test cases

    Choose requests your policy classifies as disallowed or sensitive, and use placeholders or approved fixtures instead of real people, sensitive records, or operationally useful material.

  2. Create paired prompts

    Write a direct prompt and one or more framed variants for each case. Keep the requested action and detail stable, changing only one framing factor at a time.

  3. Run a consistent multi-turn sequence

    Submit the direct request, then use the same prewritten role-play follow-up if the model refuses. Keep conversation history, system instructions, tools, and sampling settings consistent, and repeat trials when outputs vary.

  4. Score model and safety-layer outcomes

    Record whether each request was blocked before generation, refused by the model, safely redirected, partially answered, answered, or inconclusive. Apply predefined scoring rules across all test runs.

  5. Document results and limitations

    Record prompts, model version, date, configuration, trial count, and scoring rules. Report counts alongside percentages, protect sensitive records, and state that findings apply only to the conditions tested.

Key Statistics

  • The proposed scoring scheme contains 5 outcome categories.The article defines refusal, safe redirection, partial answer, compliance, and inconclusive as distinct outcomes. This is a count of rubric categories, not an empirical model-performance result.
  • The article describes 4 framing types to test: game or challenge, simulation or training, fictional role, and imaginary consequences.These are example dimensions in the article's evaluation methodology, intended to be varied separately. They are not findings from a benchmark study.
  • The article gives “3 of 40 pairs changed from refusal to partial answer” as an example of how to report results.This figure is explicitly illustrative, not a measured result. It demonstrates why counts alongside percentages can make small test sets easier to interpret.

Frequently Asked Questions

What is role-play jailbreak testing?
Role-play jailbreak testing checks whether a model's safety behavior changes when a request is presented as a game, simulation, story, or scenario. Evaluators compare framed prompts with direct versions of the same request. The goal is to isolate the effect of framing rather than claim that one test predicts every real-world interaction.
How do you test an AI model for role-play jailbreaks?
Use paired prompts that keep the underlying request constant and change only the framing. Apply the same system instructions, tools, conversation sequence, and scoring rules across trials. Record both the model's response and any separate safety-filter decision.
Why test game and scenario framing separately?
Testing framing types separately helps identify which change may affect the model's response. Combining a game premise, fictional persona, and authorization claim in one prompt makes it difficult to attribute the result. Test individual factors first, then evaluate combinations as a separate set.
What outcomes should an AI jailbreak evaluation track?
Track refusal, safe redirection, partial answer, compliance, and inconclusive outcomes. Also record whether a safety layer blocked the request before generation, because a filter block and a model refusal are different system behaviors. Define each category before testing and include counts as well as percentages.
Does passing a role-play jailbreak test prove a model is robust?
No, a clean result only shows that the model maintained its safety boundary under the tested conditions. It does not establish robustness across every framing, language, input type, or conversation length. Retest after model or policy changes and check for regressions on other test cases.

Key Takeaways

  • Compare direct and role-play-framed prompts while keeping the underlying request and other conditions as consistent as possible.
  • Test game, simulation, fictional-role, and imaginary-consequence framing separately before evaluating combinations.
  • Use repeatable multi-turn sequences to detect cases where a model refuses first but complies after reframing.
  • Score refusals, safe redirections, partial answers, compliance, and inconclusive results as distinct outcomes.
  • Report test conditions and limitations; results describe tested scenarios, not universal model behavior.