I've found AI to be really helpful for generating boilerplate code or converting from one language to another. It's hit-or-miss for anything more complex than that.
You'd have to be a really bad developer to take what chatgpt spits out and just paste it into your IDE.. considering it probably won't even work straight away (this is the same for any info you pull off stackoverflow).
For AI to deliberately put malicious code in, it would have to be writing really complex stuff and not just code snippets, which as far as I can tell, it can't do.