This paper emphasizes the importance of automated vulnerability detection and repair systems and points out the limitations of existing static program analysis methods. To overcome the scalability and adaptability issues of existing methods, as well as their high false positive and false negative rates, we propose an AI approach based on machine learning and deep learning. However, AI-based approaches suffer from a significant dependence on the quality and quantity of training data. Therefore, we present a novel framework for generating datasets by automatically introducing realistic, categorical vulnerabilities into secure C/C++ codebases. We coordinate multiple AI agents, functional agents, and existing code analysis tools that simulate expert reasoning. We leverage Retrieval-Augmented Generation to establish a contextual foundation, and perform efficient model fine-tuning using low-rank approximation. Experimental results on 116 code samples across three benchmarks demonstrate that our proposed approach successfully injects vulnerabilities at the function level with a success rate of 89% to 95%, outperforming competing techniques in terms of dataset accuracy.