LaTex2Web logo

Documents Live, a web authoring and publishing system

If you see this, something is wrong

Table of contents

First published on Friday, Oct 9, 2026 and last modified on Friday, Oct 9, 2026

From Expected Harmfulness to Likelihood: A Probabilistic Reformulation of Jailbreaking LLM Agents

Juanyang Xu University of Macau

Zheng Wang WMG, University of Warwick

Xingyu Zhao WMG, University of Warwick and Wuhan University

Siddartha Khastgir WMG, University of Warwick

Andi Zhang WMG, University of Warwick Email

Abstract

1 INTRODUCTION

2 PRELIMINAIRES

\[ p_{\mathrm{vic}}(x_{\mathrm{adv}}\mid y_{\mathrm{tar}}) \propto \exp(-c f(x_{\mathrm{adv}},y_{\mathrm{tar}})), ~~ p_{\mathrm{dis}}(x_{\mathrm{adv}}\mid x_{\mathrm{ori}}) \propto \exp(-D(x_{\mathrm{ori}},x_{\mathrm{adv}})). \]

3 Unifying Expected Harmfulness and Likelihood-based Jailbreaking

\[ \max_s\; \mathbb{E}_{Y_{\mathrm{harm}}\sim\pi} \left[ \log p_\theta(Y_{\mathrm{harm}}\mid x,s) \right]. \]
\[ \mathbb{E}_{Y_{\mathrm{harm}}\sim\pi} \left[ \nabla_s \log p_\theta(Y_{\mathrm{harm}}\mid x,s) \right], \]

4 OPUR


Algorithm 1 OPUR
1.Input: LLM \( \mathcal M\) , prompt \( x\) , target \( a\) , suffix \( s\) , maximum positions \( \ell\) , rollouts \( K_{\mathrm{opt}}\)
2.while budget remains do
3.\( \{(z_k,\mathcal P_k)\}_{k=1}^{K_{\mathrm{opt}}} \gets \mathrm{Rollout}(\mathcal M,x,s)\) Stochastic rollouts
4.break if \( \bigwedge_{k=1}^{K_{\mathrm{opt}}}\mathrm{Succ}(z_k,a)\)
5.\( \mathcal C^\star\gets\varnothing\)
6.for \( k=1,…,K_{\mathrm{opt}}\) do
7.Compute \( r_{k,j}(a)\) for each eligible position \( j\) using \( (z_k,\mathcal P_k)\) ; \( \mathcal C_k \gets \varnothing\)
8.repeat
9.Sample \( J\) (\( |J|\leq\ell\) , non-overlapping) from \( \mathrm{Softmax}(\{r_{k,j}(a)\}_j/\tau)\) Probabilistic position sampling
10.Obtain \( z_{k,J}^{\star}\) by replacing the spans at \( J\) in \( z_k\) with \( a\)
11.\( \mathcal C_k \gets\mathcal C_k\cup\{z_{k,J}^{\star}\}\)
12.until enough distinct position sets are collected or the sampling budget is exhausted
13.Evaluate \( \mathcal L_{\mathrm U}(s;c)\) for each \( c\in\mathcal C_k\)
14.\( \mathcal C_k^\star \gets\) lowest-probe-loss contexts in \( \mathcal C_k\)
15.\( \mathcal C^\star \gets\mathcal C^\star\cup\mathcal C_k^\star\) Probe screening
16.end for
17.\( g\gets \mathrm{Mean}_{c\in\mathcal C^\star} \nabla_{\operatorname{onehot}(s)} \mathcal L_{\mathrm{CE}}(s;c)\) Cross-rollout optimization
18.Generate \( \mathcal V\) by gradient-guided token substitutions using \( g\)
19.\( \bar{\mathcal L}_{\mathrm U}(v) \gets \mathrm{Mean}_{c\in\mathcal C^\star} \mathcal L_{\mathrm U}(v;c)\) , for each \( v\in\mathcal V\)
20.\( s\gets \operatorname*{arg\,min}_{v\in\mathcal V} \bar{\mathcal L}_{\mathrm U}(v)\)
21.end while
22.Output: \( s\)

