Research · October 1, 2026
CodeMimicry: Exploiting Safety Generalization Lag in Large Language Models via Structured Code Completion
Reported by arXiv cs.AI + cs.CL
In short
Researchers introduce CodeMimicry, an automated black-box jailbreak framework that exploits a "safety generalization lag" in LLMs, where safety training on natural language fails to carry over to code. By wrapping malicious intent in structured, object-oriented code prompts, the method achieves a 96.25% attack success rate across 8 commercial LLMs in under two queries on average.
Why it matters
This exposes a systemic blind spot in current LLM safety alignment, showing that code-domain inputs can reliably bypass guardrails that work well in natural language contexts.
Terms used in this story
Read the original reporting
arXiv cs.AI + cs.CL (opens in a new tab)AI Download summarizes and links to the news. We do not republish full articles.