Security Implications of Large Language Model Code Assistants: A User Study
TL;DR Highlight
Using AI code assistants like GitHub Copilot causes developers to write more security-vulnerable code.
Who Should Read
Engineering managers and security teams considering or already using AI coding assistants in their development workflow.
Core Mechanics
- Controlled study: developers using GitHub Copilot produced code with significantly more security vulnerabilities than those without
- Participants using Copilot were also more likely to rate their insecure code as secure — overconfidence effect
- Vulnerabilities span common categories: SQL injection, XSS, insecure deserialization, hardcoded secrets
- Effect persisted even among experienced developers, not just juniors
- The speed gains from Copilot may be offset by increased security review burden
Evidence
- Randomized controlled experiment with developers assigned to Copilot vs. no-AI condition
- Security audits of produced code by independent security researchers
- Statistically significant difference in vulnerability rates (p < 0.05) between conditions
How to Apply
- Treat AI-generated code as untrusted and route all suggestions through your existing security review pipeline.
- Add automated SAST (Static Application Security Testing) as a CI gate specifically for AI-assisted code changes.
- Train developers to be skeptical of AI suggestions in security-sensitive code paths (auth, input handling, cryptography).
Try It
# Security-enhanced prompt examples when using AI code assistants
# ❌ Vulnerable prompt (requesting functionality only)
'''
Write a function that retrieves user info from the DB using a user ID
'''
# ✅ Security-conscious prompt
'''
Write a Python function that retrieves user info from the DB using a user ID.
Make sure to include:
- Parameter binding to prevent SQL injection (absolutely no string formatting)
- Input value type and range validation
- Safe exception handling that does not expose internal information on DB errors
- Remove sensitive fields (e.g., password_hash) before returning
'''
# Example of adding Bandit SAST to CI/CD (GitHub Actions)
# .github/workflows/security.yml
'''
steps:
- name: Run Bandit Security Scan
run: |
pip install bandit
bandit -r ./src -ll -ii -f json -o bandit-report.json
- name: Upload Security Report
uses: actions/upload-artifact@v3
with:
name: bandit-security-report
path: bandit-report.json
'''Terminology
Related Papers
Gemini 4 Neon is the new #1 on the Models Engineering Index
Gemini 4 Neon ranks first on the Models Engineering Index with 68.0, combining multiple benchmarks.
LLMs can read and write executables byte by byte from a hex dump
Given only a hex dump and no tools, an LLM analyzed, patched and wrote working executables.
Claude was trained on protein sequences at scale
Next-amino-acid tests on obscure proteins show only the latest Claude models predict them
Remembered as Brief: Stored Preferences SilentlyRemove Decision-Critical Information
A stored 'keep it short' preference silently drops warnings; listing must-know points first restores content.
All AI-generated code should be Open Source
A blog argues AI-generated code should be open source; most HN commenters disagreed.
What thousands of conversations look like inside a language model
Mapping Qwen3-1.7B states showed Chinese sitting apart from English, while German and Croatian overlapped it.
AI, activity, and outcomes in software engineering
AI sped up writing code, but shipping speed did not rise as much, says a talk
LLMs Play Zachtronics' TIS-100
16 LLMs played TIS-100 and set 133 new Pareto frontier points across 18 puzzles