@inproceedings{df272a392a4a46d5b869dbf2b7441cbc,
title = "CodeCloak: A Method for Mitigating Code Leakage by LLM Code Assistants",
abstract = "Large language model (LLM)-based code assistants are increasingly popular among developers. These tools help improve developers' coding efficiency and reduce errors by providing real-time suggestions based on the developer's codebase. While beneficial, the use of these tools can inadvertently expose the developer's proprietary code to the code assistant service provider during the development process. In this work, we propose a method aimed at mitigating the risk of code leakage when using LLM-based code assistants. CodeCloak is a novel, real-time, deep reinforcement learning agent that manipulates the prompts before sending them to the code assistant model. CodeCloak aims to achieve the following two contradictory objectives: (i) minimizing code leakage, while (ii) preserving relevant and useful suggestions for the developer. Our evaluation performed on multiple code assistant models, demonstrates CodeCloak's effectiveness on a diverse set of code repositories of varying sizes, as well as its transferability across different models. We validate our approach through human judgment of suggestion quality and testing on complete repositories simulating real development scenarios.The source code is available at: https://github.com/AmitFinkman/CodeCloak.",
author = "\{Finkman Noah\}, Amit and Avishag Shapira and \{Bar Kochva\}, Eden and Inbar Maimon and Dudu Mimran and Yuval Elovici and Asaf Shabtai",
note = "Publisher Copyright: {\textcopyright} 2025 The Authors.; 28th European Conference on Artificial Intelligence, ECAI 2025, including 14th Conference on Prestigious Applications of Intelligent Systems, PAIS 2025 ; Conference date: 25-10-2025 Through 30-10-2025",
year = "2025",
month = oct,
day = "21",
doi = "10.3233/FAIA251340",
language = "English",
series = "Frontiers in Artificial Intelligence and Applications",
publisher = "IOS Press BV",
pages = "4418--4427",
editor = "Ines Lynce and Nello Murano and Mauro Vallati and Serena Villata and Federico Chesani and Michela Milano and Andrea Omicini and Mehdi Dastani",
booktitle = "ECAI 2025 - 28th European Conference on Artificial Intelligence, including 14th Conference on Prestigious Applications of Intelligent Systems, PAIS 2025 - Proceedings",
address = "Netherlands",
}