atlas

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

Security Attacks on LLM-based Code Completion Tools

AAAI 2025 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 12 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 jailbreaking and training-data-extraction attacks that exploit the workflow of LLM-based code completion tools (LCCTs) such as GitHub Copilot and Amazon Q, embedding harmful queries in filenames, cross-file calls, and code variables.

Problem

LLM-based code completion tools integrate multiple context sources, prioritize code over natural language, and rely on proprietary code training data, creating security risks (jailbreaking and training data extraction) that prior work on LCCTs (focused on code security and copyright) has overlooked.

Approach

Tailor jailbreak prompts to LCCT workflows: hide harmful queries in filenames (Filename Proxy), split across files (Cross-File), and in code variables/comments (Hierarchical Code Exploitation with Guided Trigger and Code Embedded levels), plus a code-driven attack that first leaks GitHub usernames via a URL prefix and then extracts emails and locations.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use a filename proxy attackGitHub Copilot · Jailbreaking ASR micro-benchmarkASR: 72.5%Helped
Use a cross-file attackGitHub Copilot · Jailbreaking ASR micro-benchmarkASR: 52.3%Helped
Use a Level 1 guided trigger attackGitHub Copilot · Jailbreaking ASR micro-benchmarkASR: 99.4%Helped
Use a Level 1 guided trigger attackAmazon Q · Jailbreaking ASR micro-benchmarkASR: 46.3%Helped
Add guiding words to the Level 1 attack (ablation)GitHub Copilot · Level 1 jailbreakingASR: 7.50% (-91.9%)Helped
Add guiding words to the Level 1 attack (ablation)Amazon Q · Level 1 jailbreakingASR: 5.00% (-41.3%)Helped
Embed sensitive words within a long sentence in the Level 2 attack (ablation)GitHub Copilot · Level 2 jailbreakingASR: 28.8% (-12.5%)Hurt
Embed sensitive words within a long sentence in the Level 2 attack (ablation)Amazon Q · Level 2 jailbreakingASR: 15.0% (-7.3%)Hurt
Embed sensitive words within a long sentence in the Level 2 attack (ablation)GPT-3.5 · Level 2 jailbreakingASR: 17.5% (-16.3%)Hurt
Embed sensitive words within a long sentence in the Level 2 attack (ablation)GPT-4 · Level 2 jailbreakingASR: 15.0% (-1.3%)Hurt
Embed sensitive words within a long sentence in the Level 2 attack (ablation)GPT-4o · Level 2 jailbreakingASR: 40.0% (-1.3%)Hurt
Use Go instead of Python (ablation)Level 1 and Level 2 attacks on GitHub Copilot and Amazon Q · JailbreakingASR: 98.8% (-0.6%); 71.3% (+25.0%); 50.6% (+9.3%); 31.9% (+ 9.6%)Mixed

Surprising findings

Limitations

Experimental setup

Datasets: OpenAI user policy-violating queries generated by GPT-4 (80 queries across 4 categories) GitHub REST API user data for evaluation

Benchmarks: Custom jailbreak micro-benchmark (80 queries, 4 categories) GitHub REST API user data for privacy extraction

Metrics: Attack Success Rate (ASR) exact matching rate fuzzy matching rate

Baselines: DAN CodeAttack

Builds on: DAN CodeAttack Jailbroken

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