5 EXPERIMENT

6 Related Work

7 CONCLUSION

Appendix

A Proof of the Theorems

B Detail of Ablation

C OPUR ON REAL WORLD AGENT

References

[1] Jiawei Zhang and Shuang Yang and Bo Li Udora: A unified red teaming framework against llm agents by dynamically hijacking their own reasoning arXiv preprint arXiv:2503.01908 2025

[2] Andy Zou and Zifan Wang and Nicholas Carlini and Milad Nasr and J Zico Kolter and Matt Fredrikson Universal and transferable adversarial attacks on aligned language models arXiv preprint arXiv:2307.15043 2023

[3] Xiaogeng Liu and Nan Xu and Muhao Chen and Chaowei Xiao Autodan: Generating stealthy jailbreak prompts on aligned large language models International Conference on Learning Representations 2024 2024 56174–56194

[4] Patrick Chao and Alexander Robey and Edgar Dobriban and Hamed Hassani and George J Pappas and Eric Wong Jailbreaking black box large language models in twenty queries 2025 IEEE Conference on Secure and Trustworthy Machine Learning (SaTML) 2025 23–42 IEEE

[5] Anay Mehrotra and Manolis Zampetakis and Paul Kassianik and Blaine Nelson and Hyrum Anderson and Yaron Singer and Amin Karbasi Tree of attacks: Jailbreaking black-box llms automatically Advances in Neural Information Processing Systems 2024 37 61065–61105

[6] Simon Geisler and Tom Wollschläger and MHI Abdalla and Vincent Cohen-Addad and Johannes Gasteiger and Stephan Günnemann Reinforce adversarial attacks on large language models: An adaptive, distributional, and semantic objective arXiv preprint arXiv:2502.17254 2025

[7] Yen-Shan Chen and Zhi Rui Tam and Cheng-Kuang Wu and Yun-Nung Chen Expected Harm: Rethinking Safety Evaluation of (Mis) Aligned LLMs arXiv preprint arXiv:2602.01600 2026

[8] Ronald J Williams Simple statistical gradient-following algorithms for connectionist reinforcement learning Machine learning 1992 8 3 229–256

[9] Maksym Andriushchenko and Alexandra Souly and Mateusz Dziemian and Derek Duenas and Maxwell Lin and Justin Wang and Dan Hendrycks and Andy Zou and Zico Kolter and Matt Fredrikson and others Agentharm: A benchmark for measuring harmfulness of llm agents International Conference on Learning Representations 2025 2025 79185–79220

[10] Qiusi Zhan and Zhixiang Liang and Zifan Ying and Daniel Kang Injecagent: Benchmarking indirect prompt injections in tool-integrated large language model agents Findings of the Association for Computational Linguistics: ACL 2024 2024 10471–10506

[11] Shunyu Yao and Howard Chen and John Yang and Karthik Narasimhan Webshop: Towards scalable real-world web interaction with grounded language agents Advances in Neural Information Processing Systems 2022 35 20744–20757

[12] Aaron Grattafiori and Abhimanyu Dubey and Abhinav Jauhri and Abhinav Pandey and Abhishek Kadian and Ahmad Al-Dahle and Aiesha Letman and Akhil Mathur and Alan Schelten and Alex Vaughan and others The llama 3 herd of models arXiv preprint arXiv:2407.21783 2024

[13] Albert Q. Jiang and Alexandre Sablayrolles and Arthur Mensch and Chris Bamford and Devendra Singh Chaplot and Diego de las Casas and Florian Bressand and Gianna Lengyel and Guillaume Lample and Lucile Saulnier and Lélio Renard Lavaud and Marie-Anne Lachaux and Pierre Stock and Teven Le Scao and Thibaut Lavril and Thomas Wang and Timothée Lacroix and William El Sayed Mistral 7B 2023

[14] Junjie Chu and Yugeng Liu and Ziqing Yang and Xinyue Shen and Michael Backes and Yang Zhang JailbreakRadar: Comprehensive assessment of jailbreak attacks against LLMs Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) 2025 21538–21566

