Abstract
This paper addresses the problem of ensuring security for C/C++ software systems, where static code analysis serves as a key tool for vulnerability detection but remains costly to maintain due to the complexity of developing rules and taint specifications. Existing approaches are analyzed: industrial static analyzers (Svace, Irbis), IFDS analysis, ML/NN-based solutions, and hybrid schemes involving large language models (LLMs) used for warning filtering, code generation, and automatic rule synthesis (QLPro, KNighter, CodePatchLLM). It is shown that direct use of LLMs as standalone vulnerability detectors yields high recall but is accompanied by a significant number of false positives and hallucinations. As an alternative, a multi-agent module for the SAST tool CodeQL, tailored for C/C++, is proposed. It leverages LLMs for the generation, validation, and evolution of rules in the QL query language within a closed loop of "generation, verification, refinement, filtering, ranking". The system architecture is described, featuring generator, validator, refiner, filter, and ranker agents, whose orchestration is implemented using LangGraph and PostgreSQL. Rule validation is performed against CodeQL databases Juliet, SARD, and real-world projects, with calculation of metrics including Precision, Recall, F1, FPR, and Specificity, and consideration of CVSS scores. This enables the selection of rules of acceptable quality and reduces the burden on developers through automated evolution of the rule base.