The application relates to the technical field of SaaS systems, and discloses an AI-based SaaS
system vulnerability automatic
repair method and
system, which comprises the following steps: step one, collecting
system data, wherein the system data comprises
source code, logs, business descriptions and running
monitoring data; step two, obtaining an
abstract syntax tree and a call chain according to the
source code, performing LLM semantic analysis on the logs, the
abstract syntax tree, the call chain and the business descriptions, obtaining system logic vulnerabilities, performing
trend analysis on the running
monitoring data, and obtaining system running vulnerabilities according to the
trend analysis result; step three, generating a plurality of groups of patches according to templates, the system logic vulnerabilities and the system running vulnerabilities through an LLM model, scoring and screening the patches; step four, performing grey deployment and shadow traffic
verification on the screened patches, automatically rolling back when the
verification fails, automatically repairing when the
verification passes, and feeding back and optimizing the LLM model according to the verification result.