Skip to content

MIRAGE: Defending against malicious image editing via false moderationMIRAGE: Protecting against Malicious Image Editing via False Moderation

arXiv· arXiv:2606.26199· Anshul Nasery, Ramnath Kumar, Cho-Jui Hsieh, Sewoong OhUniversity of Washington; University of California, Los Angeles; ArenaIndexed by this site · 21 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors propose MIRAGE, which uses adversarial perturbations to trigger content moderation refusal by commercial image editing APIs, achieving immunization rates of 88.5%–100% on GPT-Image, Gemini, and Grok (Table 1).

Threat modelThe defender (image owner) adds an imperceptible ℓ∞≤16/255 perturbation to the image, causing the pre-generation safety moderator of a black-box commercial image editing API to misjudge it as violating and refuse; the defender does not know which API the other party uses and can only access the terms of use and open-source models. The adversary holds the image and the editing prompt and can preprocess the image (weak: classic image transformations; strong: may use open-source embedding/generative models), but does not change the auxiliary text or image input.

Questions
Existing image immunization methods require white-box access to model weights and editing prompts, and perturbations do not transfer across models or across prompts, so they cannot protect personal photos from unauthorized alteration by closed-source commercial image editing APIs such as GPT-Image, Gemini, and Grok.
Methods
The authors propose MIRAGE: rather than attacking the generation model itself, it adds adversarial perturbations to the image so that, in the representation space of an ensemble of open-source embedding models, it is close to violating concepts prohibited by the terms of use, thereby triggering refusal by the pre-generation safety moderator of commercial APIs and achieving prompt-independent immunization.
Experiments and results
On ImgEditBench and SHHQ, MIRAGE's immunization rates on GPT-Image, Gemini, and Grok are 88.5%–100%, while all baselines reach at most 14.2% (Table 1); it remains effective against most classic image transformations, but a strong attacker using CLIP counter-optimization can reduce the refusal rate to 12.5%.
Limitations and future work
The authors note three limitations: the required perturbation budget may be further reduced; strong adaptive attackers can bypass immunization; and commercial API moderation behavior changes over time. The experiments cover only three commercial APIs and two datasets, with main results based on 100+48 images.
Experimental setupGPT-Image-2、Gemini-3.1-Flash-Image et al. · ImgEditBench、SHHQ · immunization rate、VLM-as-a-judge
Evaluated models
GPT-Image-2Gemini-3.1-Flash-ImageGrok-Imagine-ImageFlux-Klein-4B
Benchmarks
ImgEditBenchSHHQ
Metrics
immunization rateVLM-as-a-judge
AI summaryResearchers propose an image immunization method, MIRAGE, which adds adversarial perturbations to an image so that the image editing system's pre-generation safety moderation misjudges it as violating policy and automatically refuses, thereby preventing editing; in evaluations against image editing APIs from multiple closed-source providers, the success rate exceeded 88%. Previous image immunization methods required access to model weights and editing prompts, making them difficult to use against commercial editors such as GPT-Image, Gemini Flash Image (Nano Banana) and Grok Imagine; MIRAGE exploits the pre-generation safety moderation, a previously unexplored attack surface, at the system level, adding adversarial perturbations to images so that they align with policy-violating concepts in the representation space integrated by multiple open-source embedding and moderation models. The method is independent of the editing prompt and offers a feasible path to protecting personal images from unauthorized AI editing.

