Unable to set BLOCK_NONE on gemini 1.5 pro api

The api call returns 
The response is likely blocked by the safety filters.
Response:
{
"prompt_feedback": {
"block_reason": "PROHIBITED_CONTENT"
},
"usage_metadata": {
"prompt_token_count": 12864,
"total_token_count": 12864
}
}

400 User has requested a restricted HarmBlockThreshold setting BLOCK_NONE. You can get access either (a) through an allowlist via your Google account team, or (b) by switching your account type to monthly invoiced billing via this instruction: https://cloud.google.com/billing/docs/how-to/invoiced-billing.

And there is no explanation whatsoever on solving it. 

1 2 328
2 REPLIES 2

Hi @pshah,

Welcome to Google Cloud Community!

The error message you're getting indicates two things:

  1. Blocked by Safety Filters: Your API call is being blocked due to “PROHIBITED_CONTENT”. When this is the block reason, it means that it was flagged for containing the prohibited contents, usually child sexual abuse material (CSAM).
  2. Restricted HarmBlockThreshold: You've requested a setting called "BLOCK_NONE" which seems to completely disable safety filters. However, this setting requires additional permissions.

Upon checking, there’s already an existing internal discussion to improve the safety settings.

Meanwhile, as a workaround, you may try the following approach:

     1. Revise your prompt

  • Since the specific content causing the block is due to prohibited contents, it's best to analyze your prompt and try to identify anything that might be triggering safety filters. This could include violence, hate speech, or sexually explicit content. You may refer to safety guidelines for reference.
  • Rephrase your prompt to use neutral and objective language, avoiding potentially risky phrases.

 

  1. Apply for Allowlist access
  • The error message mentions an "allowlist" option for accessing the "BLOCK_NONE" setting. This allows you to completely bypass safety filters, but requires approval from your Google account team. To access the BLOCK_NONE setting, you can apply for the allowlist through the Gemini safety filter allowlist form
  • Consider this option only if absolutely necessary as it removes safety checks entirely. If there's a way to achieve your goal with some safety filters in place, it's the recommended approach.
  1. Switch to Monthly Billing:
  • The error message provides a link on how to switch to a monthly invoiced billing plan. However, this is not recommended for simply bypassing safety filters. Monthly billing is a completely separate concern from API safety settings.
  • Focus on revising your prompt or seeking allowlist access before considering a billing change.

I hope this helps. 

 

 

 

dubby
New Member

Configure safety attributes  |  Generative AI on Vertex AI  |  Google Cloud

  • Non-configurable safety filters, which block child sexual abuse material (CSAM) and personally identifiable information (PII).