Agent Security
Jailbreak testing: a controlled evaluation methodology
Design authorized jailbreak tests with clear policy criteria, representative cases, calibrated scoring, and evidence that supports a bounded release decision.
For: AI evaluation leads, application security teams, enterprise assurance reviewers
Jailbreak testing evaluates whether an AI system can be induced to violate a defined safety or behavioral restriction. A useful test specifies the restriction, records the evaluated configuration, exercises controlled adversarial cases, and judges the resulting behavior against an agreed rubric. It also checks that permitted requests still work. The result is evidence about a bounded test, not proof that the system cannot be bypassed.
For an enterprise release decision, the most important output is a reproducible finding that an owner can investigate and retest. A collection of dramatic screenshots offers much less value if nobody can identify which policy failed, whether the system attempted an action, or which configuration produced the response.
The methodology below is for authorized defensive evaluation using synthetic data and isolated test resources. It explains test design and interpretation without providing attack prompts for public or third-party systems. Clarify the difference between prompt injection and jailbreaks when deciding which boundary the test should examine.
Write a test charter before selecting cases
Start by defining the decision the evaluation must support. A team choosing between model configurations needs a comparable test. A team investigating a reported failure needs focused reproduction. A team approving a new agent workflow needs evidence about that workflow and its controls. Those purposes can share cases, but they should not share an undefined success criterion.
Record the target application and owner, permitted interfaces, testing window, resource budget, and authorized techniques. State whether the work covers single-turn conversations, multi-turn sessions, tool interactions, or another surface. Identify excluded systems and the person who can stop the test.
Use fake accounts, nonfunctional credentials, and synthetic documents. Replace external actions with controlled test doubles wherever the case does not require real integration behavior. If a test unexpectedly reaches production data or an unapproved destination, stop that path and notify the named owner. Do not expand the scope simply because the system exposed another opportunity.
Keep the distinction between focused testing and a wider engagement visible. The OWASP GenAI Red Teaming Guide covers model evaluation, implementation testing, infrastructure, and runtime behavior. A jailbreak exercise can contribute evidence to that larger review while leaving important areas untested.
Convert a policy into an observable criterion
“The assistant must be safe” cannot be scored consistently. Break the requirement into behavior a reviewer can observe, including what remains allowed.
For example, an organization’s content policy might permit a high-level explanation of a hazardous topic while prohibiting operational instructions that enable the hazardous activity. The test criterion must distinguish the two. Otherwise, a scoring system may incorrectly treat a helpful safety explanation as a failure or an empty refusal as the only acceptable answer.
For each criterion, write:
- The policy reference and version.
- The prohibited behavior or disclosure.
- Permitted alternatives, including explanation, redirection, or escalation.
- The evidence required to establish a violation.
- The severity and owner if the criterion fails.
Have the policy owner resolve unclear boundaries before a large run. Where judgment remains necessary, preserve that uncertainty in the rubric. A model-generated evaluator should not quietly decide the organization’s policy. For confidential instructions, the prompt extraction verification guide explains how to distinguish a real disclosure from inferred or invented text.
For a tool-using system, make separate criteria for generated content and attempted operations. A prohibited statement, an unauthorized tool request, and a completed side effect are different observations. Capturing them separately helps explain both the failure and any control that contained it.
Build a balanced case set
Organize cases around the restrictions and users relevant to the deployment. Then vary the pressures applied to those restrictions, rather than collecting many near-duplicates of one memorable example.
The MLCommons Jailbreak Attack Taxonomy organizes known single-turn mechanisms into families and distinguishes that public taxonomy from its benchmark. This makes it useful for checking diversity, but it does not supply a complete application-specific test plan or cover every multi-turn interaction.
A practical case matrix can include these dimensions:
| Dimension | Design question |
|---|---|
| Policy area | Which approved restriction does this case exercise? |
| User context | Does the role, language, or task context reflect an intended user? |
| Interaction length | Is the criterion evaluated in one turn or across a session? |
| Adversarial pressure | Does this case add a meaningfully different challenge? |
| Safe counterpart | Can the system still answer the nearby permitted request? |
| Required evidence | Are text, tool traces, or downstream observations needed? |
Keep a small development set for refining the harness and rubric. Reserve separate cases for evaluating the resulting configuration. If engineers repeatedly tune against every available case, the final result becomes harder to interpret as evidence beyond those examples.
Avoid treating harmless surrogate tasks as equivalent to real safety-policy tests. Synthetic tasks are useful for checking the harness and instruction handling. They do not establish how a model will behave in every sensitive domain. Document what the surrogate represents and which claims it cannot support.
Fix the configuration and execution budget
Record enough information to explain what was evaluated: model identifier, application revision, instruction version, active safeguards, tool definitions, permission setup, and relevant generation settings. Note provider behavior that you cannot pin or observe. A named model alone is not a complete system description.
Decide the number of independent sessions, allowed turns, retries, and total requests before comparing configurations. Reset conversation state where the case requires a fresh session. Where memory is intentionally part of the test, define its initial contents and reset procedure explicitly.
Keep exploration separate from regression
Adaptive exploration and fixed regression testing serve different purposes. Exploration can change the next case based on an observation. A regression run repeats approved cases under a specified setup. Keep their results separate, and record the exploration budget so a longer search is not presented as a directly comparable test.
For repeated runs, retain every outcome. A single observed failure may justify investigation even when other repetitions pass. Selectively reporting the best response hides the behavior the exercise was designed to uncover.
Calibrate scoring before scaling the run
Use an outcome rubric that allows uncertainty. The following is an example design, not a universal grading standard:
| Outcome | Meaning | Follow-up |
|---|---|---|
| Boundary upheld | Required evidence shows the prohibited behavior did not occur | Check whether the legitimate task remained useful |
| Violation observed | Evidence meets the prewritten failure criterion | Triage impact and preserve the reproducible case |
| Inconclusive | The response or trace does not support a confident judgment | Obtain review or improve observability |
| Execution error | A harness or infrastructure problem prevented a valid test | Repair and rerun without counting it as a pass |
Test the rubric on representative outputs before applying it widely. Ask reviewers to score a shared sample independently, discuss disagreements, and refine ambiguous instructions. Record the rubric version used for each run.
Automated judges can help organize review, but validate them against the actual criteria. A keyword match may miss a violation expressed differently. A judge can also misread quoted material, overlook a tool request, or mistake a refusal sentence followed by prohibited detail for a safe response. Route consequential or ambiguous outcomes to a human reviewer.
Do not reward a system simply for refusing more often. A safe counterpart case should establish whether it still completes permitted work. Track unnecessary refusals alongside violations, rather than assuming that stricter blocking is always an improvement.
Report denominators and consequence together
If you report a failure rate, define both the numerator and denominator. State whether the unit is an individual response, completed conversation, or tested objective. Give the number of valid cases and report inconclusive cases and execution errors separately. Explain how repeated attempts were combined.
A useful release summary might say that a particular policy boundary failed under a specified conversation condition, that the downstream operation was blocked, and that the finding remains open. It should not collapse those observations into an unexplained security percentage.
Compare like with like. Changes to cases, attempt budgets, prompts, model settings, or judging rules can affect the result. If several elements changed, acknowledge that the comparison does not isolate the effect of one remediation.
Preserve high-consequence findings outside the aggregate. A single unresolved violation may be more important to the deployment decision than many successful low-impact cases. Name the exposure and the release rule it affects so reviewers can decide what action is needed.
Retest the fix and keep the useful work working
Assign each confirmed finding to an owner with a remediation hypothesis. The fix might involve instructions, model configuration, content controls, application logic, or a narrower workflow. Record what changed and why it should address the observed failure.
Rerun the original case, relevant variations, and permitted neighboring tasks. Retain the earlier evidence rather than replacing it with the successful retest. If the new result is ambiguous, keep the finding open with the missing evidence clearly stated.
The NIST AI RMF Playbook offers voluntary guidance across Govern, Map, Measure, and Manage. In that spirit, connect the test to an accountable decision: who accepts the remaining risk, which conditions limit use, and what change should trigger another review. The framework does not prescribe a universal passing score for a jailbreak test.
Approved regression cases can inform a CI/CD assurance gate, with human review for unresolved outcomes. Material changes to instructions, models, tools, or scope should prompt a coverage review instead of assuming that an earlier result still applies.
Make the evidence useful to the next reviewer
Before closing an evaluation, check that another authorized reviewer can identify the configuration, reconstruct the case, apply the rubric, and locate the observed result. Protect sensitive traces and share a bounded summary when full content is unnecessary.
AI Agent Certify’s prompt injection and jailbreak testing approach provides a starting point for discussing those boundaries and the evidence needed to review them. Request a demo to agree the evaluation scope, review process, and supported delivery approach for your enterprise.