Ali Al-Kaswan

A Dual Perspective on Large Language Models for Code and Security

Artificial Intelligence (AI) systems that can read and write computer code, so-called Large Language Models (LLMs), are becoming a routine part of how software is built. Because these systems are good at reasoning about both code and natural language, they are not just useful for everyday programming, they are also relevant to security work, where understanding how a piece of software behaves, or how it might be attacked, is central. At the same time, the very properties that make these AI systems useful also create risks of their own: a model trained on huge amounts of code can accidentally leak private information from that training data, produce code with security flaws, or even help someone carry out a harmful task.

In this dissertation we study this two-sided relationship between AI language models and software security. The first part looks at how these AI systems can be adapted and properly tested for realistic security tasks, going beyond simple, artificial test problems toward settings that better resemble how security work is actually done in practice. This includes teaching an AI model to explain compiled, “black box” software without access to the original code, testing an AI system’s ability to work through a simulated hacking challenge on its own, and checking whether AI coding assistants can be led into helping with harmful requests.

The second part turns the question around, examining the risks that come with using these AI systems themselves. This includes showing that AI models can memorise and later leak fragments of the code they were trained on, including sensitive details that should never have been exposed, and demonstrating that these models can also “remember” and repeat buggy code they encountered during training, even when they would otherwise know better.

Throughout this work, the emphasis lies on testing these AI systems in ways that reflect real-world use, and on openly and responsibly sharing the datasets, tools, and testing methods that were developed, so that other researchers can verify and build on these findings.

With these results, we offer a dual perspective: Large Language Models as tools that can genuinely support security work, and as systems that must themselves be carefully evaluated and secured. With these findings, this dissertation contributes to a more grounded, realistic understanding of both the opportunities and the risks that these AI systems bring to software security.

Lees verder
Publicatiedatum 16 december 2026
Universiteit Overig
Auteur Ali Al-Kaswan
ISBN nummer 978-94-6518-516-3

Bekijk ook deze projecten

Anouk Bosman

Anouk Bosman

Overig Lees meer
Noortje Pleunis

Noortje Pleunis

Overig Lees meer
Brigitte Carole Keumatioa Doungtsop

Brigitte Carole Keumatioa Doungtsop

Overig Lees meer