claude-code - 💡(How to fix) Fix False-positive Usage Policy refusal on Russian text typed in QWERTY layout [1 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#53367Fetched 2026-04-26 05:17:36
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Claude Code returns API Error: ...appears to violate our Usage Policy for benign Russian-language messages that were accidentally typed with the English (QWERTY) keyboard layout active. The resulting Latin gibberish (e.g. ghbdtn rfr ltkf) is flagged by the safety classifier as suspicious / obfuscated content.

Related: #50214 (also a Russian-language UX gap reported by the same user).

Error Message

API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy. Try rephrasing the request or attempting a different approach.

Root Cause

Impact

This is a recurring frustration for Russian-speaking users, and likely affects users of other Cyrillic / non-Latin keyboard layouts (Ukrainian, Bulgarian, Greek, ...). The refusal is opaque, the suggested workaround (/model claude-sonnet-4-20250514) does not address the root cause, and the user has done nothing wrong.

Fix Action

Fix / Workaround

Impact

This is a recurring frustration for Russian-speaking users, and likely affects users of other Cyrillic / non-Latin keyboard layouts (Ukrainian, Bulgarian, Greek, ...). The refusal is opaque, the suggested workaround (/model claude-sonnet-4-20250514) does not address the root cause, and the user has done nothing wrong.

Code Example

API Error: Claude Code is unable to respond to this request, which appears
to violate our Usage Policy. Try rephrasing the request or attempting a
different approach.
RAW_BUFFERClick to expand / collapse

Summary

Claude Code returns API Error: ...appears to violate our Usage Policy for benign Russian-language messages that were accidentally typed with the English (QWERTY) keyboard layout active. The resulting Latin gibberish (e.g. ghbdtn rfr ltkf) is flagged by the safety classifier as suspicious / obfuscated content.

Related: #50214 (also a Russian-language UX gap reported by the same user).

Reproduction

  1. Switch OS keyboard layout to English (US/QWERTY).
  2. Type a normal Russian sentence as if the layout were Russian (ЙЦУКЕН), e.g. gjxtve rjulf z gbie gj heccrb d fyukbqcrjq hfcrkflrt vtyz ,kjxfn.
    • Decoded back to Cyrillic: почему когда я пишу по русски в английской раскладке меня блочат.
  3. Send to Claude Code.

Expected

Either a normal response, a hint to switch layout, or a clarifying question.

Actual

API Error: Claude Code is unable to respond to this request, which appears
to violate our Usage Policy. Try rephrasing the request or attempting a
different approach.

(Screenshot of the actual error in Claude Code TUI can be attached in a comment.)

Why this is a false positive

The string is a deterministic 1:1 character mapping from a Cyrillic keyboard onto Latin keys. It is trivially detectable:

  • Bigram frequency: gh, rj, cn, ds, tk are extremely common in QWERTY-typed Russian and rare in English.
  • Reverse-mapping QWERTY -> ЙЦУКЕН and running a Cyrillic language-ID classifier on the result yields high-confidence Russian.
  • Tools like Punto Switcher have done exactly this client-side for 20+ years.

Impact

This is a recurring frustration for Russian-speaking users, and likely affects users of other Cyrillic / non-Latin keyboard layouts (Ukrainian, Bulgarian, Greek, ...). The refusal is opaque, the suggested workaround (/model claude-sonnet-4-20250514) does not address the root cause, and the user has done nothing wrong.

Suggested fix

Before sending text to the policy classifier, run a cheap layout-mismatch heuristic: if the input has high entropy as English but decodes to a coherent non-English language under a known keyboard remapping, then either auto-decode it, pass it through with a layout hint, or prompt the user to confirm. False positives here have a real UX cost for non-English users.

Environment

  • Claude Code (latest)
  • Windows 11
  • Reported by a Russian-speaking user; pattern applies to any Cyrillic / QWERTY mix-up.

extent analysis

TL;DR

Implement a layout-mismatch heuristic to detect and handle cases where users type in a non-English language with the wrong keyboard layout.

Guidance

  • Develop a cheap layout-mismatch heuristic to analyze input text for high entropy as English but coherence in a non-English language under a known keyboard remapping.
  • Consider using bigram frequency analysis and reverse-mapping QWERTY to ЙЦУКЕН to detect potential layout mismatches.
  • If a layout mismatch is detected, either auto-decode the input, pass it through with a layout hint, or prompt the user to confirm their intended language.
  • Test this heuristic with various Cyrillic and non-Latin keyboard layouts to ensure its effectiveness.

Example

No code snippet is provided as the issue does not imply a specific implementation, but the suggested fix involves integrating a layout-mismatch detection algorithm into the existing policy classifier.

Notes

The proposed solution relies on the assumption that the layout-mismatch heuristic can be accurately implemented and integrated into the existing system without introducing significant performance overhead or false negatives.

Recommendation

Apply a workaround by implementing the suggested layout-mismatch heuristic to mitigate the false positive issue and improve the user experience for non-English users. This approach addresses the root cause of the problem and provides a more robust solution than the currently suggested workaround.

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 False-positive Usage Policy refusal on Russian text typed in QWERTY layout [1 participants]