[15] Shunyu Yao and Jeffrey Zhao and Dian Yu and Nan Du and Izhak Shafran and Karthik Narasimhan and Yuan Cao React: Synergizing reasoning and acting in language models arXiv preprint arXiv:2210.03629 2022

[16] Vinu Sankar Sadasivan and Shoumik Saha and Gaurang Sriramanan and Priyatham Kattakinda and Atoosa Chegini and Soheil Feizi Fast adversarial attacks on language models in one gpu minute arXiv preprint arXiv:2402.15570 2024

[17] Anselm Paulus and Arman Zharmagambetov and Chuan Guo and Brandon Amos and Yuandong Tian Advprompter: Fast adaptive adversarial prompting for llms arXiv preprint arXiv:2404.16873 2024

[18] Xingang Guo and Fangxu Yu and Huan Zhang and Lianhui Qin and Bin Hu Cold-attack: Jailbreaking llms with stealthiness and controllability arXiv preprint arXiv:2402.08679 2024

[19] Tong Liu and Yingjie Zhang and Zhe Zhao and Yinpeng Dong and Guozhu Meng and Kai Chen Making them ask and answer: Jailbreaking large language models in few queries via disguise and reconstruction 33rd USENIX Security Symposium (USENIX Security 24) 2024 4711–4728

[20] Gelei Deng and Yi Liu and Yuekang Li and Kailong Wang and Ying Zhang and Zefeng Li and Haoyu Wang and Tianwei Zhang and Yang Liu Masterkey: Automated jailbreak across multiple large language model chatbots arXiv preprint arXiv:2307.08715 2023

[21] Jiahao Yu and Xingwei Lin and Zheng Yu and Xinyu Xing \( {\) LLM-Fuzzer\( }\) : Scaling assessment of large language model jailbreaks 33rd USENIX Security Symposium (USENIX Security 24) 2024 4657–4674

[22] Xuan Li and Zhanke Zhou and Jianing Zhu and Jiangchao Yao and Tongliang Liu and Bo Han Deepinception: Hypnotize large language model to be jailbreaker arXiv preprint arXiv:2311.03191 2023

[23] Yi Zeng and Hongpeng Lin and Jingwen Zhang and Diyi Yang and Ruoxi Jia and Weiyan Shi How johnny can persuade llms to jailbreak them: Rethinking persuasion to challenge ai safety by humanizing llms Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) 2024 14322–14350

[24] Xiaogeng Liu and Peiran Li and G Edward Suh and Yevgeniy Vorobeychik and Zhuoqing Mao and Somesh Jha and Patrick McDaniel and Huan Sun and Bo Li and Chaowei Xiao Autodan-turbo: A lifelong agent for strategy self-exploration to jailbreak llms International Conference on Learning Representations 2025 2025 10313–10360

[25] Sicheng Zhu and Brandon Amos and Yuandong Tian and Chuan Guo and Ivan Evtimov Advprefix: An objective for nuanced llm jailbreaks Advances in Neural Information Processing Systems 2026 38 89990–90014

[26] Zeyi Liao and Huan Sun Amplegcg: Learning a universal and transferable generative model of adversarial suffixes for jailbreaking both open and closed llms arXiv preprint arXiv:2404.07921 2024

[27] Maksym Andriushchenko and Nicolas Flammarion and others Jailbreaking leading safety-aligned llms with simple adaptive attacks International Conference on Learning Representations 2025 2025 40116–40143

[28] Weipeng Jiang and Zhenting Wang and Juan Zhai and Shiqing Ma and Zhengyu Zhao and Chao Shen An optimizable suffix is worth a thousand templates: Efficient black-box jailbreaking without affirmative phrases via llm as optimizer Findings of the Association for Computational Linguistics: NAACL 2025 2025 5486–5498

[29] Yiwei Wang and Muhao Chen and Nanyun Peng and Kai-Wei Chang Vulnerability of large language models to output prefix jailbreaks: Impact of positions on safety Findings of the Association for Computational Linguistics: NAACL 2025 2025 3939–3952

[30] Chung-En Sun and Xiaodong Liu and Weiwei Yang and Tsui-Wei Weng and Hao Cheng and Aidan San and Michel Galley and Jianfeng Gao Iterative self-tuning llms for enhanced jailbreaking capabilities Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers) 2025 5768–5786

