When (and why) does AI coding flip from promising to a security nightmare? Let's look under the coding hood.