Maybe I'm naive but it seems like a "security audit" agent in the CI pipeline could have caught the malicious code before deployment.