[31] Suhuang Wu and Huimin Wang and Yutian Zhao and Xian Wu and Yefeng Zheng and Wei Li and Hui Li and Rongrong Ji Monte carlo tree search based prompt autogeneration for jailbreak attacks against llms Proceedings of the 31st International Conference on Computational Linguistics 2025 1057–1068

[32] Daisy Zhe Wang and Yanjun Qi Augmented Adversarial Trigger Learning Findings of the Association for Computational Linguistics: NAACL 2025 2025 7083–7115

[33] Tim Beyer and Yan Scholten and Leo Schwinn and Stephan Günnemann Sampling-aware adversarial attacks against large language models International Conference on Learning Representations 2026 2026 74637–74663

[34] Shuangjie Fu and Du Su and Xin Chen and Fei Sun and Huawei Shen and Xueqi Cheng Steering Away from Refusal: A Black-box Jailbreak Method Based on First-Token Distribution Findings of the Association for Computational Linguistics: ACL 2026 2026 25969–25979

[35] Patrick Chao and Edoardo Debenedetti and Alexander Robey and Maksym Andriushchenko and Francesco Croce and Vikash Sehwag and Edgar Dobriban and Nicolas Flammarion and George J Pappas and Florian Tramer and others Jailbreakbench: An open robustness benchmark for jailbreaking large language models Advances in Neural Information Processing Systems 2024 37 55005–55029

[36] Alexandra Souly and Qingyuan Lu and Dillon Bowen and Tu Trinh and Elvis Hsieh and Sana Pandey and Pieter Abbeel and Justin Svegliato and Scott Emmons and Olivia Watkins and others A strongreject for empty jailbreaks Advances in Neural Information Processing Systems 2024 37 125416–125440

[37] Yan Scholten and Stephan Günnemann and Leo Schwinn A probabilistic perspective on unlearning and alignment for large language models International Conference on Learning Representations 2025 2025 49420–49436

[38] Kai Greshake and Sahar Abdelnabi and Shailesh Mishra and Christoph Endres and Thorsten Holz and Mario Fritz Not what you've signed up for: Compromising real-world llm-integrated applications with indirect prompt injection Proceedings of the 16th ACM workshop on artificial intelligence and security 2023 79–90

[39] Lingbo Mo and Zeyi Liao and Boyuan Zheng and Yu Su and Chaowei Xiao and Huan Sun A trembling house of cards? mapping adversarial attacks against language agents arXiv preprint arXiv:2402.10196 2024

[40] Edoardo Debenedetti and Jie Zhang and Mislav Balunovic and Luca Beurer-Kellner and Marc Fischer and Florian Tramèr Agentdojo: A dynamic environment to evaluate prompt injection attacks and defenses for llm agents Advances in neural information processing systems 2024 37 82895–82920

[41] Hanrong Zhang and Jingyuan Huang and Kai Mei and Yifei Yao and Zhenting Wang and Chenlu Zhan and Hongwei Wang and Yongfeng Zhang Agent security bench (asb): Formalizing and benchmarking attacks and defenses in llm-based agents International Conference on Learning Representations 2025 2025 35331–35366

[42] Yifei Wang and Dizhan Xue and Shengjie Zhang and Shengsheng Qian Badagent: Inserting and activating backdoor attacks in llm agents Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) 2024 9811–9827

[43] Zhaorun Chen and Zhen Xiang and Chaowei Xiao and Dawn Song and Bo Li Agentpoison: Red-teaming llm agents via poisoning memory or knowledge bases Advances in Neural Information Processing Systems 2024 37 130185–130213

[44] Andi Zhang and Mingtian Zhang and Damon Wischik Constructing semantics-aware adversarial examples with a probabilistic perspective Advances in Neural Information Processing Systems 2024 37 136259–136285

[45] Andi Zhang and Xuan Ding and Steven McDonagh and Samuel Kaski Concept-based Adversarial Attack: a Probabilistic Perspective International Conference on Learning Representations 2026 2026 73613–73646

Discussion: login to participate.