Vertex AI documentation is no longer being updated Vertex AI's services are now part of Gemini Enterprise Agent Platform. See the most up-to-date information in the Agent Platform documentation .
Send feedback
SafetySetting
Stay organized with collections
Save and categorize content based on your preferences.
A safety setting that affects the safety-blocking behavior.
A SafetySetting consists of a harm category and a threshold for that category.
Fields
Required. The harm category to be blocked.
Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
HarmBlockMethod
The method for blocking content.
Enums
HARM_BLOCK_METHOD_UNSPECIFIED
The harm block method is unspecified.
SEVERITY
The harm block method uses both probability and severity scores.
PROBABILITY
The harm block method uses the probability score.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-27 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-27 UTC."],[],[]]