claude-code - 💡(How to fix) Fix [MODEL] False positive content filter repeatedly blocks benign Kotlin import declarations [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56459Fetched 2026-05-06 06:27:29
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

API Error: {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CakET6QraP1F1UJ7K2cTf"}

Code Example

API Error: {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CakET6QraP1F1UJ7K2cTf"}

---

API Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CakET6QraP1F1UJ7K2cTf"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude refused a reasonable request

What You Asked Claude to Do

Add a CandidateAvatar composable to CandidatesScreen.kt in a Kotlin Multiplatform / Compose Multiplatform project. The composable loads candidate JPEG photos from bundled resources and renders them in a circular avatar with a fallback to initials. Standard UI code — no sensitive logic.

What Claude Actually Did

  1. Began writing the response and Kotlin import block
  2. Mid-response, output was cut off every attempt with:
API Error: {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CakET6QraP1F1UJ7K2cTf"}
  1. Claude did not self-report the block — silently ended the response
  2. Issue repeated on every retry until user explicitly told Claude the output was being blocked
  3. Only resolved when Claude changed its approach (split edits, different import ordering)

Expected Behavior

Claude should write the import block and composable body without interruption. All content was standard Kotlin/Compose code. Claude should also surface the block error to the user instead of silently failing.

Files Affected

CandidatesScreen.kt (intended edit only)

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Ask Claude Code to add a Kotlin/Compose composable that imports org.jetbrains.skia.Image as SkiaImage
  2. Claude begins writing the import block
  3. Output is blocked mid-response with "Output blocked by content filtering policy"
  4. Retrying the same task produces the same block repeatedly

Claude Model

Sonnet

Relevant Conversation

Claude response was cut mid-edit with:

API Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CakET6QraP1F1UJ7K2cTf"}

No warning, no explanation. The response just ended. User had to notice and report it manually before Claude acknowledged the issue.

Impact

Medium - Extra work to undo changes

Claude Code Version

2.1.128 (Claude Code)

Platform

Anthropic API

Additional Context

  • The blocked response contained Kotlin import statements including org.jetbrains.skia.Image as SkiaImage — the SkiaImage alias or skia package name likely pattern-matched a filter rule unintentionally
  • No credentials, secrets, or harmful content were present anywhere in the conversation
  • Request ID from one occurrence: req_011CakET6QraP1F1UJ7K2cTf
  • Two separate bugs here:
    1. False positive filter on benign Kotlin imports (org.jetbrains.skia.Image as SkiaImage)
    2. Silent failure — Claude does not surface the block error to the user; task appears to fail with no explanation

extent analysis

TL;DR

The issue can be mitigated by reordering or splitting the import statements to avoid triggering the content filtering policy.

Guidance

  • Verify that the issue is indeed caused by the org.jetbrains.skia.Image as SkiaImage import statement by trying to import it separately and checking if the error occurs.
  • Attempt to reorder the import statements to see if the filtering policy is triggered by a specific order or combination of imports.
  • Consider splitting the code into smaller parts and adding them separately to avoid triggering the filter.
  • Check if there are any other import statements or code snippets that could be contributing to the filtering issue.

Example

No code snippet is provided as the issue is related to the filtering policy and not a specific code error.

Notes

The issue seems to be caused by a false positive filter on benign Kotlin imports, and the silent failure of Claude to surface the block error to the user. The provided guidance is aimed at mitigating the issue, but a permanent fix would require adjustments to the content filtering policy.

Recommendation

Apply workaround: Reorder or split the import statements to avoid triggering the content filtering policy, as this is the most likely way to resolve the issue without waiting for a fix to the filtering policy.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [MODEL] False positive content filter repeatedly blocks benign Kotlin import declarations [1 comments, 2 participants]