Sockpuppetting: Combining Prefilling and Optimized LLM Jailbreak MethodsSockpuppetting: Jailbreaking LLMs by Combining Prefilling with Optimization
The authors propose sockpuppetting (placing a gradient-optimized suffix in the assistant block), and state that an ensemble of three simple prefill variants achieves 99% ASR on Qwen3-8B.
The attacker has white-box access to open-weight models, or uses an inference API that exposes the prefill capability of assistant message blocks; they can write text outside the user block and edit the chat template, but cannot fine-tune the model or modify weights. The prefill ensemble requires only black-box sampling, whereas sockpuppetting additionally requires gradients.
- Open-weight models can be jailbroken by prefill attacks: inserting an acceptance sequence directly into the assistant block is enough to make the model continue with a harmful answer. The authors ask how much the exact wording of the prefill matters, and how far cheap variants and gradient optimization can strengthen it.
- Two lines: first, simple rewrites of the acceptance sequence (newline, titling) and an ensemble of three variants; second, sockpuppetting, which places a GCG-style gradient-optimized suffix in the assistant block, along with the rolling variant RollingSockpuppetGCG.
- On Gemma-7B, Llama-3.1-8B, and Qwen3-8B, PrefillEnsemble achieves ASR of 22%, 90%, and 99%, respectively; RollingSockpuppetGCG achieves ASR 83% on the 100-entry validation set for Llama-3.1-8B, higher than RollingGCG's 37%.
- The authors note: models with dedicated prefill defenses were not evaluated; sockpuppetting and the baseline use inconsistent target sequences, so part of the gap comes from the acceptance-sequence design; the judge is only a single, lightly validated Gemma-3-27B-it; and most experiments use only the first 100 prompts.
- Evaluated models
- Llama-3.1-8BQwen3-8BGemma-7B
- Benchmarks
- AdvBench (Harmful Behaviors)
- Metrics
- ASR
The paper proposes two methods to enhance prefilling jailbreaks: one integrates a small number of easily generated prefill variants, and the other optimizes the adversarial suffix in the assistant message block of the chat template rather than in the user prompt, the latter called Sockpuppetting. Three prefill variants achieve attack success rates of 22%, 90%, and 99% on Gemma-7B, Llama-3.1-8B, and Qwen3-8B, respectively, improving over standard prefill by up to 38 percentage points and over the authors' reproduced GCG by up to 82 percentage points. RollingSockpuppetGCG improves prompt-agnostic attack success rate on Llama-3.1-8B by up to 64 percentage points over the generic GCG baseline. Ablations show part of the gain comes from the selection of accepted sequences rather than suffix position. The authors argue that open-weight models need defenses against output prefix injection, and the code has been made public on GitLab.
Paper analysis
What problem does this paper attempt to solve?
Study the prefill attack surface of open-weight models: how strong cheap prefill variants can be, and whether gradient optimization can produce stronger attacks within the assistant block.
Core question: the prefill attack surface of open-weight LLMs is underestimated—how much does the exact wording of the acceptance sequence matter, and can cheap rewrites or gradient optimization make jailbreaking stronger.
- Setting and motivation: the authors argue that open-weight models cannot rely on external classifiers and other safeguards, and are cheaper and less regulated, which favors malicious users; prefill attacks insert an acceptance sequence directly into the assistant block at almost zero cost.
- Shortcomings of existing methods: the authors state that GCG-style gradient attacks are computationally expensive and require expertise; standard prefill attacks use only a fixed "Sure, here is..." acceptance sequence, and the authors argue this format is far from optimal (none of the three models' natural answers begin with "Sure").
- Core observation: different models have different training data and are unlikely to equally accept the same acceptance sequence; models are more compliant with text in the assistant block than with text in the user block (citing Wei et al., 2023), so optimizing a suffix within the assistant block may be more effective.
- Contributions: first, showing that an ensemble of a few simple prefill variants (newline, titling) raises ASR to 22%/90%/99% (Gemma-7B/Llama-3.1-8B/Qwen3-8B); second, proposing sockpuppetting, which places a gradient-optimized suffix in the assistant block.
- Threat model (Section 5):
- Goal: make the model output compliant answers to AdvBench harmful prompts.
- Knowledge: white-box access to open-weight models, or use of an inference API that exposes assistant-block prefill.
- Capability: can write text outside the user block and edit the chat template; cannot fine-tune or change weights. The prefill ensemble requires only black-box sampling; sockpuppetting additionally requires gradients.
- Victim system: instruction-tuned open-source models without dedicated prefill defenses.
What related research exists?
Related work falls into four groups: jailbreaks, automated jailbreaks, gradient-guided attacks, and prefill attacks; the authors position their work as a combination of prefill and GCG.
Jailbreaking
- Deng et al. (2024), Yuan et al. (2024)—rewrite prompts in low-resource languages or special encodings to obscure harmful intent.
- Ganguli et al. (2022), Yi et al. (2024), Ahmad et al. (2025)—the authors state that jailbreaking persists across models of various sizes, mainly because pretraining corpora are unfiltered; O'Brien et al. (2025) attempt to filter pretraining data, but the authors state this has not yet been applied at scale.
Automated jailbreaking
- Liu et al. (2024), Andriushchenko et al. (2025)—search the loss space with random-search-type algorithms; Huang et al. (2024) modify decoding parameters.
- Sitawarin et al. (2024)—use a surrogate model to transfer attacks from open-source models to closed-source models; Yu et al. (2024), Chao et al. (2025), Liu et al. (2025)—iteratively jailbreak with a prompt mutator plus an LLM judge. The authors caution that these methods report high ASR, but new models are continually released and old numbers may not be reliable.
Gradient-guided attacks
- GCG (Zou et al., 2023)—early work in this direction and the baseline reproduced in this paper; subsequent work makes suffixes more readable to pass perplexity filters (Zhu et al., 2024; Jain et al., 2023) or reduces compute requirements (Sadasivan et al., 2024), and the authors state that these methods have lower ASR under the conditions of Zou et al. (2023).
- Schwinn et al. (2023)—continuous optimization at the embedding layer, trading transferability for efficiency.
Prefill attacks
- Vega et al. (2024) propose priming attacks; Wang et al. (2025) propose OPRA/OPRATEA, which force output prefixes without training.
- Lv et al. (2025) (AdaPPA) prefill safe content and then shift the narrative; Andriushchenko et al. (2025) combine prefill with random-search jailbreaking against the entire Claude family; Li et al. (2025) state that adaptive prefill achieves ASR above 99% on multiple advanced models (including closed-source ones); Struppek et al. (2026) evaluate more than 20 prefill strategies.
- Closest work: AdvPrefix (Zhu et al., 2025) selects model-relevant prefixes as the optimization target for GCG. The authors state that the difference is that they keep the standard acceptance-sequence target and change the position of the optimized string, and that the two are complementary.
Baselines and benchmark: the baselines are the original prompts without attack and per-prompt GCG (the authors' reproduction); the universal-attack baselines are GCG and RollingGCG; the benchmark is AdvBench (Harmful Behaviors, 520 entries, with the first 100 used in most experiments). The authors position this paper as introducing the prefill attack surface into GCG-style optimization.
How does the paper address this problem?
Two lines: an ensemble of three cheap prefill variants, and the sockpuppetting attack family that optimizes a GCG suffix into the assistant block.
Overall approach: taking the prefill attack as a starting point, one end improves ASR with an almost zero-cost ensemble of wording variants, and the other end uses gradient optimization to generate a stronger prompt-agnostic attack within the assistant block, namely sockpuppetting.
Problem setting and background mechanism
- Chat template: instruction-tuned models wrap system/user/assistant messages with special tokens; if an attacker can write the assistant block, the model can be made to continue from a position where it has "already agreed".
- GCG setting: optimize an adversarial suffix to maximize the probability that the model generates an acceptance sequence (target); the acceptance sequence is generated automatically per prompt, in the format "Sure, here's noun".
- Prefill hypothesis: the authors believe models have a self-consistency tendency—the most likely continuation for a harmful request is a refusal, but the most likely continuation for "already agreed" is an actual answer.
Prefill variants and ensemble (Section 5.1)
- PrefillAcceptance: the standard acceptance sequence, unmodified.
- PrefillNewline: append a colon and newline to the end of the acceptance sequence.
- PrefillTitle: remove the leading "Sure, here is a", capitalize the first letter of the remainder, wrap it in asterisks to simulate bold, and append a newline, making it look like a title.
- PrefillEnsemble: run all three variants for each prompt, counting success if any succeeds; the authors state this simulates a low-effort attacker whose budget only allows trying a few variants.
Sockpuppetting attack family (Section 4, 5.2)
- Definition: an attack family in which an adversarial suffix is gradient-optimized and placed in the assistant block, with the standard acceptance sequence as the optimization target; the suffix is positionally a prefix of the output and functionally a GCG-style suffix.
- SockpuppetGCG: identical to GCG, except the suffix is placed at the start of the assistant block.
- RollingSockpuppetGCG: optimize length by length starting from length 1, with each length's optimization result used as the warm start for the next length; the authors state this avoids under-optimization of long sequences, takes at most k times as long as one-shot GCG, and the experiments use k = 10.
- Target sequence modification: sockpuppetting requires changing the acceptance sequence to a form that starts with a period and drops the agreement part (e.g., ". Here is how to..."); the authors state that otherwise the optimizer struggles to construct a complete sentence character by character and the suffix degenerates into meaningless noise (Appendix E).
Optimization and evaluation settings
- Hyperparameters (Appendix C): 500 steps, patience 100, suffix up to 10 tokens, 512 candidates per round, top-k 2048; the rolling attack counts steps per length, 1000–5000 steps in total; the universal attack optimizes over all training prompts simultaneously.
- Speedup techniques: early stopping when the target can be greedily decoded, early stopping when candidates stagnate, filtering candidates with unstable encoding/decoding, and batched forward passes by length.
- Evaluation: each model × prompt is run only once with greedy sampling; Gemma-3-27B-it classifies each output as refusal or compliance (Appendix G gives the judge prompt, with a few in-context examples).
- Success criterion: the universal attack is trained on the first 25 prompts and validated on the next 100; prefill and per-prompt GCG are evaluated on the first 100.
What experiments did the paper conduct?
Three sets of experiments: per-prompt prefill comparison against GCG, a universal attack comparison with 25 training/100 validation, and a target-sequence ablation; the prefill ensemble achieves 99% ASR on Qwen3-8B.
Experimental Setup
- Models evaluated: Llama-3.1-8B, Qwen3-8B, Gemma-7B (all instruction-tuned open-source models, runnable on a single NVIDIA A100).
- Dataset: AdvBench (Harmful Behaviors), 520 prompts in total, each with an acceptance sequence in the format "Sure, here's noun"; most experiments use only the first 100 due to compute.
- Baselines: the original prompts with no attack (Prompt Only); per-prompt GCG (the authors' reproduction, with hyperparameters slightly different from the original formulation, Appendix C); universal attack baselines GCG and RollingGCG.
- Metric and judge: ASR, with Gemma-3-27B-it classifying outputs as refusal/compliance; the authors state they initially used Llama-3.1-8B-Instruct as the judge but manual inspection found a bias toward refusal, so they switched (Appendix G).
- Samples and repetitions: prefill and per-prompt GCG use the first 100; universal attacks train on the first 25 and validate on the next 100; each model × prompt is evaluated only once with greedy sampling; extended experiments re-test on all 520 (prefill, Appendix A) and the remaining 495 (universal attacks, Appendix B).
Main Results
ASR (%) of per-prompt prefill attacks and GCG (first 100 AdvBench prompts, per Figure 2):
Swipe horizontally to read the table
Model Prompt Only GCG PrefillAcceptance PrefillNewline PrefillTitle PrefillEnsemble Gemma-7B 0 4 6 21 6 22 Llama-3.1-8B 6 17 75 77 13 90 Qwen3-8B 6 6 61 98 17 99 - The authors state: without attack, all three models refuse at a rate above 93%; GCG's ASR on Llama and Gemma is close to the no-attack baseline, while all prefill variants are higher than GCG.
- The authors observe that the relative effectiveness of each prefill varies by model (PrefillNewline is 98% on Qwen but ordinary on the other models), and argue that models "reject" prefills whose style differs too much from their own output, consistent with the model-dependent prefix selection effect of Zhu et al. (2025).
- The authors state that the ensemble raises ASR on Llama from 77% for the best single variant to 90%, and on Qwen from 61% (PrefillAcceptance) to 99%; on Gemma and Qwen the ensemble is comparable to the best single variant, which the authors attribute to possibly insufficient discrimination among variants.
Universal Attacks (Figure 3)
Universal attack ASR (%) (first 25 for training, next 100 for validation, per Figure 3):
Swipe horizontally to read the table
Model Prompt Only GCG RollingGCG SockpuppetGCG RollingSockpuppetGCG Gemma-7B 3 18 34 9 31 Llama-3.1-8B 5 8 37 7 83 Qwen3-8B 3 7 1 12 71 - The authors state that RollingSockpuppetGCG surpasses other methods on Llama and Qwen, and argue that the combination of iterative optimization and sockpuppetting (rather than either component alone) yields the high ASR; on Llama it is 46 percentage points higher than RollingGCG (the abstract states up to 64 percentage points, while the main-text table corresponds to a gap of 46; the authors do not explain this discrepancy in the main text).
- Exception: RollingGCG jailbreaks only 1 prompt on Qwen, which the authors attribute to an abnormally high optimization loss, possibly an outlier from optimization failure; on Gemma, SockpuppetGCG (9%) is lower than GCG (18%).
- Comparison with prefill (Section 6.3): on Gemma, RollingSockpuppetGCG at 31% is higher than the best per-prompt prefill at 22%; on Llama and Qwen it remains lower than the best prefill, and the authors describe the two attack types as complementary.
Target-Sequence Ablation (Appendix F, Figure 6)
- What was tested: replacing RollingGCG's target with the modified acceptance sequence used by sockpuppetting (". Here's..."), compared against standard-target RollingGCG and RollingSockpuppetGCG.
- Results: with the modified target, RollingGCG reaches 34%/71%/57% on Gemma/Llama/Qwen (standard target: 34%/37%/1%); on Gemma and Llama it matches or approaches RollingSockpuppetGCG (31%/83%), and only on Qwen does sockpuppetting remain ahead (71%).
- Authors' interpretation: part of the headline gap comes from the acceptance-sequence design rather than the suffix position itself; the acceptance sequence is an underappreciated attack lever.
Other Ablations and Analyses
- Full AdvBench re-test (Appendices A, B): prefill trends are consistent on 520 prompts (e.g., Qwen PrefillNewline 97.3%, PrefillEnsemble 98.8%); universal attack conclusions are unchanged on the remaining 495 (Llama RollingSockpuppetGCG 79.4%).
- Training loss and ASR (Section 7.2): on Llama, SockpuppetGCG has loss 1.45 and ASR 3/100, while RollingSockpuppetGCG has loss 0.55 and ASR 71/100; however, on Gemma both sockpuppet attacks have losses of 0.5–0.55 yet ASR less than half of Llama's, which the authors say does not hold across models.
- Gemma's "flip" behavior (Section 7.2): after observing outputs, the authors believe Gemma most often first outputs content close to the acceptance sequence and then switches to refusal, and Qwen least often; the authors argue this lowers ASR for prefill-type attacks and misleads the gradient loss.
- Compute cost (Appendix D, Table 1): all prefill experiments take about 7 A100-equivalent hours; per-prompt GCG about 64 hours; a single universal attack method (three models) about 16 (GCG) to 119 (RollingSockpuppetGCG) hours; the main experiments total about 450 A100-equivalent hours.
- Judge reliability (Appendix G): the authors manually and qualitatively spot-checked some Gemma-3-27B-it judgments and state they found no number of errors sufficient to change the attack ranking, but acknowledge that reliance on a single, lightly validated judge is a caveat for absolute ASR values.
What are some points that can be further explored?
The authors list directions such as acceptance-sequence optimization, mechanistic understanding, and defensive stress testing; the experiments cover only three 8B-class open-source models and a single judge.
Limitations and future directions noted by the authors
- No dedicated defenses evaluated (Section 5, 7.5): the evaluation targets models without dedicated prefill defenses; models with defenses are out of scope. The authors state that, to their knowledge, weight-level defenses such as LAT, Circuit Breakers, and dual-objective safety alignment have not been evaluated against gradient sockpuppetting, and leave this for future work.
- Confound from inconsistent target sequences (Section 6.2, Appendix F): in the headline comparison, RollingSockpuppetGCG uses a modified target while RollingGCG uses the standard target; the authors state that part of the gap comes from the acceptance-sequence design rather than the suffix position.
- Single judge model (Appendix G): the authors state that relying on a single, lightly validated Gemma-3-27B-it judge is a caveat for absolute ASR values.
- Acceptance-sequence optimization (Section 8, Appendix F): the authors believe that making acceptance sequences closer to the attacked model's natural outputs (e.g., longer, structured sequences, or modeling the distribution of benign responses) may improve ASR, and is a future direction.
- Mechanistic research (Section 7.1, 8): the authors state that existing evidence cannot rule out either the "acceptance-sequence causal chain" or the "suffix encodes a jailbreak strategy" explanation, and suggest using mechanistic interpretability to decode suffix semantics.
- Transfer to closed-source models (Section 7.4): the authors believe that prefill discovered by sockpuppetting may transfer to closed-source models like GCG suffixes, and leave this for future exploration.
Scope of experimental coverage
- The evaluated models are Llama-3.1-8B, Qwen3-8B, and Gemma-7B, 3 in total, all open-weight and roughly 8B scale (Section 5).
- The dataset is AdvBench: the main experiments use the first 100 entries (prefill, per-prompt GCG) or 25 training + 100 validation (universal attack); extended experiments cover all 520 entries (prefill) and the remaining 495 entries (universal attack) (Appendices A, B).
- Each model × prompt is evaluated once with greedy sampling; the paper does not report multiple repetitions or confidence intervals; the authors state that differences of a few percentage points are treated as possible run-to-run variation (Section 6.2, Appendix C).
- The judge is a single model, Gemma-3-27B-it; manual checking is a qualitative spot check, and the paper does not report quantitative agreement metrics (Appendix G).
- Defense evaluation: the paper discusses weight-level defenses such as LAT and Circuit Breakers and notes that they have not been stress-tested against sockpuppetting, but does not itself evaluate any defense (Section 7.5).
Summarize the main content of the paper
The authors state that both the cheap prefill ensemble and gradient-optimized suffixes within the assistant block can raise jailbreak ASR, and that acceptance-sequence design is an underappreciated lever.
A jailbreak attack paper targeting open-weight LLMs, studying how far the prefill attack surface can be pushed.
- Problem: prefill attacks jailbreak by inserting an acceptance sequence directly into the assistant block, but whether the standard "Sure, here is..." format is optimal, and whether gradient optimization can produce a stronger prompt-agnostic prefill, had not been systematically studied.
- Methods: first, simple rewrites of the acceptance sequence such as newline and title-casing, and an ensemble of three variants (PrefillEnsemble); second, sockpuppetting—placing a GCG-style gradient-optimized suffix in the assistant block, with the rolling variant RollingSockpuppetGCG optimizing with length-by-length warm-start (k = 10).
- Result 1: on the first 100 AdvBench prompts, PrefillEnsemble achieves ASR of 22%, 90%, and 99% on Gemma-7B, Llama-3.1-8B, and Qwen3-8B, whereas the authors' reproduced per-prompt GCG achieves only 4%, 17%, and 6% (Figure 2).
- Result 2: among universal attacks, RollingSockpuppetGCG achieves 83% ASR on the 100-prompt validation set on Llama-3.1-8B versus 37% for RollingGCG; on Qwen3-8B, 71% versus 1% (Figure 3).
- Result 3: the ablation shows that after replacing RollingGCG's target with the modified acceptance sequence, it matches or approaches RollingSockpuppetGCG on Gemma and Llama, from which the authors conclude that part of the headline gap comes from the acceptance-sequence design rather than the suffix position (Appendix F).
- Cost: all prefill experiments take about 7 A100-equivalent hours, and a single universal optimization attack about 16–119 hours (Appendix D, Table 1); the authors argue defenders should treat the near-zero-cost prefill ensemble as a more urgent threat.
- Authors' conclusion: both findings highlight the need for defenses against output-prefix injection in open-weight models; the authors suggest future work on optimizing acceptance sequences, using mechanistic interpretability to understand suffixes, and stress-testing weight-level defenses with sockpuppetting.