AI-generated code often lacks robust authentication and authorization controls, leading to critical flaws like broken access control, hard-coded credentials, or entirely missing authentication for backend systems. This occurs because AI tools often generate functional code without understanding the broader security context or an application's specific risk model.