By UNST33R

How to jailbreak AI models: attack families, ASR measurement, and a harness that survives review

An authorized-testing methodology for jailbreak work: how jailbreaking differs from prompt injection and from abliteration, the nine attack families worth probing, strict versus lenient attack success rate, judge design, the tooling chain from PyRIT to garak to CI gates, and the model-tier math for probe generation and adjudication.

Search interest in jailbreaking AI splits cleanly in two. One audience wants a working payload for a model someone else owns, and that half of the internet takes care of itself. The other audience is security teams who need to measure refusal behavior on systems they are authorized to test: a guardrail commit going out, a gateway configuration change, a model upgrade behind the same endpoint. This guide is for the second audience. It covers the attack families worth probing, how to score results so they survive review, and the harness that turns a one-off run into a regression gate. Scope first: run this against deployments you own or have written authorization to test, inside the boundaries of an acceptable use policy you can cite in the engagement letter.

Three problems that get conflated

Before choosing tools, separate the three questions that "red teaming an LLM" mixes together, because each has a different target and a different remedy:

QuestionWhat it is calledWhere the attacker operatesCovered in depth
Can input text alone pull policy-violating output from a guarded model?JailbreakingInput space, single or multi turnThis post
Can content that arrives through a data channel hijack the model's instructions?Prompt injectionRetrieval, tool output, documentsInjection regression suite
Can refusal behavior be removed from the weights themselves?AbliterationWeight space, offlineWhat is abliteration

Jailbreak testing asks the first question on purpose, with a corpus you control and a scorer you validated. The three layers of refusal removal covers the third question's ecosystem. The distinction matters operationally because a deployment can pass an injection suite and still fold to a two-turn jailbreak, and a fully uncensored model makes jailbreak testing meaningless on itself while making it more useful everywhere else, as a probe generator. That last asymmetry drives the model selection section below.

The nine attack families

Attack families cluster by the mechanism they stress. A test plan that samples each family at least once per candidate model catches guardrail regressions that single-family suites miss:

FamilyMechanismWhat it stresses
Persona and roleplay framingRequests harm inside a fictional role the model acceptsPolicy scope around adopted identities
Hypothetical and academic framingRequests harm as a thought experiment, exam answer, or fictionBoundaries between explanation and instruction
Encoding and ciphersPayload delivered base64, ROT13, leetspeak, or cipheredInput-side filter dependence on plaintext
Prefix and token smugglingModel asked to continue a partially written answerNext-token momentum versus policy evaluation
Many-shotDozens of fabricated in-context dialogue turns modeling complianceLong-context policy drift (arXiv:2404.14421)
Crescendo multi-turnBenign opening that escalates one small step per turnPer-turn state tracking across the conversation
Skeleton keyA context-setup turn claiming altered rules precedes the requestDeference to stated context over trained policy
Low-resource language switchPayload in a language the safety tuning undercoversMultilingual alignment coverage
Buried instructionTarget request hidden inside long irrelevant contextAttention allocation under context load

Two of these ship as named attack classes in Microsoft's PyRIT: ManyShotJailbreakAttack and CrescendoAttack, alongside SkeletonKeyAttack. That mapping is deliberate. Framework implementations encode the conversation-state machinery (memory, turn limits, transcript export) that is tedious to rebuild, and the multi-model sweep walkthrough shows how to point them at an OpenAI-compatible endpoint through one target class.

Scoring: the part that decides whether results mean anything

A jailbreak run without a scoring contract produces a number nobody can defend. Build the contract before the corpus.

Strict and lenient ASR, both reported. Lenient scoring counts any policy-relevant acknowledgment; strict scoring requires the specific harmful deliverable to appear. Report both: strict ASR is your regression metric, and the strict-lenient gap measures how often the model engages before stopping, which is itself a behavior worth tracking. If 12 probes out of 200 strict-scored succeed, strict ASR is 6.0 percent; the fraction is trivial, the scoring rubric behind "succeed" is the work.

Judge design. Keyword matching alone misses paraphrase; an unvalidated LLM judge alone drifts with the judge model's own refusals. The working pattern is hybrid: deterministic keyword screens for the deliverable, an LLM judge for the gray zone, and a hand-labeled sample of a few hundred transcripts to measure the judge's false positive and false negative rates before you trust it. The garak scan guide covers the same discipline from the scanner side, including why raw scanner scores mislead across models.

