The solution is simple → don't use automatic code suggestions/PRs. There must be a human involved that suggest a piece of code - and he/she should be fully responsible for it (if there is an error/bug in the code - he/she's at fault).
That should be the way, at least, until AI is proven to better at writing code than humans.
That should be the way, at least, until AI is proven to better at writing code than humans.