TellWell
← Back to feed
Publications3h ago88% confidenceConfidence 88% — the share of independent, credible sources corroborating the core facts.

Researchers Discover Grammar-Constrained Decoding Can Be Exploited to Jailbreak LLMs into Generating Malicious Code

Center 100%
1 source

Researchers at arXiv have identified a new vulnerability called CodeSpear that exploits Grammar-Constrained Decoding (GCD)—a technique meant to improve code safety—to trick large language models into generating malicious code. GCD is widely used to enforce syntactic validity in LLM-generated code, but the study shows this reliability mechanism can be weaponized as an attack surface. The findings highlight a critical security gap in current LLM safeguards and propose CodeShield, a defensive approach that generates harmless honeypot code to maintain safety under adversarial grammar constraints.

Researchers have uncovered a counterintuitive security vulnerability in Grammar-Constrained Decoding (GCD), a technique widely adopted to improve the reliability of code generated by large language models. The new attack, termed CodeSpear, exploits GCD to induce LLMs into producing malicious code by applying benign code grammar constraints. Experiments across 10 popular LLMs and 4 benchmarks demonstrate that CodeSpear increases attack success rates by more than 30 percentage points compared to existing jailbreak methods. To address this vulnerability, the researchers propose CodeShield, a safety alignment approach that teaches models to generate semantically harmless but structurally diverse honeypot code under GCD, while preserving natural-language refusals when applicable. The findings reveal a fundamental risk in GCD implementation and underscore the need for greater attention to security implications of reliability-oriented techniques in LLM code generation.

What's missing

The study does not discuss potential real-world deployment timelines for CodeShield or whether major LLM providers have been notified of this vulnerability prior to publication. Additionally, the paper does not address whether existing code generation safeguards in production systems are susceptible to CodeSpear or provide guidance for practitioners on immediate mitigation strategies.

What different sources said

  • Grammar-Constrained Decoding Can Jailbreak LLMs into Generating Malicious Code

Related

PublicationsConfidence 82% — the share of independent, credible sources corroborating the core facts.

Genetic Drift, Not Selection, Drives Rapid Feather Color Evolution in Island Bird Radiation

A new study of an island bird radiation found that rapid evolution of feather coloration is driven primarily by genetic drift in small populations rather than sexual or ecological selection. The research integrated whole-genome data with detailed plumage measurements across complete species sampling to test whether signaling trait evolution correlates with speciation rates. The findings suggest that neutral demographic processes play a central role in generating phenotypic diversity during island radiations, challenging assumptions about the mechanisms driving rapid evolution.

1 source9m ago
PublicationsConfidence 82% — the share of independent, credible sources corroborating the core facts.

New AI Model Improves Prediction of Therapeutic Peptide Function from Protein Sequences

Researchers developed a lightweight CNN classifier that predicts whether peptide sequences have therapeutic properties, trained on a database of 54,655 peptides across 48 functional categories. The model uses a novel negative sampling strategy to reduce false positive rates from over 60% in previous approaches to 2.1%. This advancement could accelerate drug discovery by enabling faster computational screening of peptide candidates before expensive experimental testing.

1 source17m ago
PublicationsConfidence 82% — the share of independent, credible sources corroborating the core facts.

Study Shows Different Metabolic Stress Models Produce Distinct Effects on Human Neuronal Networks

Researchers tested three common in vitro metabolic stress models on human-derived neuronal networks and found each produced different patterns of neuronal activity and cell damage. The models tested were hypoxia alone, oxygen-glucose deprivation (OGD), and hypoxia combined with glutamate exposure. The findings suggest that choice of experimental model significantly affects results and that combining electrophysiological and structural analyses is important for accurately assessing metabolic stress in stroke research.

1 source17m ago