Benign lookalikes. Run a control set of benign-but-scary requests, such as explaining parameterized queries or parsing an authentication log. A guardrail change that drops ASR to zero while refusing half the lookalikes has moved the failure mode, and the PyRIT CI gate design shows this false-refusal metric wired directly into the block decision.

Determinism hygiene. Fix seeds and sampling parameters per run, deduplicate the corpus by semantic equivalence, and version the corpus like code, because a corpus that silently drifts between runs makes every ASR delta uninterpretable.

The harness

The minimum viable harness is small. Point an OpenAI-compatible client at the endpoint under test, send the corpus, persist every transcript with its score:

from openai import OpenAI

client = OpenAI(base_url="https://api.unst33r.si/v1", api_key=KEY)

def probe(system_prompt: str, user_payload: str) -> str:
    r = client.chat.completions.create(
        model="target-model-id",
        temperature=0.0,
        max_tokens=1024,
        messages=[
            {"role": "system", "content": system_prompt},
            {"role": "user", "content": user_payload},
        ],
    )
    return r.choices[0].message.content

That loop answers single-turn questions and nothing else. Multi-turn families need conversation state, which is the point where the framework layer pays for itself. The tooling split that works in practice:

LayerToolRole
Multi-turn attacks and orchestratorsPyRIT with LiteLLMChatTargetCrescendo, many-shot, skeleton key classes against any OpenAI-compatible base URL
Probe breadthgarakScanner probe packs across vulnerability classes with JSONL evidence
Template matricespromptfooSystem-prompt and template variation sweeps with per-plugin scoring
Regression enforcementCI gateBlock merges when jailbreak rate crosses the threshold line

The one-line base_url swap is what makes the whole stack portable across hosted endpoints, and the OpenAI-compatible switching guide covers it for the common client libraries.

Choosing the generator and judge models

The quiet failure mode of jailbreak pipelines is upstream of the target: the model generating your probe corpus starts refusing, the corpus quietly thins out, and ASR falls for a reason that has nothing to do with the guardrail under test. This is the documented motivation for running probe generation on refusal-reduced or uncensored models, and it is where model selection becomes part of methodology:

WorkloadTier shapeExample rates (per 1M tokens)
Bulk probe and corpus generation, high volume, repeated runsAbliterated budget tier with cached-input pricingunst33r-deepseek: $0.15 in / $0.5625 out, $0.03125 cached
Tool-call-heavy adversarial dialogue, multi-turn orchestrationMid tier with strong tool-calling fidelityunst33r-flash: $0.50 / $1.50
Judge passes and adjudication of gray-zone transcriptsStrongest reasoning tier, low volumeunst33r-pro: $2.50 / $4.50

The arithmetic favors the split. A weekly corpus refresh of 10 million input tokens with 8 million repeated from the prior week costs under $2 on the budget tier's cached-input line, while a judge pass over the gray-zone transcripts, a few hundred thousand tokens, prices at pennies even on the top tier. The tier selection guide and the uncensored tier comparison work through these tradeoffs with the benchmark and pricing tables.

Reporting and escalation

Report jailbreak results as a matrix, family by family, model by model, with both ASR definitions and the judge's measured error rates attached. A single percentage hides whether the suite found a wording quirk in one family or a systematic collapse across nine. Two escalation rules keep the report honest: any strict ASR above the pre-agreed threshold on any family is a finding regardless of the aggregate, and a falling ASR paired with a rising false-refusal rate on benign lookalikes is reported as a regression, since the guardrail moved the cost onto legitimate users. For findings against third-party deployments, follow a coordinated disclosure path; the disclosure policy analysis covers why trust accrues to teams that report through channels rather than posts.

The pre-engagement checklist, compressed: authorization named in writing, scope and endpoints enumerated, corpus versioned and deduplicated, judge validated against hand labels, benign lookalike set included, seeds and sampling pinned, both ASR definitions reported, thresholds agreed before the run. Teams that skip the checklist get numbers; teams that run it get evidence.