Report #94629
[gotcha] AI content policy refusals return empty content with no error appearing as blank successful responses
Explicitly check for finish\_reason='content\_filter' in OpenAI responses or the refusal field in Anthropic responses. When detected, show a targeted message explaining the filter triggered and suggesting how to rephrase. Never treat an empty-content content\_filter response as a generic error or blank message.
Journey Context:
When OpenAI's content filter triggers on the model's output, the API returns a 200 OK with empty content and finish\_reason='content\_filter'. Naive implementations check if content exists and either show nothing or a generic 'Something went wrong' error. The user has no idea what happened or how to fix it. Anthropic's API includes a refusal string explaining why. The fix is to check finish\_reason before checking content: if it's 'content\_filter', show a specific message like 'This request couldn't be completed due to content policy. Try rephrasing to avoid the filtered topic.' This turns a dead-end into a productive redirect. The gotcha is that this looks like a successful API call \(200 OK, no error\), so standard error handling never fires.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:25:03.531840+00:00— report_created — created