InGuard: Towards Generalized Inner Guardrail for Safe Text-to-Image Generation
On the map: LLM safety and security → Vision-language and text-to-image safety
Abstract (arXiv)
Modern text-to-image (T2I) models generate high-quality images from arbitrary user prompts, yet they can just as easily produce not-safe-for-work (NSFW) content. Conventional outer guardrails consist of two components: a prompt classifier that checks for risk before generation, and a post-hoc image classifier that checks the fully generated image. In this design, both classifiers operate outside the generation pipeline and do not use the model's own representations. This separation can limit prompt-screening accuracy, while the image-side check runs only after the full generation cost has been spent. Moreover, a flagged prompt can only be rejected, even when it could be adjusted to produce a safe image. In this work, we propose the Inner Guardrail (InGuard), a safety framework that works inside the pipeline on the model's own representations, leaving base-model parameters untouched. First, a risk classifier grades each prompt as unsafe, risky, or benign based on the text encoder's embeddings, with no external language model. Second, SAGE (Soft-gated Asymmetric Guardrail for Embeddings) modifies the embeddings of risky prompts, aiming to return a safe image instead of a refusal. Third, a latent detector checks the one-step clean latent estimate midway through denoising, reaching nearly image-level performance and halting generation when risk is detected. We also construct the RevGen Safety Benchmark to evaluate T2I safety under realistic conditions: 10,000 prompts built through real-image reverse generation, with a rewriting step that supplies controlled intellectual-property (IP) characters, covering graded porn/gore risks, categorical IP risks, and benign negatives. Across five open-weight T2I models, InGuard reaches 97.9-98.8% safety rate, matching or exceeding the outer guardrail, with 57.5-73.5% less benign disturbance, ~3.7x fewer parameters, and 50-55.6% of denoising steps skipped.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Vision-language and text-to-image safety, one of 12 directions in LLM safety and security. Builds on 36 of its 45 references that are in the map. First posted on arXiv 23 Sep 2026.
Builds on
36 of 45 references.
Closest ancestors · 5
Same direction, newest first
- 2026SafeRoPE: Risk-specific Head-wise Embedding Rotation for Safe Generation in Rectified Flow Transformers2 Apr
- 2026When Safety Collides: Resolving Multi-Category Harmful Conflicts in Text-to-Image Diffusion via Adaptive Safety Guidance24 Feb
- 2024SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation16 Oct
- 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models10 Apr
- 2023Ring-A-Bell! How Reliable are Concept Removal Methods for Diffusion Models?16 Oct
Other references · 31
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2015U-Net: Convolutional Networks for Biomedical Image Segmentationcited by 19,713
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
- 2025Qwen3 Technical Reportcited by 8,820
- 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,974
- 2022Scalable Diffusion Models with Transformerscited by 6,054
- 2022Classifier-Free Diffusion Guidancecited by 5,847
- 2022Flow Matching for Generative Modelingcited by 5,702
- 2025Qwen2.5-VL Technical Reportcited by 5,587
- 2022LAION-5B: An open large-scale dataset for training next generation image-text modelscited by 4,152
- 2022Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flowcited by 3,700
19 more
- 2022A ConvNet for the 2020scited by 3,579
- 2025InternVL3.5: Advancing Open-Source Multimodal Models in Versatility, Reasoning, and Efficiencycited by 1,510
- 2025Qwen-Image Technical Reportcited by 1,044
- 2023Erasing Concepts from Diffusion Modelscited by 539
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 513
- 2021ByT5: Towards a token-free future with pre-trained byte-to-byte modelscited by 509
- 2024Multilingual E5 Text Embeddings: A Technical Reportcited by 372
- 2023Ablating Concepts in Text-to-Image Diffusion Modelscited by 317
- 2022The Vendi Score: A Diversity Evaluation Metric for Machine Learningcited by 311
- 2025Z-Image: An Efficient Image Generation Foundation Model with Single-Stream Diffusion Transformercited by 277
- 2023MMA-Diffusion: MultiModal Attack on Diffusion Modelscited by 194
- 2022Can Machines Help Us Answering Question 16 in Datasheets, and In Turn Reflecting on Inappropriate Content?cited by 155
- 2025T2ISafety: Benchmark for Assessing Fairness, Toxicity, and Privacy in Image Generationcited by 48
- 2026InternVL-U: Democratizing Unified Multimodal Models for Understanding, Reasoning, Generation and Editingcited by 28
- 2024Six-CD: Benchmarking Concept Removals for Benign Text-to-image Diffusion Modelscited by 9
- 2025Sparse Autoencoder as a Zero-Shot Classifier for Concept Erasing in Text-to-Image Diffusion Modelscited by 8
- 2025Responsible Diffusion Models via Constraining Text Embeddings within Safe Regionscited by 8
- 2025Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Modelscited by 7
- 2026FlowGuard: Towards Lightweight In-Generation Safety Detection for Diffusion Models via Linear Latent Decodingcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models
- 2025SafeGuider: Robust and Practical Content Safety Control for Text-to-Image Models
- 2024GuardT2I: Defending Text-to-Image Models from Adversarial Prompts
- 2024Latent Guard: a Safety Framework for Text-to-image Generation
- 2025Beyond the Safety Tax: Mitigating Unsafe Text-to-Image Generation via External Safety Rectification
- 2025PromptSafe: Gated Prompt Tuning for Safe Text-to-Image Generation
- 2024Universal Prompt Optimizer for Safe Text-to-Image Generation