May be a rule engine can be used and with set of rules it will act as an expert system.
There are some well known situations for software failures. For example index out of bounds or integer overflow, floating point underflow and many more.
say X code is submitted by Dev team Pass X-Code Changes to the AI Tool [ Tool logic - AI and ML) Here Tool will understand the code and it will generate the test cases for corresponding the code.
======
in nut-shell, tool logic should be "generic", such that whatever code in, tool should generate the test cases aligned to the code.