As AI becomes more capable of identifying vulnerabilities and analysing attacks, companies are beginning to use it for defence as well.