AI often falls short when it comes to cybersecurity, but the benefits can be significant when done correctly.