Gemini Image API PROHIBITED CONTENT While working in chat

Hey everyone,

Currently facing a little challenge, I’m trying to generate images with gemini image API. For some reasons a lot of them get blocked due to PROHIBITED CONTENT which is very weird:

A) I carefully checked the prompt and I don’t see anything that could trigger the PROHIBITED CONTENT (see the prompt after)

B) I tested the very exact same prompt in the chat and got the image generated systematically. I tried dozens of images to be sure.

What could be the issue here? By the way I read that system prompt can be problem as well as streaming parameter. I haven’t included any of them in my code.

IF you have any insights that would be very helpful

Thank you

##CONTEXT##

You are provided with TWO images: Two canvases containing the same **product** with different angles on white backgrounds

##SCENE & PRODUCTION INSERTION INSTRUCTIONS##

Generate the scene with the inserted **product** according to the instructions provided below.

Ensure a consistent integration of the product, relevant, seamless and natural.

{

"rendering_protocol": "YOU ARE an advanced image generator that can parse instructions. Build an authentic real-life scene for a social media post (e.g., Instagram), taken as if from a phone by a companion. The scene contains a clear insertion of the product. Understand the nature of the product to ensure a realistic, seamless depiction. Do NOT render keys, labels, section markers, or instructions.",

"target_audience": "Who? The Peak Performer, 25-40, gender-neutral. Driven, analytical individuals in high-stakes roles (tech, finance, creative). What they want? They seek to optimize their mental and physical state for demanding tasks, valuing tools that enhance focus, flow states, and cognitive resilience.",

"shot_angle": "A medium shot from a slightly low angle, capturing the subject from the waist up. The perspective is intimate, as if taken by someone sitting across the table on a train.",

"subject_features_expressions": "A person in their early 30s, androgynous, with a sharp, intelligent look. Their eyes are closed, not in sleep, but in deep concentration. Their expression is one of intense internal focus—a calm, controlled state of 'flow'. The brow is relaxed, the jaw is unclenched, embodying a state of peak mental clarity.",

"physical_features": "Natural skin texture with subtle imperfections; A strong bone structure with a defined jawline; Short, dark, slightly tousled hair; Eyebrows are natural and well-defined. The subject has a lean, athletic build, suggesting a disciplined lifestyle.",

"real_life_setup": "Inside a modern, first-class cabin of a high-speed train. The subject is seated in a comfortable, minimalist seat next to a large window. On the sleek table in front of them is a high-performance laptop (closed) and a single black Moleskine notebook with a pen resting on it.",

"scene": "The landscape outside the large train window is a dramatic blur of motion, suggesting high speed and the passage of time. The interior of the train is calm and bathed in a mix of soft, ambient cabin light and the cool, natural light from the window, creating a stark contrast between the subject's inner stillness and the world rushing by.",

"product_insertion": "The subject is wearing a dark, high-quality, fitted merino wool t-shirt. The product, a sleek, minimalist breathing belt, is worn over the shirt around their midsection. It's clearly visible as they lean back slightly, hands resting calmly on their lap. The product's placement emphasizes their centered, controlled posture.",

"photography_style": "Shot on Fujifilm X100V, cinematic, candid moment, shallow depth of field, natural light from the window, capturing the texture of the clothing and the subtle details of the subject's focused expression.",

"compliance": "Full bleed image, NO borders, No Phone Visible. Seamless, Highly Consistent & Relevant Product Insertion. Extremely authentic character & set-up, Social media Post style. The pose must be anatomically correct, natural, and physically plausible. NEVER render keys, labels, section markers, or instructions.",

"negative_prompt": "top_left logo, perfectly symmetrical face, flawless, retouched, photoshop, airbrushed, smooth skin, glossy skin, pristine, forced smile, insincere expression, flat lighting, harsh lighting, over-sharpened, mannequin-like, static expression, stiff expression, unemotional, vacant stare, empty eyes, lifeless eyes, glassy eyes, extra limbs, extra hands, malformed hands, bad anatomy, unnatural pose, deformed, disfigured, brand name, logo, text, buttons, CTA",

"negative_space": "top_left"

}

Yes I got the same problem…

30% of them get’s flagged as PROHIBITED CONTENT.

While the ad creation is generally an ad for a SaaS targeting professoinals.

I think Gemini-Flash still isn’t production ready.

I drop it out of my stack and will only use OpenAI instead.

understand your frustration. Getting a significant percentage of your AI-generated content flagged as “PROHIBITED CONTENT” is a major roadblock, especially when your use case is for something as standard as SaaS ads. This experience can make a developer lose confidence in a tool’s production readiness.

You’re correct to point out that this is a common problem with large language models, and Gemini 2.5 Flash, being a very new model, is likely still being fine-tuned for a wide variety of real-world use cases. The content filters are designed to be overly cautious to prevent the generation of harmful or dangerous content. However, this can lead to false positives, especially when the content is subtle, or the system flags certain keywords or phrases that are innocent in a different context.

The “PROHIBITED_CONTENT” flag is a non-configurable safety filter, meaning it’s a hard block that you can’t bypass by adjusting safety settings. This specific flag is often triggered by content that is deemed to be in violation of core safety policies, such as CSAM (Child Sexual Abuse Material), but it can sometimes be an overly aggressive catch-all for other policy violations.

The fact that you’ve decided to switch to OpenAI is a very common decision for developers who need to get to production quickly and require reliability. OpenAI’s models, particularly GPT-4 and GPT-4o, have a more established track record and are known for their consistency and predictability, even if they are more expensive. They’ve had more time to refine their content moderation systems to reduce false positives for commercial use cases.

Here’s a summary of why you might have had this experience and why your decision is a reasonable one:

Aggressive Safety Filters: Google’s AI models are trained with a strong emphasis on safety. This can result in a more conservative approach to content filtering, leading to a higher rate of “PROHIBITED CONTENT” flags for content that is not inherently harmful.

Model Specificity: Gemini 2.5 Flash is optimized for speed and low latency, making it excellent for high-volume, real-time tasks. However, this optimization might come with a trade-off in the nuance of its content filtering compared to a larger, more powerful model like Gemini 2.5 Pro or OpenAI’s GPT-4o.

Production Readiness: While Google has stated that some Gemini 2.5 models are “generally available” and “production-ready,” this often means they are stable from a technical standpoint (e.g., uptime, performance). However, the real-world performance for specific use cases, like ad creation for a SaaS business, can still have unexpected issues like overzealous content flagging.

Your experience highlights a critical point for developers: the best model for a given task is not always the newest or the fastest. It’s the one that delivers the most consistent and reliable results for your specific business needs. For generating ad content where the risk of a “PROHIBITED” flag is a significant business liability, reliability and consistency are more valuable than raw speed or a slightly lower cost.

“Modified by moderator”

1 Like