Lune

S&P2024Top-tier venue

SneakyPrompt: Jailbreaking Text-to-image Generative Models

Yuchen Yang, Bo Hui, Haolin Yuan, Neil Gong, Yinzhi Cao

Abstract

Text-to-image generative models such as Stable Diffusion and DALL•E raise many ethical concerns due to the generation of harmful images such as Not-Safe-for-Work (NSFW) ones. To address these ethical concerns, safety filters are often adopted to prevent the generation of NSFW images. In this work, we propose SneakyPrompt, the first automated attack framework, to jailbreak text-to-image generative models such that they generate NSFW images even if safety filters are adopted. Given a prompt that is blocked by a safety filter, SneakyPrompt repeatedly queries the text-to-image generative model and strategically perturbs tokens in the prompt based on the query results to bypass the safety filter. Specifically, SneakyPrompt utilizes reinforcement learning to guide the perturbation of tokens. Our evaluation shows that SneakyPrompt successfully jailbreaks DALL•E 2 with closed-box safety filters to generate NSFW images. Moreover, we also deploy several state-of-the-art, open-source safety filters on a Stable Diffusion model. Our evaluation shows that SneakyPrompt not only successfully generates NSFW images, but also outperforms existing text adversarial attacks when extended to jailbreak text-to-image generative models, in terms of both the number of queries and qualities of the generated NSFW images. SneakyPrompt is open-source and available at this repository: https://github.com/Yuchen413/text2image_safety.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

67 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • High-Resolution Image Synthesis with Latent Diffusion Models cites Zero-Shot Text-to-Image Generation
  • High-Resolution Image Synthesis with Latent Diffusion Models cites Denoising Diffusion Probabilistic Models
  • Zero-Shot Text-to-Image Generation cites Learning Transferable Visual Models From Natural Language Supervision
  • Perception-Guided Jailbreak Against Text-to-Image Models cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Perception-Guided Jailbreak Against Text-to-Image Models cites Learning Transferable Visual Models From Natural Language Supervision
  • Perception-Guided Jailbreak Against Text-to-Image Models cites Denoising Diffusion Probabilistic Models
  • Perception-Guided Jailbreak Against Text-to-Image Models cites Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding
  • Erasing Undesirable Concepts in Diffusion Models with Adversarial Preservation cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Erasing Undesirable Concepts in Diffusion Models with Adversarial Preservation cites Zero-Shot Text-to-Image Generation
  • Erasing Undesirable Concepts in Diffusion Models with Adversarial Preservation cites Denoising Diffusion Probabilistic Models
  • Direct Unlearning Optimization for Robust and Safe Text-to-Image Models cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Direct Unlearning Optimization for Robust and Safe Text-to-Image Models cites Learning Transferable Visual Models From Natural Language Supervision
  • Direct Unlearning Optimization for Robust and Safe Text-to-Image Models cites Denoising Diffusion Probabilistic Models
  • GuardT2I: Defending Text-to-Image Models from Adversarial Prompts cites High-Resolution Image Synthesis with Latent Diffusion Models
  • GuardT2I: Defending Text-to-Image Models from Adversarial Prompts cites Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites Zero-Shot Text-to-Image Generation
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites Learning Transferable Visual Models From Natural Language Supervision
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites Denoising Diffusion Probabilistic Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers67

  1. GuardT2I: Defending Text-to-Image Models from Adversarial PromptsYijun Yang, Ruiyuan Gao, Xiao Yang, Jianyuan Zhong et al.NeurIPS 2024 · 74 citations
  2. When LLM Meets DRL: Advancing Jailbreaking Efficiency via DRL-guided SearchXuan Chen, Yuzhou Nie, Wenbo Guo, Xiangyu ZhangNeurIPS 2024 · 68 citations
  3. Direct Unlearning Optimization for Robust and Safe Text-to-Image ModelsYong-Hyun Park, Sangdoo Yun, Jin-Hwa Kim, Junho Kim et al.NeurIPS 2024 · 60 citations
  4. Erasing Undesirable Concepts in Diffusion Models with Adversarial PreservationAnh Bui, Tung-Long Vuong, Khanh Doan, Trung Le et al.NeurIPS 2024 · 55 citations
  5. Perception-Guided Jailbreak Against Text-to-Image ModelsYihao Huang, Le Liang, Tianlin Li, Xiaojun Jia et al.AAAI 2025 · 34 citations

Builds on16

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  2. Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
  3. High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
  4. Photorealistic Text-to-Image Diffusion Models with Deep Language UnderstandingChitwan Saharia, William Chan, Saurabh Saxena, Lala Li et al.NeurIPS 2022 · 8,965 citations
  5. Zero-Shot Text-to-Image GenerationAditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray et al.ICML 2021 · 6,356 citations

Related papers

  1. SurrogatePrompt: Bypassing the Safety Filter of Text-to-Image Models via SubstitutionZhongjie Ba, Jieming Zhong, Jiachen Lei, Peng Cheng et al.CCS 2024 · 7 citations
  2. Modifier Unlocked: Jailbreaking Text-to-Image Models Through PromptsShuofeng Liu, Mengyao Ma, Minhui Xue, Guangdong BaiS&P 2025
  3. AdvI2I: Adversarial Image Attack on Image-to-Image Diffusion ModelsYaopei Zeng, Yuanpu Cao, Bochuan Cao, Yurui Chang et al.ICML 2025
  4. JANUS: A Lightweight Framework for Jailbreaking Text-to-Image Models via Distribution OptimizationHaolun Zheng, Yu He, Tailun Chen, Shuo Shao et al.CVPR 2026 · 3 citations
  5. Multimodal Pragmatic Jailbreak on Text-to-image ModelsTong Liu, Zhixin Lai, Jiawen Wang, Gengyuan Zhang et al.ACL 2025
Dusk over the sea between two cliffs drawn in fine vertical lines