I think that even worse is that AI might choose just to write something, and skip using a library that is well maintained
This is where a human with a discerning taste and wide knowledge of the field should notice it during a review, or at least instruct their agents to check for that. If such a human is still employed in this capacity, of course.
that can sometimes be a plus considering how dependencies used by a lot of projects are themselves targets
Or use an out of date library.
In our somewhat “developer assisted” AI development it planned to use a library. We looked the library up and the GitHub page indicated it was “no longer maintained use other library Z”. When told AI agreed and compared the original to the new library (helpful), but it seemed to heavily weight GitHub stars more than active development.