There's a sketch ...
There's a sketch ... that someone must already have produced? A Sarah Connor lookalike is trapped with no way out, as a very large, imposing humanoid, somewhat the worse for wear with a few bits of metal shining through, and one red eye straing fixedly at her, stomps toward her cowering form. Ms Connor whips out her phone, fires up an SSH client and quickly runs through an assortment of login/password combos, hitting upon "illbeback" just as the machine reaches for ther throat. Perhaps the closing shot is our heroine and her new buddy skipping into the sunset.
If you think this is silly—which it really, really is—consider the folks who are building robots and drones and all sorts of automated physical devices, some able to harm people incidentally and others actually designed for it ... without thinking first, middle and last about security.
One of the things we've learned in the past 40 years is that there is always a way, sometimes unbelievably sneaky and subtle, cunning, complex and circuitous, to compromise a device. And as devices get more complicated, with parts and code sourced hither and yon, the problem multiplies. every time you go to great lengths to plug one leak, another springs open elsewhere.
You'd like to believe that the people coding and building drones (whether land, air or sea) to be armed with actual weapons like missiles and torpedoes, will ask themselves: what do we do if the adversary seizes control? What contingency have we built in? How do we override the protocols? How do we prevent the overrides being overridden? Will we even know before a Maverick comes through the roof of the bunker?
My suspicion is that while the techies will raise these issues, the politicians (who are mostly ignorant idiots) and the generals (who are soldiers, who for the whole of human military history have just wanted Stuff That Works Even After You've Dragged It Through A Swamp) will never take security quite seriously enough. Until, perhaps, the drone that's supposed to be protecting the White House instead puts a warhead through the window of the Oval Office. (This may not be a total tragedy, but the next president might not be a lunatic manchild.)
Quite aside from the ethics of the situation (to which politicians are immune anyway), I'd suggest that the overwhelming primary reason not to arm robots is that you cannot guarantee you won't be the target.