Skip to main content

Agentic RAG for automated program repair

A Master's thesis project investigating the efficacy of LLM-based agents augmented with specialized security knowledge for vulnerability remediation.

Problem statement

Large Language Models (LLMs) are increasingly applied to Automated Program Repair (APR), but often struggle due to insufficient domain knowledge and a tendency to produce "hallucinations" or unreliable fixes.

Limitations of current approaches

Without grounded context, even advanced models rely on probabilistic generation rather than verified security practices. This limitation hinders the practical application of LLMs in critical security infrastructure where precision is paramount.

Proposed methodology

This research proposes an agentic system leveraging Retrieval-Augmented Generation (RAG) to enhance the reliability and precision of source code vulnerability remediation.

The framework positions LLMs as central controllers orchestrating reasoning and tool interaction. By utilizing RAG, we augment the LLM's context with retrieved external security knowledge, such as best-practice guidelines, relevant code snippets, and historical fixes.

System architecture

  • Specialized retrieval methods for code security
  • Distilled security knowledge injection
  • Orchestrated tool interaction & verification

Research contributions

Results from the scientific community demonstrate that this knowledge-driven, structured approach significantly boosts performance in software security tasks. Tailoring the RAG context with distilled security knowledge yields substantial improvements in secure code generation metrics over state-of-the-art baselines.

The proposed agentic RAG system provides a robust, context-aware, and knowledge-grounded framework for automated vulnerability repair, a crucial step toward creating reliable, high-quality APR solutions essential for modern software security.

Research objectives

Contextual precision

Implementing a RAG pipeline that ensures every remediation suggestion is contextually accurate to the specific codebase architecture.

Automated reasoning

Developing agentic workflows that can autonomously analyze, reason about, and repair vulnerabilities with minimal human intervention.

About the research

This project is part of a Master's thesis focused on advancing the field of Automated Program Repair through the integration of modern LLMs and knowledge retrieval systems.

Built with modern technologies