Now maybe this weapon fires by you telling it to shoot that guy over there, or it's programmed to shoot anyone who enters through that door over there, but in the end it's still a weapon under control and responsibility of the owner.
The default situation with rights for people is essentially "everything is permitted unless it has been explicitly forbidden by the laws", with the added restrictions of what the government shall not ever forbid.
If the government does nothing, autonomous non-human entities have the right to bear arms - it doesn't need to be given, it's sufficient if it hasn't been taken away. Since the second amendment does not apply to such entities, the government can freely restrict these rights if it chooses to, but currently it has not.
How is it treasonous?