End-to-End Secure Code Repair with Context-Aware Anonymization and Isolated Agent Execution
PriRex minimizes code exposure via anonymized prompts, sandboxed agents, and differential privacy to secure LLM-based automated repair in enterprises.
Published Dec 5, 2025Paper ↗
Only vote on papers you've read. Sign in to vote.
Abstract
In recent years, large language models (LLMs) have demonstrated remarkable capabilities in the field of automated program repair(APR). However, integrating LLM-based repair solutions into enterprise production environments still faces significant challenges. Enterprise codebases often contain proprietary or security-sensitive data, and transmitting such critical information to external models can pose serious privacy and confidentiality risks. Existing automated repair approaches typically expose entire files, toolchains, and execution traces to the model-far exceeding the information necessary for generating patches. This overexposure can lead to unauthorized tool usage and potential leakage of sensitive information through model outputs. To address these challenges, we propose PriRex, a privacyfirst, secure, and efficient APR framework. PriRex enforces strict minimization of exposed code and execution context while maintaining high repair accuracy. The framework comprises three core components: (1) Minimal Exposure Prompting, which extracts only the essential code fragments needed for repair and applies context anonymization; (2) Secure Sandboxed Agent Execution, which constrains agent behavior through whitelisting and risk-scored environments to prevent unauthorized operations; and (3) Differential Privacy-Enhanced Inference, which uses token-level semantic filtering to detect and mitigate potential information leakage in model outputs.