Failure prevention using AI