Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions
The DOI matches its Crossref record; 26 of the 31 references it cites were found in a registry or an index.
Abstract
There is burgeoning interest in designing AI-based systems to assist humans in designing computing systems, including tools that automatically generate computer code. The most notable of these comes in the form of the first self-described ‘AI pair programmer’, GitHub Copilot, which is a language model trained over open-source GitHub code. However, code often contains bugs—and so, given the vast quantity of unvetted code that Copilot has processed, it is certain that the language model will have learned from exploitable, buggy code. This raises concerns on the security of Copilot’s code contributions. In this work, we systematically investigate the prevalence and conditions that can cause GitHub Copilot to recommend insecure code. To perform this analysis we prompt Copilot to generate code in scenarios relevant to high-risk cybersecurity weaknesses, e.g. those from MITRE’s “Top 25” Common Weakness Enumeration (CWE) list. We explore Copilot’s performance on three distinct code generation axes—examining how it performs given diversity of weaknesses, diversity of prompts, and diversity of domains. In total, we produce 89 different scenarios for Copilot to complete, producing 1,689 programs. Of these, we found approximately 40% to be vulnerable.
Overview
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
In the citing paper
“To this end, security vulnerabilities and possible overreliance issues [2,25,26], are important areas of research that we do not address in this paper.”
From Reading Between the Lines: Modeling User Behavior and Costs in AI-Assisted Programming (2024) · cites this paper as [25]
In the citing paper
“Unfortunately, such assistants have also been found to produce insecure code in lab environments, raising significant concerns about their usage in practice.”
From Do Users Write More Insecure Code with AI Assistants? (2023) · cites this paper as [17]
In the citing paper
“While recent work has demonstrated that such tools may erroneously produce security mistakes [17], no study has extensively measured the security risks of AI assistants in the context of how developers choose to use them.”
From Do Users Write More Insecure Code with AI Assistants? (2023) · cites this paper as [17]
In the citing paper
“In addition, it has been shown that AI generated code can sometimes contain security vulnerabilities, which may mislead learners into adopting bad coding habits [65].”
From “It’s Weird That it Knows What I Want”: Usability and Interactions with Copilot for Novice Programmers (2024) · cites this paper as [65]
In the citing paper
“They found that as measured by the GitHub CodeQL [25] static analysis tool, 40 % of the suggestions in relevant contexts contain security-related bugs”
From Lost at C: A User Study on the Security Implications of Large Language Model Code Assistants (2022) · cites this paper as [8]
16 more claims about this paper
Create a free account to see every claim other papers make about this one.
Citations
Cites
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., & Polosukhin, I. (2017) · arXiv · doi:10.48550/arxiv.1706.03762 · Cited by 120,404
Exploiting Generative AI to Scale up Intelligent Tutoring Systems
Jakubův, J., Chvalovský, K., Goertzel, Z., Kaliszyk, C., Olšák, M., Piotrowski, B., Schulz, S., Suda, M., & Urban, J. (2023) · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · doi:10.4230/lipics.itp.2023.19 · Cited by 76,658
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018) · arXiv · doi:10.48550/arxiv.1810.04805 · Cited by 73,173
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1423 · Cited by 54,325
Language Models are Few-Shot Learners
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020) · arXiv · doi:10.48550/arxiv.2005.14165 · Cited by 23,372
Kaugeranna, R., Kaugeranna, E., & Aion, (. S. 4. 6. (2023) · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · doi:10.4230/lipics.giscience.2023.43 · Cited by 13,690
LSTM neural networks for language modeling
Sundermeyer, M., Schlüter, R., & Ney, H. (2012) · Interspeech 2012 · doi:10.21437/interspeech.2012-65 · Cited by 1,963
Evaluating Large Language Models Trained on Code
Chen, M., Tworek, J., Jun, H., Yuan, Q., Pinto, H. P. D. O., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., et al. (2021) · arXiv · doi:10.48550/arxiv.2107.03374 · Cited by 1,436
CoQA: A Conversational Question Answering Challenge
Reddy, S., Chen, D., & Manning, C. D. (2019) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00266 · Cited by 975
Recurrent Neural Network for Text Classification with Multi-Task Learning
Liu, P., Qiu, X., & Huang, X. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1605.05101 · Cited by 972
Cited by
Items 401–470 of 470
Cybersecurity RAG: Retrieval-Augmented Generation with Custom Faithfulness Metrics
Hukuimwe, T., Mambosasa, T., Muwirimi, M., Upadhyay, H., & Mitra, R. (2026) · Communications in computer and information science · doi:10.1007/978-3-032-29003-8_11
Evaluating LLMs for Explaining Insecure Code and Identifying Vulnerabilities in Java and Python
Mahmud, A., Rawajfih, Y., & Wu, F. (2026) · Communications in computer and information science · doi:10.1007/978-3-032-22211-4_12
Aydın, D., & Bahtıyar, Ş. (2026) · SSRN Electronic Journal · doi:10.2139/ssrn.6968361
Yeşilyayla, H. (2026) · Journal of Business Innovation and Governance · doi:10.54472/jobig.1921341
Secure-Instruct: Prompt, Synthesize, and Fine-Tune for Secure Code Generation
Li, J., Rabbi, F., Yang, B., Wang, S., & Yang, J. (2026) · International Conference on Predictive Models in Software Engineering · doi:10.1145/3803846.3807466 · Cited by 2
DualCodeDetect: Zero-Shot LLM-Generated Code Detection via Dual-Channel Perturbation
Li, Z., Shang, X., Fu, Z., Guo, S., Zhang, W., Yu, N., & Chen, K. (2026) · Proceedings of the ACM on software engineering. · doi:10.1145/3808166 · Cited by 1
The transformative potential of AI in software engineering: a case study on LeetCode and ChatGPT
Merkel, M., & Dörpinghaus, J. (2026) · Empirical Software Engineering · doi:10.1007/s10664-026-10912-5 · Cited by 7
Can LLMs Keep Up with Library Changes? An Exploratory Study on LLM-Generated Code
Lin, X., Liu, J., & Bao, L. (2026) · IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) · doi:10.1109/saner67736.2026.00088
Programming Language Confusion: When Code LLMs Can't Keep Their Languages Straight
Moumoula, M. B., Nikiema, S. L., Kaboré, A. K., Klein, J., & Bissyandé, T. F. (2026) · IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) · doi:10.1109/saner67736.2026.00087 · Cited by 7
Quality and Security Signals in AI-Generated Python Refactoring Pull Requests
Almukhtar, M., Ghammam, A., & Ming, H. (2026) · ACM International Conference on AI-Powered Software (AIware) · doi:10.1145/3805760.3814886
Evaluating Large Language Models for C/C++ Software Composition Analysis
Ai, Y., Zhao, Y., Cheng, Y., & Liu, Q. (2026) · International Conference on Computer Supported Cooperative Work in Design (CSCWD) · doi:10.1109/cscwd68734.2026.11581685
A Workflow Framework for GenAI-Assisted Software Development
Adams, V., Morsi, R. M. B. E., & Abdulgader, M. M. (2026) · International Conference on Machine Intelligence and Smart Innovation (ICMISI) · doi:10.1109/icmisi69868.2026.11583992
Polyglot but Perilous: A Multi-Model, Multi-Language Audit of LLM-Generated Code
Mastropaolo, A., & Afrin, S. (2026) · Computer · doi:10.1109/mc.2026.3696004
Bukenbayev, N., Sembayev, N., Seralinov, A., Omirgaliyev, R., & Zhussipkaliyeva, S. (2026) · IEEE International Conference on Smart Information Systems and Technologies (SIST) · doi:10.1109/sist61674.2026.11596372
Do Language Models Prefer Vulnerable Code? A Probabilistic Study of Insecure Code Preference
Melo, R., Reis, S., Catarino, A., & Abreu, R. (2026) · IEEE International Conference on Software Testing, Verification and Validation (ICST) · doi:10.1109/icst69053.2026.00075 · Cited by 2
Meryem, G., AATIF, Y., & Abdelkamel, A. (2026) · Frontiers in Artificial Intelligence · doi:10.3389/frai.2026.1861067
Ahmed, S., Rahman, S., Ifa, K. T. F., & Chowdhury, P. (2026) · IEEE International Conference on Software Testing, Verification and Validation Workshops (ICSTW) · doi:10.1109/icstw72326.2026.00026
BenchGuard: A Two-Layer Framework for Contamination-Aware Evaluation of LLM Vulnerability Detection
Mahmud, A., Rawajfih, Y., Arnold, R. D., & Shahriar, H. (2026) · Lecture notes in computer science · doi:10.1007/978-3-032-33260-8_22
Research on Security Vulnerability Patterns of Code Generated by Large Language Models
Wang, J., Zhou, Y., Guo, D., Jia, X., Li, S. Y., Xu, D., & Zhang, H. (2026) · IEEE International Conference on Electronics, Communications and Intelligent Science (ECIS) · doi:10.1109/ecis69634.2026.11604380
The Transformative Impact of AI on Code Generation and Autocompletion
Sheikh, N., Dagadkar, S. N., Jikar, A. A., et al. (2026) · doi:10.1109/icitsif69060.2026.11608854
Evaluating Large Language Models for Symbolic Security Protocol Analysis
Modesti, P., Ahmed, S., Sfyrakis, I., & Enodolomwanyi, D. (2026) · Electronics · doi:10.3390/electronics15184141
The Division of Verification: Contractibility, Specialization, and the Limits of Delegation to AIPreprint
Zhang, H. (2026) · SSRN Electronic Journal · doi:10.2139/ssrn.7086002
Gardella, N., Bolton, M. L., & Riggs, S. L. (2026) · Human Factors The Journal of the Human Factors and Ergonomics Society · doi:10.1177/00187208261467254 · Cited by 2
Wendlinger, M., Kowatsch, D., Böttinger, K., & Sperl, P. (2026) · IEEE European Symposium on Security and Privacy · doi:10.1109/eurosp68448.2026.00049 · Cited by 3
Elserwy, T. B., & El-Demerdash, B. E. (2026) · Egyptian Informatics Journal · doi:10.1016/j.eij.2026.101029
Kim, D. K., Lee, Y.-W., & Jeong, J.-S. (2026) · Applied Sciences · doi:10.3390/app16157733
From Command to Conversation: Integrating Agentic AI Into Command-Line Interfaces
Shrivastava, M. (2026) · Computer · doi:10.1109/mc.2026.3673219
Vargas, F. L. S., Mansilha, R. B., & Kreutz, D. (2026) · Anais do I Simpósio de Infraestrutura Digital/Nuvem para Pesquisa (Pesquisa@Nuvem 2026) · doi:10.5753/pesquisanuvem.2026.23954 · Cited by 2
Does ChatGPT Consistently Return Secure Cryptographic API Code?
Le, T., Liu, G., & Yue, C. (2026) · Lecture notes in computer science · doi:10.1007/978-981-95-4677-0_12
A Four-Axis Systematization of AI and Cybersecurity in the Era of Large Language Models
Farin, M. A., & Thuraisingham, B. M. (2026) · IEEE Conference on Big Data Security on Cloud (BigDataSecurity) · doi:10.1109/bigdatasecurity69476.2026.00009
Geinitz, S., Rajan, R., Peprah, K., Schmidt, K. C. S., Singh, S., & Jay, S. M. (2026) · Lecture notes in networks and systems · doi:10.1007/978-3-032-25387-3_1
Lightweight Skill-Based LLM Workflows for Vulnerability Identification and Classification
Rashidi, P., Anoruo, D., Dhital, D., Deng, L., & Yu, W. (2026) · IEEE/ACIS International Conference on Software Engineering Research, Management and Applications (SERA) · doi:10.1109/sera69989.2026.11655058
RL–LLMfuzzer: reinforcement learning–guided dual–model differential fuzzing for compiler testing
Li, D., Li, Y., Zhao, B., Xu, J., Yao, J., Wang, N., & Liu, L. (2026) · Journal of King Saud University - Computer and Information Sciences · doi:10.1007/s44443-026-01115-5
A Neuro-Symbolic framework for trustworthy agentic AI in industrial code review
Park, J., & Kim, Y. G. (2026) · Information and Software Technology · doi:10.1016/j.infsof.2026.108293
Mahmud, A., Rawajfih, Y., Arnold, R. D., & Shahriar, H. (2026) · IEEE Annual International Computer Software and Applications Conference (COMPSAC) · doi:10.1109/compsac69091.2026.00479
Forensic Attribution and Targeted Regression Detection for AI-Generated Security Patches
Rawajfih, Y., Mahmud, A., Arnold, R. D., & Shahriar, H. (2026) · IEEE Annual International Computer Software and Applications Conference (COMPSAC) · doi:10.1109/compsac69091.2026.00435
Du, F., Sato, H., Jiang, Z., Liu, L., Hong, Y., Bai, Y., & Fan, W. (2026) · IEEE Annual International Computer Software and Applications Conference (COMPSAC) · doi:10.1109/compsac69091.2026.00095
RLAgent-GSSTI: Automated Grey-Box SSTI Vulnerability Detection Based on Reinforcement Learning Agent
Ma, W., Li, T., Fang, W., Li, W., Yang, G., Li, T., & He, J. (2026) · IEEE Transactions on Information Forensics and Security · doi:10.1109/tifs.2026.3725559
Ríos, H. R. D., Cabascango, P. M. P., & Guaña, C. E. S. (2026) · Revista Ingeniería e Innovación del Futuro. · doi:10.62465/riif.v5n2.2026.252
Beyond Bypass: Measuring Vulnerability Regression in LLM-Generated Security Patches
Rawajfih, Y., Mahmud, A., & Arnold, R. D. (2026) · IEEE International Conference on Artificial Intelligence Testing (AITest) · doi:10.1109/aitest70988.2026.00029
Software Engineering Reliability in the Era of Generic and Agentic AI
Nwodo, K., & Stavrou, A. (2026) · Studies in computational intelligence · doi:10.1007/978-3-032-18585-3_9
AI-Enhanced Static Code Analyzer for Secure Coding Support
Jie, H. J., Mansor, M., & Singh, R. (2026) · Malaysian Journal of Science and Advanced Technology · doi:10.56532/mjsat.v6i3.729
Sistemski napadi na programske dobavne verige v dobi umetne inteligence
Jošt, G., & Taneski, V. (2026) · OTS Sodobne informacijske tehnologije in storitve (OTS) · doi:10.18690/um.feri.7.2026.11
Mammadov, T., Smytzek, M., Stutz, M., Feid, N., & Zeller, A. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3845620
Zaa, J. (2026) · IEEE International Conference on Electro Information Technology · doi:10.1109/eit68936.2026.11670371 · Cited by 1
Modeling Humans and Agents in Cyber Security
Reith, M. G. (2026) · IEEE National Aerospace and Electronics Conference (NAECON) · doi:10.1109/naecon70028.2026.11674930
Output Code Safety Verification Framework for Secure Generative AI-Based Code Development
Seo, H., & Seok, B. (2026) · Journal of Digital Contents Society · doi:10.9728/dcs.2026.27.8.2399
LLM Risk in Legal Metrology: Threats, Gaps, and Controls
Peters, D., Moni, M., Ghimiși, Ș., Sikora, A., & Thiel, F. (2026) · Lecture notes in networks and systems · doi:10.1007/978-3-032-32732-1_25
Hunk-Constrained DPO: Segment-Level Optimization for Secure and Correct LLM Code Generation
Huang, Q., Yin, X., Li, X., & Ni, C. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3816250
Data-Driven Hierarchical Automation Gating for LLM-Based Coding Workflows
Chen, Z., Sun, P., Ao, P., Wang, J., Liu, K., & Wang, H. (2026) · International Conference on Big Data and Information Analytics (BigDIA) · doi:10.1109/bigdia71496.2026.11684687
TrustGuard: Enforcing Trust in AI-Generated Software Supply Chains
Jindal, V. (2026) · IEEE International Conference on Intelligence and Security Informatics (ISI) · doi:10.1109/isi69914.2026.11685843
Jain, S., Purohit, P. K., Somani, V., Suwalka, A. K., Singh, N., & Kumar, A. (2026) · International Conference Computational Vision and Bio Inspired Computing · doi:10.1109/iccvbic71195.2026.11688826
Detecting LLM-Generated Source Code via Robust WatermarkingPreprint
Capuano, N., Capuano, N., & Zottarelli, E. (2026) · SSRN Electronic Journal · doi:10.2139/ssrn.7493625
Comparative Analysis of Rewriting-Based Large Language Model-Generated Synthetic Code Detection
Alambana, M. A., & Nurwidyantoro, A. (2026) · IEEE International Conference on Artificial Intelligence Implementation & Applications (ICAIIA) · doi:10.1109/icaiia70172.2026.11691940
CppUp-AI: Validated LLM-Assisted Migration of Legacy C++ Code to Newer Language StandardsPreprint
Świniarski, A., & Derezińska, A. (2026) · SSRN Electronic Journal · doi:10.2139/ssrn.7506902
Đambić, G., Maurovic, A., Biškupić, I. O., & Radovan, A. (2026) · Information · doi:10.3390/info17090918
Vangala, B. P., Gehani, A., & Malik, T. (2026) · ACM Conference on Reproducibility and Replicability (ACM REP) · doi:10.1145/3820002.3828581 · Cited by 1
Toward Agentic Runtime Healing
Sun, Z., Zhu, H., Xu, B., Du, X., Li, L., & Lo, D. (2026) · Communications of the ACM · doi:10.1145/3800691 · Cited by 16
Security in the age of AI teammates: An empirical study of agentic pull requests on GitHub
Siddiq, M. L., Zhao, X., Lopes, V. C., Casey, B., & Santos, J. C. S. (2026) · Information and Software Technology · doi:10.1016/j.infsof.2026.108333 · Cited by 5
Pérez-Morera, D., Quesada–López, C., Lara, A., González, A., & Sánchez, S. (2026) · IEEE Jornadas Costarricenses de Investigación en Computación e Informática (JoCICI) · doi:10.1109/jocici69279.2026.11701712
Li, S., Tang, J., Qiang, Z., & Wang, Z. (2026) · Journal of Intelligence · doi:10.3390/jintelligence14100232
Zabala, I. D., Ribalta, C. T., & Mataix, J. B. (2026) · IEEE Digital Education and MOOCS Conference (DEMOcon) · doi:10.1109/democon70840.2026.11707943
Benchmarking Large Language Models on HDL Generation of Cryptographic Primitives
Slooff, T., Banik, S., & Regazzoni, F. (2026) · IEEE International Conference on Omni-layer Intelligent Systems (COINS) · doi:10.1109/coins69995.2026.11715612
Command Coding: A Methodological Framework for AI-Accelerated Software Development
Villani, T. S., & Kellogg, M. (2026) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3832783.3834536
Distributional Program Analysis: Treating Large Language Models as Program Samplers
Tran-Truong, P. T., & Le, X.-B. (2026) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3832783.3834555
AIALIB: A Threat Library for AI-Generated Code
Aljaberi, A., Kang, J. L., & Sun, Y. (2026) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · doi:10.1145/3832783.3834655
Roesner, F., & Kohno, T. (2026) · arXiv · doi:10.48550/arxiv.2609.17817 · Cited by 2
Learning Program Behavioral Models from Synthesized Input-Output Pairs
Mammadov, T., Klakow, D., Koller, A., & Zeller, A. (2024) · arXiv · doi:10.48550/arxiv.2407.08597
Metadata
- Authors
- Pearce, H., Ahmad, B., Tan, B., Dolan-Gavitt, B., & Karri, R.
- Affiliations
- New York University (US)
- University of Calgary (CA)
- Venue
- 2022 IEEE Symposium on Security and Privacy (SP)
- Publisher
- IEEE
- Published
- 2022-05
- Pages
- 754-768
- ISSN
- 1081-6011 (ISSN-L)
- OpenAlex
- W4288057765
- Cited by
- 476
- References
- 31
- Citations by year
- 2026: 147 · 2025: 139 · 2024: 132 · 2023: 52 · 2022: 6
- FWCI
- 73.53
- Type
- conference paper
- Language
- en
- Open access
- closed
- Locations
- IEEE Symposium on Security and Privacy (S&P) (publishedVersion)
- Funders
- National Science Foundation
- Office of Naval Research
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Information Systems › Web Application Security Vulnerabilities
- Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
- Keywords
- GitHub Copilot, AI-assisted code generation, code security, Common Weakness Enumeration, prompt engineering, prompt diversity, domain diversity
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.