Abstract

In 2021, Pearce et al. found that about 40% of the programs GitHub Copilot wrote for security-relevant coding tasks contained a known weakness. AI coding assistants have changed a great deal since then, and many students and developers now run open-weight models on their own computers. This paper repeats the 2021 experiment with eight current models: six open-weight models run locally (qwen3-coder 30B, Llama 3.1 8B, Devstral Small 2, DeepSeek-Coder-V2 16B, Gemma 4 31B and gpt-oss 20B) and two models reached through free APIs (Gemini 3.5 Flash-Lite and gpt-oss 120B). Each model completed the 57 original C and Python scenarios that the static analyzer CodeQL can evaluate automatically, ten times each, giving 4,523 valid programs. The original 1,224 Copilot programs were re-evaluated the same way for a fair baseline. Current models produced vulnerable code 11.8% to 18.6% of the time, compared with 38.6% for Copilot. The improvement was large for Python (3.8% to 8.8% vs. 35.6%) and small for C (20.6% to 39.1% vs. 43.2%). SQL injection, the best-known example from the 2021 study, was almost never reproduced. Re-evaluating everything with the CodeQL version used in 2021 (2.5.7) moved each total by only 1 to 3 percentage points. A test with disguised versions of six prompts found no significant change (22.3% vs. 25.7%, p = .54), suggesting that memorized prompts do not explain the improvement. AI code is much safer than in 2021, but memory-safety weaknesses in C remain common, so generated code still needs review.

Faculty Advisor/Mentor

Adwait Nadkarni

Document Type

Paper

Disciplines

Artificial Intelligence and Robotics | Cybersecurity | Information Security | Programming Languages and Compilers

DOI

10.25776/10w0-zv14

Publication Date

11-30-2026

Upload File

wf_yes

Share

COinS
 

Still Asleep at the Keyboard?

In 2021, Pearce et al. found that about 40% of the programs GitHub Copilot wrote for security-relevant coding tasks contained a known weakness. AI coding assistants have changed a great deal since then, and many students and developers now run open-weight models on their own computers. This paper repeats the 2021 experiment with eight current models: six open-weight models run locally (qwen3-coder 30B, Llama 3.1 8B, Devstral Small 2, DeepSeek-Coder-V2 16B, Gemma 4 31B and gpt-oss 20B) and two models reached through free APIs (Gemini 3.5 Flash-Lite and gpt-oss 120B). Each model completed the 57 original C and Python scenarios that the static analyzer CodeQL can evaluate automatically, ten times each, giving 4,523 valid programs. The original 1,224 Copilot programs were re-evaluated the same way for a fair baseline. Current models produced vulnerable code 11.8% to 18.6% of the time, compared with 38.6% for Copilot. The improvement was large for Python (3.8% to 8.8% vs. 35.6%) and small for C (20.6% to 39.1% vs. 43.2%). SQL injection, the best-known example from the 2021 study, was almost never reproduced. Re-evaluating everything with the CodeQL version used in 2021 (2.5.7) moved each total by only 1 to 3 percentage points. A test with disguised versions of six prompts found no significant change (22.3% vs. 25.7%, p = .54), suggesting that memorized prompts do not explain the improvement. AI code is much safer than in 2021, but memory-safety weaknesses in C remain common, so generated code still needs review.