יובל אלוביץ

אקדמי בכיר

CodeCloak

A Method for Mitigating Code Leakage by LLM Code Assistants

Amit Finkman Noah, Avishag Shapira, Eden Bar Kochva, Inbar Maimon, Dudu Mimran, Yuval Elovici,Asaf Shabtai

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.

שפת פרסום אנגלית
דפים 4418-4427
סטטוס פרסום פורסם - 21.10.2025

ASJC Scopus subject areas

Artificial Intelligence
גישה למסמך
10.3233/FAIA251340
קבצים וקישורים אחרים
Link to publication in Scopus