An AI agent sparked a series of events that led to a critical security incident at Meta which exposed sensitive user data.