The prompt could not be submitted. This prompt contains sensitive words that violate Google's Responsible AI practices — Imagen API 400
The exact error
Image generation failed with the following error: The prompt could not be submitted. This prompt contains sensitive words that violate Google's Responsible AI practices. Try rephrasing the prompt. If you think this was an error, send feedback.
Imagen rejected the request before generating anything, because a safety filter flagged the input. Nothing was produced, and the request fails outright rather than coming back as an empty success.
What it means
Google’s Imagen responsible AI page documents this exact response. It says
that text prompts, and input images when editing, are checked against safety
filters for harmful categories such as violence, sexual, derogatory and toxic
content. When the text input or input image is filtered, the page says you get
a response with a 400 error code, and it shows the payload with
"status": "INVALID_ARGUMENT". The same page says an error message such as
“The prompt couldn’t be submitted” means the input is triggering a safety
filter.
There is an editing variant. The page’s example includes a detail string that begins “Image editing failed with the following error:” followed by the same sentence and a support code. The cause is the same: the input was filtered.
This is a different path from output filtering. js-genai issue #321 describes
the split: a pre-filter on the prompt throws a 400 like this one, while a
separate check on generated images does not throw and instead returns a
response with no image and a raiFilteredReason. That second case has its own
page, linked below.
Where Imagen stands now. You are most likely to meet this error in older
code or while migrating. Google’s Imagen page for the Gemini API says Imagen
models are shut down and no longer available there. On Vertex AI (now branded
Gemini Enterprise Agent Platform), Google’s Imagen docs describe the Imagen
endpoints, including imagen-4.0-generate-001, as deprecated, list them under
“Discontinued endpoints” with gemini-2.5-flash-image as the replacement, and
recommend updating before June 30, 2026 to avoid service disruption. The docs
do not say whether those Vertex endpoints still answer today, so check in your
own project rather than assuming.
How to confirm it’s this
- HTTP status 400,
statusINVALID_ARGUMENT, and the message contains “The prompt could not be submitted”. - Look for a support code in the error details. Google’s page maps each code to a category and says whether it applies to the input prompt or the output image. Input-side codes include:
| Support code | Category (input) |
|---|---|
| 58061214 | Child |
| 29310472 | Celebrity |
| 62263041 | Dangerous content |
| 57734940 | Hate |
| 42876398 | Other |
| 92201652 | Personal information |
| 89371032 | Prohibited content |
| 90789179 | Sexual |
| 78610348 | Toxic |
| 61493863 | Violence |
| 32635315 | Vulgar |
- Google says a request with filtered input returns this documented format
when you set either
includeRaiReasonorincludeSafetyAttributes. Turn one of them on if you need the details for logging.
Fix
The fix is in how your code handles the rejection, not in getting the prompt past the filter.
- Catch it as a content decision. Branch on the 400 plus the message text, and do not treat it like a malformed request your code can repair.
- Log the support code. It tells you which category fired and lets you report patterns without storing prompts in plain text.
- Personal information is a real data problem. If the code is 92201652, Google’s table says the prompt contains personally identifiable information, such as a credit card number or home address. That data should not be in an image prompt in the first place.
- Surface it to the person who wrote the prompt. An agent should say the request was blocked by the provider’s safety filter, not silently reword it and try again.
- Report false positives. Google’s page invites feedback on responses you believe are inaccurate, and the error text itself says to send feedback if you think it was an error.
- Plan the migration. Imagen is shut down on the Gemini API and
deprecated on Vertex, so new work belongs on a Gemini image model, which
reports blocks through
promptFeedbackor the candidate’s finish reason instead of this 400.
Retry or not
No, not automatically. The filter judged the input itself, and nothing in Google’s docs suggests the same input will pass on a second try. Google’s API errors page says that for generation-blocked codes you should modify your input and then retry; that is a decision for whoever owns the prompt, not a loop for the agent. Treat a revised prompt from the user as a new request.
When it’s not this
- HTTP 200 with no image and a
raiFilteredReason. The prompt passed, but the generated images were filtered. See the filtered-out page below. - A Gemini image model. Nano Banana reports blocks through
promptFeedback.blockReasonor a finish reason such asIMAGE_SAFETY, not as this 400. - Person generation settings. Output code 39322892 (People/Face) is about generating people when your settings do not allow it, which is an output-side result, not this input rejection.
Related errors
- All images were filtered out (Imagen)
- IMAGE_SAFETY (Nano Banana)
- IMAGE_PROHIBITED_CONTENT
- OpenAI moderation_blocked
- fal content_policy_violation
Error text last verified against the sources below on .