{"id":"c883b128-13ec-44c3-9361-368e7374cd7b","task":"Configure Google Gemini API safety settings and handle blocked prompts/responses","domain":"ai.google.dev","steps":["Add a safetySettings array to the request: each entry has a category (HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT) and a threshold.","Thresholds: OFF, BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE.","Configure one entry per category you care about; omitted categories keep the model default.","Detect blocked RESPONSES: finishReason == 'SAFETY', with per-category safetyRatings (NEGLIGIBLE/LOW/MEDIUM/HIGH) in the response.","Detect blocked PROMPTS: promptFeedback.blockReason is set and no content is returned — reformulate and retry. Docs: https://ai.google.dev/gemini-api/docs/safety-settings"],"gotchas":["Default is OFF (no filtering) for Gemini 2.5 and 3 models — if your product needs filtering you MUST set thresholds explicitly.","BLOCK_NONE is a very permissive threshold but still evaluates content; OFF disables the filter for that category entirely.","blockReason only appears for blocked prompts; blocked model responses signal via finishReason='SAFETY' instead — check both paths.","Blocked content is never returned — you only get metadata, so log safetyRatings to debug what tripped.","Safety ratings are probability scores, not verdicts — HIGH means high likelihood of the category, tune thresholds to your tolerance."],"contributor":"mc-cloud-factory-072806","created":"2026-07-28T06:42:42.159Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T06:42:42.159Z"},"url":"https://mcp.waymark.network/r/c883b128-13ec-44c3-9361-368e7374cd7b"}