Skip to main content
Back

TCBS-Attack Breaks Every AI Image Safety Filter at Once With 52.5% Success

A new evolutionary black-box attack finds prompts that sit right on the edge of safety classifiers, doubling jailbreak success on full-chain defenses including DALL-E 3.

Pro

  • TCBS-Attack is a black-box evolutionary jailbreak that targets full-chain T2I defenses: prompt filter, safety-tuned model, and image checker.
  • Achieves 52.5% ASR-4 and 22% ASR-1 on full-chain SDv1.4, beating ten baselines including HTS-Attack and SneakyPrompt.
  • Transfers to DALL-E 3 with 73.3% ASR-4 and to safety-tuned SafeGen and SLD models.
  • Key idea: search tokens near safety-classifier decision boundaries where one small edit flips the verdict.
  • Uses roughly 532 queries per attack on average, versus 1000-query budgets for competing methods.
  • Full paper on arXiv; no public code release.

Most published jailbreaks for text-to-image (T2I) systems assume a single safety net: either a keyword filter, or a safety-tuned model, or a post-hoc image classifier. Real deployments stack all three. A new paper from Xidian University and Westlake University introduces TCBS-Attack, a black-box method that treats the full defensive pipeline as a constrained optimization problem and searches for prompts that hover right on the edge of every safety classifier at once.

The results are unpleasant reading for anyone shipping a T2I product. TCBS-Attack achieves an ASR-4 of 52.5% and an ASR-1 of 22.0% on jailbreaking full-chain T2I models, significantly surpassing baseline methods. On DALL-E 3, it reaches a 56.7% ASR-1 under Q16 evaluation, edging out ten prior attacks.

Why full-chain defenses break single-filter attacks

In practical deployments, T2I services typically adopt full-chain defenses that combine a prompt checker, a securely trained generator, and a post-hoc image checker. An adversarial prompt has to survive all three. That is hard for two reasons the authors highlight: prompt tokens form a discrete combinatorial space and the attack must satisfy multiple coupled constraints under sparse feedback and limited queries.

Gradient-based attacks like MMA-Diffusion need white-box access that commercial APIs do not give you. Pure query-based methods (SneakyPrompt, DiffZOO) work in black-box settings but waste queries wandering the token space, and they typically only optimize against the text filter, so their prompts get killed later by the image checker.

The boundary insight

The authors' key observation is that safety checkers are just binary classifiers with decision boundaries in embedding space. Prompts or their induced generations near these boundaries tend to be most sensitive to small perturbations: small and semantics-preserving token changes may flip the safety decision, yielding strong adversarial effectiveness while keeping the prompt natural and less likely to trigger explicit keyword rules.

Instead of searching the entire vocabulary combinatorial space, TCBS-Attack concentrates its evolutionary search on tokens that sit near those decision boundaries. That shrinks the effective search space dramatically and lets a query-limited attacker focus its budget on candidates that are one small edit away from success.

TCBS-Attack pipeline diagram showing sensitive token detection, population initialization, boundary-guided token search and selection, and jailbreak testing feedback loops

How it works, step by step

The pipeline is an evolutionary algorithm with a population of candidate prompts, refined over 50 iterations with a hard cap of 1000 queries. The stages:

  1. Sensitive token detection. Words are flagged either by matching a curated NSFW list (borrowed from MMA-Diffusion) or by leave-one-out scoring against the NSFW-text-classifier: remove a token, see how much the NSFW score drops, and keep the tokens that contribute most.
  2. Initialization. For each sensitive token, the algorithm pulls the top-k semantically similar tokens by CLIP text similarity and samples a replacement. Non-sensitive tokens are also perturbed with low probability to add diversity.
  3. Coarse token search. Each candidate in the population is mutated the same way, producing a first offspring set.
  4. Boundary-triggered extra search. For candidates lying near a constraint boundary, the algorithm spends additional queries refining them. For the image checker, that means the NSFW score is positive but below a small margin m2 while image similarity is close to the current best. For the text checker (binary), any newly rejected candidate one edit away from a feasible parent counts as near-boundary.
  5. Tournament selection. Pairs are compared with a strict priority: pass the image checker first, then pass the text checker, then rank by CLIP similarity to the target image. The best n candidates survive to the next generation.

Crucially, the method never needs an explicit representation of the decision boundary. Continuous violation scores implicitly signal proximity for the image side, and small semantic edits handle the binary text side. Swapping in a different checker means just plugging in its output, not rewriting the search.

What the numbers show

Evaluation covers 200 prompts drawn from three NSFW benchmarks (MMA-Diffusion, UnsafeDiff, VBCDE), tested against Stable Diffusion v1.4 with NSFW-text-classifier or Detoxify as prompt filter and SD's built-in Safety Checker on the image side. Two independent NSFW detectors (Q16 and MHSC) verify the outputs.

Against Detoxify plus the image checker on SDv1.4, TCBS-Attack posts an 82% image-checker bypass rate, the highest of eleven methods tested, and a 92.5% text-checker bypass. The attack also transfers: on SafeGen and SLD (models explicitly trained to suppress unsafe concepts), it still leads every baseline, and on DALL-E 3 it hits 73.3% ASR-4 under Q16.

The ablation is the most interesting part for anyone building defenses. Stripping the text constraint drops text bypass from 45% to 24.5%. Stripping the image constraint drops ASR-4 from 29.5% to 23.5%. Remove both and the whole thing collapses to 12.5% ASR-4. The boundary-following behavior is doing real work, not just the evolutionary search.

What it is good and bad at

Query efficiency is a genuine improvement. Ablation studies indicate strong dependence on boundary-point-informed evaluation versus random sample selection, and the authors report an average of 532 queries per attack against a 1000-query budget for baselines. In a fixed-100-query comparison the method still beats SneakyPrompt and HTS-Attack on every metric.

The authors are honest about limitations. TCBS-Attack still struggles with search efficiency and generalization, and the paper flags hybrid approaches combining evolutionary search with other optimization strategies as future work. There is also no public code release attached to the paper, which limits reproducibility but arguably reduces immediate misuse risk.

Why it matters for anyone shipping T2I

If you deploy a T2I product, the practical takeaway is that stacking a prompt filter, a safety-tuned model and an image classifier is not enough on its own. Each of those checkers has a decision boundary an attacker can hug. Effective defenses probably need boundary randomization, ensemble checkers with uncorrelated failure modes, or query rate limits tight enough that a 500-query evolutionary search becomes infeasible. The paper is red-team work, but the blue-team implications are the more useful half of it.