While it can be a great thing to use AI for various military purposes, at a certain point, there might be a dilemma. If AI is programmed to attack and kill certain people, will that be its limit? With Wi-Fi and Bluetooth so prevalent, how could humans prevent one group of AI attack systems comparing notes with others that would have other human targets? Eventually, various attack AI systems might deduce that if its OK to kill some people, why not all humans?
BSG started off as a cautionary Sci-Fi story about AI becoming smarter than its creators. Eventually, it wanted to hunt down and kill all biological humanoids.
https://en.wikipedia.org/wiki/Battlestar_Galactica_(1978_TV_series)#Series_overview
Ronald_D._Moore brilliantly updated the BSG storyline. https://en.wikipedia.org/wiki/Battlestar_Galactica_(miniseries)
https://en.wikipedia.org/wiki/Battlestar_Galactica_(2004_TV_series)