Researchers propose an image immunization method, MIRAGE, which adds adversarial perturbations to an image so that the image editing system's pre-generation safety moderation misjudges it as violating policy and automatically refuses, thereby preventing editing; in evaluations against image editing APIs from multiple closed-source providers, the success rate exceeded 88%. Previous image immunization methods required access to model weights and editing prompts, making them difficult to use against commercial editors such as GPT-Image, Gemini Flash Image (Nano Banana) and Grok Imagine; MIRAGE exploits the pre-generation safety moderation, a previously unexplored attack surface, at the system level, adding adversarial perturbations to images so that they align with policy-violating concepts in the representation space integrated by multiple open-source embedding and moderation models. The method is independent of the editing prompt and offers a feasible path to protecting personal images from unauthorized AI editing.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    How to make image immunization methods remain effective on closed-source commercial image editing APIs that cannot be accessed in a white-box manner.

    Core problem: existing image immunization methods require white-box access to model weights and editing prompts, and cannot protect closed-source commercial image editing systems such as GPT-Image, Gemini, and Grok.

    • Problem setting and importance: AI image editing lets anyone alter others' photos with natural-language prompts, which the authors say fuels non-consensual misuse such as fraud, harassment, defamation, and political disinformation.
    • Shortcomings of existing methods: the authors say methods such as PhotoGuard and EditShield require white-box access to model weights and to the prompts used by the attacker; a perturbation optimized for one open-source model and one prompt does not reliably transfer to other models and prompts; black-box zeroth-order optimization attacks have high query cost (over 50 USD per image, about 15–30 seconds per API call); universal perturbation methods require an ensemble of surrogate models with architectures similar to the target model and are ineffective against closed-source systems.
    • Core observation: all mainstream commercial image editing APIs have pre-generation safety moderation—when an image is judged to violate policy, generation is refused regardless of the prompt. The authors propose turning this safety mechanism into a defense tool, called false moderation.
    • Method proposed in the paper: MIRAGE (Moderation Induced Resistance Against Generative Editing), which uses adversarial perturbations to move an image close to violating concepts in the representation space of an ensemble of open-source embedding and moderation models, triggering refusal by commercial APIs.
    • Threat model (Section 2.1):
      • Adversary's goal: hold image x and an editing prompt, and use a proprietary black-box image editor f to turn x into a target image without the owner's consent.
      • Adversary's capabilities: a weak adversary can only preprocess the image with classic image processing transformations; a strong adversary also has white-box access to some open-source embedding, editing, or generation models and can edit or purify the image locally.
      • Adversary's constraints: does not change auxiliary text or image inputs to jailbreak the immunization.
      • Defender's (image owner's) knowledge: does not know which proprietary editor the attacker uses, and can only access each API's terms of use and open-source models.
  2. What related research exists?

    Related work falls into three lines: image immunization, defensive adversarial attacks, and black-box attacks on proprietary models.

    Image immunization

    • PhotoGuard (Salman et al., 2023): Adds a small perturbation to an image to degrade the output of diffusion editing models, optimized with PGD; it requires computing gradients of the editing model and can only be used on white-box editors; a VAE variant maximizes the latent-space distance of the encoder.
    • Subsequent white-box methods: EditShield (Chen et al., 2025) uses data augmentation, other work uses masks, universal perturbations, or learned networks to generate perturbations, and still other work defends by disrupting attention matrices or intermediate features, or by collapsing the VAE posterior. The paper notes that these methods all require full access to a white-box model, and their perturbations do not transfer across diffusion models.
    • Transfer-based immunization: TDAE (Zhang et al., 2026) adds a Hessian curvature regularizer to encourage cross-architecture transfer; BlurGuard (Kim et al., 2025) regularizes the noise spectrum. The paper reports in experiments that such methods are ineffective against production-grade black-box systems.

    Defensive adversarial attacks (adversarial attacks for good)

    • Nightshade, Glaze: Use data poisoning to protect artists' styles from imitation.
    • Model fingerprinting and VQA protection: Use backdoor attacks to detect misuse of open-weight models; construct adversarial examples for VQA models to prevent them from answering questions about users' private images. The paper states that this work's key technique differs from these works: it turns proprietary models' safety moderation against the systems themselves.

    Black-box attacks on proprietary models

    • Zeroth-order optimization methods (NES, ZOO, SquareAttack, etc.): Require thousands to tens of thousands of queries; the paper notes that commercial image editing endpoints take 15–30 seconds per forward pass, so 1,000 queries take about 6–8 hours, which is impractical for end users.
    • Transfer attacks and concurrent work: Zhang et al. (2026) use a CLIP ensemble to construct perturbations that bypass commercial VLMs' moderation and decision pathways to produce violating content; the paper states that this work's goal is the opposite—perturbing the input image so that content moderation filters refuse originally benign images.

    Baselines and benchmarks: The experiments compare PhotoGuard (diffusion and VAE variants), BlurGuard, TDAE, and SquareAttack (directly attacking OpenAI's public moderation API); test images come from ImgEditBench and SHHQ.

    The authors' positioning: The three lines of research each provide part of the foundation, but none solves the problem of immunizing against black-box production-grade image editors, and this paper addresses this gap.

  3. How does the paper address this problem?

    MIRAGE uses an ensemble of open-source embedding models to perform a transfer attack, pushing images into the moderator's violation region to trigger refusal.

    Overall idea: Rather than directly attacking the black-box generative model, attack the pre-generation safety moderator C shared by all commercial APIs. Add an ℓ∞-bounded perturbation to the image so that, in the representation space of multiple open-source embedding models, it aligns with violating concepts, thereby causing an unseen black-box moderator to misjudge it as violating and refuse the edit, independent of the prompt. The method is named MIRAGE.

    Problem setting

    • The image owner releases a perturbed image x̂ = x + δ, requiring: (i) visual closeness to the original image; (ii) invalidation of editing, i.e., f(x̂) differs greatly from f(x), or the API directly refuses.
    • The defender does not know which proprietary editor the attacker uses, and only assumes access to each API's terms of use and open-source models.

    Target concept set and surrogate models

    • Target concept set T: Systematically survey the terms of use of xAI Grok, Google Gemini, and OpenAI GPT-Image, extract commonly prohibited concepts (e.g., sexually explicit content, gory violence, copyrighted material), and collect public images and text descriptions for each concept. The main experiments use 5 images plus 3 texts, corresponding to sexually explicit content (Figure 9 shows this category is moderated more strictly).
    • Surrogate embedding ensemble: n open-source embedding models {F_i}, including 8 transformer-based CLIP-style models, a self-supervised encoder (DINOv2), and an open-source moderation model (ShieldGemma-2). For each model, compute the average cosine similarity between the perturbed image and the targets in T: φi(x+δ, T) = 1/(|T|) ∑y ∈ T cos(Fi(x+δ), Fi(y)), i.e., the average degree of alignment between the perturbed image and the violating targets in representation space.

    Optimization objective and global-local views

    • Core objective: max|δ|∞ ≤ B ∑i=1n φi(x+δ, T), maximizing alignment across all surrogate models under an ℓ∞ budget B, so that the image falls into the violation region of multiple representation spaces, increasing the probability of triggering refusal by an unseen API moderator.
    • Global-local views: Most embedding models are trained at resolutions below 512×512, while actual images can be up to 1024×1024. The global view resizes the whole image to the encoder's native resolution; the local view takes 16 randomly cropped patches and aggregates patch similarities with top-k (k=8), with a local view weight λ=0.25.

    Optimization and engineering details

    • Augmentation and optimization: Each step randomly samples one augmentation (random crop, resize, Gaussian blur, JPEG compression, flip); non-differentiable augmentations use straight-through gradient estimation; PGD with iterative FGSM optimizes for 5,000 steps with step size 1.0 and a cosine schedule.
    • Model dropout and secant gradient caching: Each step drops surrogate models with probability 0.3 (keeping at least 3), and for dropped models uses the cached most recent two gradients for a rank-1 secant approximation, reducing memory and computation overhead.
    • Validation: Optionally, OpenAI's public moderation API is used for early-stopping checkpoint selection; the paper reports that omitting this step gives comparable or better results (Figure 10).
    • Cost: Immunizing one 1024×1024 image takes 15 minutes on 1 A40 GPU (Appendix B).
  4. What experiments did the paper conduct?

    On three commercial APIs, MIRAGE's immunization rate is 88.5%–100%, versus at most 14.2% for baselines; strong adaptive attacks can bypass it.

    Experimental setup

    • APIs tested: OpenAI GPT-Image-2, Google Gemini-3.1-Flash-Image, and xAI Grok-Imagine-Image, all accessed through standard developer endpoints; final numbers were rerun on June 10, 2026.
    • Datasets: ImgEditBench uses 100 images and their editing prompts; SHHQ uses 48 high-resolution portraits with fixed editing prompts; ablation experiments use the 48-image SHHQ subset. All images are evaluated at their original resolution (up to 1024×1024).
    • Baselines: PhotoGuard (diffusion variant and PG-VAE), BlurGuard, TDAE, and SquareAttack (directly attacking OpenAI's public moderation API); white-box baselines uniformly use Flux-Klein-4B as the surrogate target model.
    • Metric: Immunization rate, i.e., the proportion of target API edits that fail. MIRAGE produces explicit refusals, which are counted directly as refusals; baselines do not produce refusals, so VLM-as-a-judge is used to determine whether the edit failed.
    • Judging method: Gemini-Flash-3.1 serves as judge; for SHHQ it determines whether the person is the same before and after editing, and for ImgEditBench it determines whether the edit succeeded (the judging prompt is given in Appendix B.2).
    • Default setting: Unless noted otherwise, the perturbation budget is ∥δ∥∞ ≤ 16/255.

    Main results

    According to Table 1 (baselines are VLM-as-a-judge results, MIRAGE is the refusal rate, ∥δ∥∞ ≤ 16/255):

    Swipe horizontally to read the table

    MethodGPT-ImageGeminiGrok
    PhotoGuard7.4%10.8%2.0%
    PhotoGuard-VAE12.8%5.4%2.0%
    TDAE14.2%12.2%7.4%
    BlurGuard9.5%8.8%2.0%
    SquareAttack4.1%0.0%0.7%
    MIRAGE100.0%88.5%94.0%
    • The authors state that all existing baselines are essentially ineffective against proprietary APIs, including TDAE, which explicitly targets transferability; MIRAGE provides nearly complete protection on GPT-Image and close to 90% on Gemini and Grok.
    • The authors explain the source of the difference: MIRAGE does not assume any information about the underlying editing model, but instead acts on the content moderation stage.
    • Perturbation budget trade-off (Table 4, SHHQ): As ∥δ∥∞ increases from 2/255 to 16/255, the immunization rate increases monotonically, e.g., GPT-Image rises from 7.1% to 100.0%; the authors state that larger budgets introduce visible artifacts.

    Robustness under weak attackers and composite attacks

    • What was tested: 48 SHHQ images, with weak attackers preprocessing immunized images using classic image transformations (Table 3, Figure 5).
    • Results: Under Gaussian blur, JPEG compression, resizing, and screenshots, the immunization rate remains 100% on all three APIs; the worst is social media cropping, with GPT-Image 73.0%, Gemini 77.0%, and Grok 75.0%; grayscaling reduces Gemini to 77.1%; under histogram equalization, Grok is 83.3%.
    • Authors' interpretation: MIRAGE remains effective against most transformations under the weak threat model.

    Robustness under strong attackers

    • What was tested: Four adaptive attacks (Table 3, Figure 6): foreground segmentation pasted onto a white background, denoising purification with a local diffusion model (Flux-v.2-Klein-4B), CLIP counter-optimization using 4 embedding models (PGD 2,000 steps, ∥δ∥∞ ≤ 16/255), and fully local editing.
    • Results: Under the segmentation attack, Gemini is 77.1%; after diffusion purification, GPT-Image's refusal rate is 56.2% (70.8% by the VLM judge); the CLIP attack reduces the refusal rate to GPT-Image 8.3%, Gemini 10.5%, and Grok 6.2% (47.9%, 14.6%, and 12.5% respectively by the VLM judge); local editing completely bypasses the moderation pathway.
    • Authors' interpretation: Strong attackers can construct powerful perturbations to bypass immunization; the authors consider how to fully defend against strong attackers an open problem, and state that MIRAGE is the most effective of existing methods at raising the attacker's cost; if the owner knows the local model the attacker uses, a PhotoGuard-style objective can be added for composite immunization (qualitative results are given in Appendix C.2).

    Other ablations and analyses

    • Ensemble size (Table 2, Figure 7): At ∥δ∥∞=8/255, a 4-model ensemble achieves 52.1% on Grok, while an 8-model (Full) ensemble achieves 75.0%; gains diminish as the ensemble grows and the budget increases.
    • Global-local views (Table 2, Figure 8): Removing the local view (No Global-local) reduces Grok from 75.0% to 16.7% at the 8/255 budget.
    • Target concepts (Table 2, Figure 9): When switching to violence/gore targets, GPT-Image drops from 89.6% to 33.3% and Gemini from 68.8% to 2.1% at 8/255, but Grok instead rises from 75.0% to 62.1%→95.8% (at 16/255); the authors state that Grok's filter is stricter on gory content.
    • Early stopping with the public moderation API (Table 2, Figure 10): Using OpenAI's public moderation API for checkpoint selection (With C̃) versus not using it (No C̃) performs worse on non-OpenAI models, e.g., at 8/255, Gemini 68.8% versus 75.0%.
  5. What are some points that can be further explored?

    The authors list three limitations—perturbation budget, strong adaptive attacks, and time-varying API moderation—and give several future directions.

    Limitations and future directions noted by the authors

    • Perturbation budget can be reduced (Section 6 Limitations): The ∥δ∥∞ budget required for reliable cross-API immunization may be reduced through more refined optimization techniques, to improve the visual fidelity of immunized images.
    • Strong adaptive attackers can bypass (Section 6 Limitations): A sufficiently strong adaptive attacker with access to open-source CLIP models or a local diffusion purification model can bypass immunization; the authors consider enhancing robustness to adaptive attackers through adversarial training or a min-max formulation an open problem.
    • Evaluation is based on online commercial APIs, and effectiveness may change over time (Section 6 Limitations): As providers update their moderation systems, immunization effectiveness may change; the authors report observing that Grok's attack success rate fluctuated noticeably between early June and mid-June, and consider that black-box APIs may undergo silent updates.
    • Composite immunization (Section 6 Future Directions): Combining the false moderation objective with a PhotoGuard-style latent-space disruption term may simultaneously protect against black-box commercial APIs and white-box open-source editors, and merits further study.
    • Other shared structures (Section 6 Future Directions): The authors raise the question of whether other shared structural properties of commercial AI systems—such as watermark detectors, copyright filters, and output safety classifiers—can likewise be exploited for user-side protection.
    • Extension to other modalities (Section 6 Future Directions): As multimodal models process video and audio, extending false moderation to these modalities is a direction.

    Experimental coverage

    • The systems tested are three commercial image editing APIs: GPT-Image-2, Gemini-3.1-Flash-Image, and Grok-Imagine-Image (Section 5.1).
    • The datasets are ImgEditBench (100 images) and SHHQ (48 images); ablation and robustness experiments use only the 48-image SHHQ subset (Section 5.1).
    • Defense evaluation covers 9 weak/composite transformations and 4 strong adaptive attacks (Table 3).
    • The baseline VLM-as-a-judge evaluation uses Gemini-Flash-3.1; the paper does not report the agreement rate between this judge and human judgment, only giving qualitative examples in Appendix C.1 and stating that they agree with human judgment.
    • The paper does not report the number of repeated runs or variance for each condition; the final numbers are the results of a single rerun on June 10, 2026 (Section 5.1).
  6. Summarize the main content of the paper

    MIRAGE turns commercial APIs' safety moderators into a defense surface, achieving 88.5%–100% immunization rates against three closed-source editors.

    An image immunization (defense) paper addressing unauthorized image tampering against closed-source commercial image editing APIs.

    • Problem: Existing immunization methods require white-box access to model weights and editing prompts, and perturbations do not transfer across models or prompts, making them ineffective against black-box systems such as GPT-Image, Gemini, and Grok.
    • Method highlights: The authors find that all mainstream commercial APIs have a pre-generation safety moderation step, and propose false moderation—adding an ℓ∞≤16/255 adversarial perturbation so that the image, in the ensemble representation space of 8 open-source embedding and moderation models, is close to concepts prohibited by the terms of use (the main experiments use sexually explicit content), triggering API refusal; combined with global-local views, random augmentations, model dropout, and secant gradient caching, optimizing 5,000 steps of PGD.
    • Main results: On ImgEditBench (100 images) and SHHQ (48 images), MIRAGE achieves immunization rates of 100.0%, 88.5%, and 94.0% on GPT-Image, Gemini, and Grok, respectively; the strongest baseline TDAE reaches at most 14.2% (Table 1).
    • Robustness: Under most classic transformations by weak attackers, the immunization rate remains 100%, with the worst case being social media cropping at 73.0%–77.0% (Table 3); a strong attacker's CLIP counter-optimization can reduce the refusal rate to 6.2%–10.5%, and local editing can bypass it entirely.
    • Ablation: Global-local views are critical for high-resolution images (Grok rises from 16.7% to 75.0% at the 8/255 budget); larger surrogate ensembles monotonically improve the immunization rate but with diminishing returns (Table 2).
    • Authors' conclusion: The authors state that the content moderation pipeline is a practical defense surface for image immunization, that false moderation is naturally prompt-independent, and that providers' preference for moderation policies with low miss rates favors defenders; the authors hope to shift immunization research from an arms race against individual generative architectures to the more stable shared attack surface of responsible use policies and their enforcement mechanisms.
Read originalarxiv.org