Research
Published at ICCCT 2025 (International Conference on Computer and Communication Technology).
Springer · 2025
A Multi-Agent RAG Framework for Automated Source Code Vulnerability Detection and Repair
Samridh Anand, Sakshi S, Samritha R, Samarth S I, Shruthi L. PES University, Bengaluru.
Problem
Manual code review is slow, static analysers raise many false positives, good real-world vulnerability datasets are scarce, and most tools stop at detection and leave the fix to a developer.
Approach
Three specialised LLM agents cooperate: one identifies attack vectors, one confirms a specific CWE, one writes the fix. A ChromaDB knowledge base of MITRE's Top 25 CWEs, embedded with all-MiniLM-L6-v2, grounds each step to reduce hallucination. The loop repeats until no vulnerability remains or an attempt limit is reached. Output is structured JSON with explicit validation.
Results
Evaluated on 92 C and C++ samples from CVEFixes, against a single-LLM baseline without RAG or agents.
Architecture
| Metric | Multi-agent + RAG | Single LLM | Change |
|---|---|---|---|
| Correct predictions | 45 / 92 | 28 / 92 | +60.71% |
| Incorrect predictions | 33 / 92 | 38 / 92 | -13.16% |
| System errors | 14 / 92 | 26 / 92 | -46.15% |
Limitations
- Weaker on authorisation and privilege escalation flaws that need project-wide context.
- Occasional JSON escaping problems with special characters in structured output.
- Scoped to MITRE's Top 25 CWEs; 3 to 10 seconds per function.