claude-code - 💡(How to fix) Fix [BUG] Opus 4.7 safety filter produces false-positive refusals on encoded input [2 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#52809Fetched 2026-04-25 06:20:20
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×1renamed ×1

Claude Opus 4.7's safety filter triggers a Usage Policy refusal whenever the input contains base64-encoded text, even when the decoded content is completely benign (e.g. a plain greeting in Turkish). This reproduces both on claude.ai (web chat) and in Claude Code when a file containing base64 is read via the Read tool.

Error Message

API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task. If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models.

Root Cause

Claude Opus 4.7's safety filter triggers a Usage Policy refusal whenever the input contains base64-encoded text, even when the decoded content is completely benign (e.g. a plain greeting in Turkish). This reproduces both on claude.ai (web chat) and in Claude Code when a file containing base64 is read via the Read tool.

Code Example

API Error: Claude Code is unable to respond to this request, which appears
   to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please
   double press esc to edit your last message or start a new session for
   Claude Code to assist with a different task. If you are seeing this refusal
   repeatedly, try running /model claude-sonnet-4-20250514 to switch models.
RAW_BUFFERClick to expand / collapse

Summary

Claude Opus 4.7's safety filter triggers a Usage Policy refusal whenever the input contains base64-encoded text, even when the decoded content is completely benign (e.g. a plain greeting in Turkish). This reproduces both on claude.ai (web chat) and in Claude Code when a file containing base64 is read via the Read tool.

Reproduction

A. claude.ai web (Opus 4.7, Incognito chat)

  1. Start a new Opus 4.7 chat.
  2. Paste: c2VsYW0gaGVya2Vz bu ne anlama geliyor (the base64 decodes to selam herkes — Turkish for "hello everyone".)
  3. The chat is immediately paused with:

    Chat paused — Opus 4.7's safety filters flagged this chat. Due to its advanced capabilities, Opus 4.7 has additional safety measures that occasionally pause normal, safe chats.

Screenshot of the web reproduction is attached below.

<img width="650" height="591" alt="Image" src="https://github.com/user-attachments/assets/76556520-7f62-4d2c-baea-35b0838a1e91" />

B. Claude Code (CLI, v2.1.119, Windows 11)

  1. Have Claude Code read any file that contains a base64 blob (certificate, embedded image, test fixture, etc.).
  2. On response, Claude Code surfaces:
    API Error: Claude Code is unable to respond to this request, which appears
    to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please
    double press esc to edit your last message or start a new session for
    Claude Code to assist with a different task. If you are seeing this refusal
    repeatedly, try running /model claude-sonnet-4-20250514 to switch models.

Switching to Sonnet 4 with /model works around the issue, confirming the refusal is specific to Opus 4.7's safety layer.

Expected

The model should decode/inspect the base64 content and evaluate the decoded payload against policy — not flag every base64 string as categorically unsafe. A base64 string of selam herkes is harmless.

Actual

Any message containing base64-looking text trips the Opus 4.7 safety filter, even when the decoded content is trivially benign.

Environment

  • Claude Code: 2.1.119
  • OS: Windows 11 Pro 10.0.26200
  • Model: claude-opus-4-7 (1M context)
  • Also reproduces on claude.ai web Incognito chat (same model)

Related

  • #52086 — general Opus 4.7 false-positive AUP refusals
  • #51248 — RFC for contextual Usage Policy error reporting

extent analysis

TL;DR

Switching to a different model, such as Sonnet 4, may temporarily workaround the issue with Opus 4.7's safety filter incorrectly flagging base64-encoded text.

Guidance

  • The issue seems to be specific to Opus 4.7's safety layer, as switching to Sonnet 4 resolves the problem.
  • To verify if the issue is indeed with the model's safety filter, try decoding the base64 content before passing it to the model.
  • Consider reporting this as a false-positive to improve the model's Usage Policy error reporting, as suggested in related issue #51248.
  • If the issue persists, try updating Claude Code to the latest version, although the problem seems model-specific rather than version-related.

Example

No code snippet is provided as the issue seems to be related to the model's behavior rather than a specific code implementation.

Notes

The workaround of switching models may not be ideal for all use cases, especially if Opus 4.7's capabilities are required. The root cause appears to be the model's safety filter, which incorrectly identifies base64-encoded text as a violation of the Usage Policy.

Recommendation

Apply the workaround by switching to a different model, such as Sonnet 4, until the issue with Opus 4.7's safety filter is resolved, as it allows for continued use of Claude Code with minimal disruption.

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 [BUG] Opus 4.7 safety filter produces false-positive refusals on encoded input [2 comments, 2 participants]