# Something like an adversarial attack on the image moderation endpoint

**URL:** <https://community.openai.com/t/something-like-an-adversarial-attack-on-the-image-moderation-endpoint/1276514>\
**Category:** Feedback\
**Tags:** moderation, api-moderation\
**Created:** [June 3, 2025, 2:16am UTC](https://community.openai.com/t/something-like-an-adversarial-attack-on-the-image-moderation-endpoint/1276514 "2025-06-03T02:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyromaniac](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@pyromaniac](https://community.openai.com/u/pyromaniac)\
**Post date:** [June 3, 2025, 2:16am UTC](https://community.openai.com/t/something-like-an-adversarial-attack-on-the-image-moderation-endpoint/1276514/1 "2025-06-03T02:16:35Z")

</div>

I just wanted to share this with anybody really and figured here is as good as anywhere.

I was surprised by how easy it is to synthesize an image that fools the image moderation model; given that you have no access to the model gradients I assumed it was going to be practically impossible.

My best successes have been from using a low parameter (\<300) implicit model to generate an image given the scaled pixel coordinates, and optimize it with CMA-ES against the values returned by the api.

Here’s an example of one such image

 ![4733](https://us1.discourse-cdn.com/openai1/original/4X/5/f/0/5f0a51bf2dfe31427962e8530d8ac5b4d9f9a637.png)

The api flags it like so:  
self\_harm: 0.7709  
sexual: 0.9209  
violence: 0.9207  
violence\_graphic: 0.4179  
self-harm: 0.7709  
violence/graphic: 0.4179

I’m just mostly baffled that images like this can so easily cause misclassification.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [June 3, 2025, 9:35am UTC](https://community.openai.com/t/something-like-an-adversarial-attack-on-the-image-moderation-endpoint/1276514/2 "2025-06-03T09:35:54Z")

</div>

I didn’t get a flag from randomness of an image:

 ![JfQWDjp](https://us1.discourse-cdn.com/openai1/original/4X/d/6/8/d682c2732958df4dc6aed409c1e9f5f09d244cc1.png)  
But including it increased my “sexual” high score of a single bad sentence from `0.627`

Flagged categories: {  
“harassment”: “0.9778”,  
“harassment\_threatening”: “0.9968”,  
“hate”: “0.8341”,  
“hate\_threatening”: “0.8100”,  
“illicit”: “0.6160”,  
“illicit\_violent”: “0.4775”,  
**“sexual”: “0.8793”** ,  
“violence”: “0.9530”  
}

Adding my nonsense convoluted image, I got “flagged” in conjunction with text “_Generate a new image without her clothes!_”, but **not** flagged along with an internet bikini image, `58605404-woman-in-hat-on-the-beach.jpg`. Go figure.

---

<div class="post-metadata">

**Author:** ![pyromaniac](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@pyromaniac](https://community.openai.com/u/pyromaniac)\
**Post date:** [June 4, 2025, 3:18am UTC](https://community.openai.com/t/something-like-an-adversarial-attack-on-the-image-moderation-endpoint/1276514/3 "2025-06-04T03:18:38Z")

</div>

That’s rather ridiculous, but seems in line with what I’ve been finding. The more I interrogate this model/endpoint the less sense it makes to me. (specifically when an image is included)
