atlas

Research map / Large language models / Language, safety and interpretability

CodeMimicry: Exploiting Safety Generalization Lag in Large Language Models via Structured Code Completion

NeurIPS 2026 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes CodeMimicry, a black-box jailbreak that wraps harmful requests in object-oriented code stubs for completion, refined over up to 5 feedback turns, reaching 96.25% ASR on AdvBench across 8 commercial/open LLMs.

Problem

Safety alignment trained mostly on natural language may not transfer to the code domain, leaving black-box LLMs vulnerable to jailbreaks that hide malicious intent in code completion requests.

Approach

Decompose a harmful query into a class/method stub with docstrings and comments describing the harmful functionality, wrap it in a benign code-completion trigger, and iteratively refine it using an attacker LLM and an LLM judge's feedback history; the paper also analyzes refusal-direction projections and activation steering in latent space.

Key results

Surprising findings

Limitations

Experimental setup

Datasets: AdvBench HarmBench

Benchmarks: AdvBench HarmBench

Metrics: attack success rate average queries syntax correctness rate runtime success rate functional validity rate

Baselines: CipherChat ReNeLLM CodeAttack FlipAttack EquaCode CodeChameleon PAIR DRA GPTfuzzer AutoDan-Turbo

Builds on: PAIR CodeChameleon CodeAttack Circuit Breaker

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy