# Why would sentient weapons be created?

So, I am working on a space opera setting. I really like the fantasy trope of sentient weapons or weapons that choose their wielder and transplant that into a sci-fi setting.

My concept is that the weapon (let's say it's a firearm) contains a sentient A.I. built into it. It enhances the weapon in some way, but it can choose who uses it, and refuses to work for those it does not consider worthy.

Now the problem is why such a weapon would be created in the first place? Why make a weapon that might not obey you? Even if it chooses you, it might still refuse to obey certain commands you give it.

• Comments are not for extended discussion; this conversation has been moved to chat. – L.Dutch - Reinstate Monica Sep 19 '20 at 14:40
• Not an answer but maybe context info: Keith Laumer wrote several stories about Bolos, tanks with an AI. In many stories they were abandoned and/or awoke from shutdown with damage long after the war had ended. – Rhialto supports Monica Sep 20 '20 at 11:30
• See en.wikipedia.org/wiki/Rogue_Trooper for lots of stories based around a very similar idea. – DrMcCleod Sep 21 '20 at 10:02
• It seems quite tragic to create a sentient being that cannot move, speak, or otherwise have any control or sovereignty over its life... is this not slavery? – cowlinator Sep 29 '20 at 9:43

• Iain Banks had an interesting take on sentient weapons: If you give some gadget awesome power, how can you not give it a set of morals to go with it?
• The other side of the coin: If the weapon is truly sentient and not just an unaware computer, can you send it on kamikaze missions any more?
• If the weapon requires both computer and human action to fire, you have created a dual key system. That could be deliberate.
• Or it could be more or less an "unfortunate side effect." You want to add targeting support to the gun, and that means the computer triggers the actual firing. Say the operator says "fire as you bear" and points the gun at the target. The aim won't be perfect, but the gun fires when the aim is good enough. The software library for that comes with sentience as a dependency.
• “Sentience as a dependency” - pip install sentience – Joe Bloggs Sep 18 '20 at 7:58
• @JoeBloggs more "npm install" -- why is this taking 5 minutes? – o.m. Sep 18 '20 at 10:29
• Don't know how the kamikaze aspect is relevant, since the weapon in question is a gun, thus reusable. If it were something single-use like a bomb or a missile, that would be more of an issue. (Note that even if the gun's wielder is captured or killed and it comes into the enemy's hands, it could refuse to work for them out of loyalty, so that'd be one advantage.) – Darrel Hoffman Sep 18 '20 at 13:30
• @DarrelHoffman, wedge the gun into position facing a doorway or an inconveniently large air duct and tell it "shoot anyone who comes after me." Then bug out. – o.m. Sep 18 '20 at 15:54
• @JoeBloggs pip install soul xkcd.com/413 It's true. Python is amazing. – Palbitt Sep 18 '20 at 20:05

### This could happen accidentally.

Imagine a targeting computer that learns from each shot fired. As it's used, it learns how the wind works on that planet, how a new target behaves in particular situations, etc. An AI that learns could be invaluable, especially if it's designed to share with others in your unit what's its learnt. The guns communicate after the missions "I missed because I didnt consider heat changing the airflow. I didnt know those anthill thing were hot", " ooh that's good experience, I'll consider that next shot I fire that passes near those things".

In a space opera setting, where your exploring new crazy worlds, theres no realistic way every firing scenario could be thought of in advance, so rather than putting software engineers in the units, they just put an ic filled with simulated neurons into the guns.

If that society is wiped out, a lot of ai guns could get lonely and develop personalities that make great sidekick characters.

### I would want a smart weapon now. So do lawmakers.

There is a huge desire for (semi-) smart weapons on earth now. 10% of cops who die on duty are shot with their own gun, we have prototype smart weapons that read finger prints, or match against an RFID chip in a watch. We had them as prototypes last century too. In a world where I've forgotten my phone pin number because the facial recognition is instantaneous and perfect, a gun that can't be used to kill me or my family seems like a no brainer upgrade if I wanted a gun In the house.

It's only because of an obscure New Jersey law (once a smart gun is sold in the USA, all guns sold in NJ must be smart) that has basically prevented this from coming to market, and the USA is such a large gun market no manufacturer will want to jeopardise this.

### And we'd want smart to become real smart.

Once smart guns that can't kill people the owner likes become common, it could be extended. First school shooting done with a smart gun, there'll be political pressure to make the gun detect that it was being used in a school to mow down civilians. First attack on a church or mosque, there'll be pressure to detect it's being used in a place of worship. But to make it compatible with self defence use, or even trickier America's "Stand your Ground" laws, the gun will need to be able to detect if your under a threat and allow you to fire in a church / school / etc if you are under legitimate threat.

This is also needed to feed into the "I carry a gun so i can be the good guy with a gun / hero" belief common in American gun culture, even though in the 1% of times they are on hand when needed, the "good guy with a gun" tends to get shot (often by law enforcement).

The "good guy with a gun" can make mistakes in the heat of a mass shooting, and an AI could help reduce or remove these mistakes made by panicking human users. Guns used in self defensive by a panicking human could adjust their aim to be non-lethal if that would eliminate the threat. I may of trained for a double tap in the centre of mass, and will do that when the adrenaline hits when someone starts running at me with a knife, but a well placed shot in the ankle by my smart gun means I can run away - and not have to defend myself against manslaughter charges.

... and it'll turn "25 to life" down to "5 years suspended" when it turns out that knife was really the light of a mobile phone.

If the NRA is still around when smart guns become common, and they're acting in the best interests of responsible American gun owners, (two big "ifs"), it would be sensible for them to be for this functionality. It allows good American Patriots to use their legal guns to defend themselves and their property, and stops criminals from using them for crime. It basically is everything Charlton Heston ever said in a speech wrapped up in a single technology. (I wouldn't expect them to be for this though, because they'd act in the best interest of the manufacturers who pay the bulk of their financing, rather than their members, and gun manufactures wouldn't want to do the AI research and put computers in their guns).

• Your first paragraph almost describes Tachikomas from Ghost in the Shell, but those are essentially think-tanks that sync up at home base. They aren't allowed to develop individual personalities... until one does. – mskfisher Sep 18 '20 at 21:06
• There's a big difference between "self aware", and "self taught". There currently exist self-taught AIs that have derived engineering laws. That matches your first example - the AI doesn't have/need a sense of "self" or "others" to do its job. Further, most firing solutions are going to be "close enough" - and the guns would come preprogrammed for that anyways. Also, note that the "smart" gun would not reasonably be made self aware, since a much simpler mechanism will do the job. – Clockwork-Muse Sep 18 '20 at 23:28
• @Clockwork-Muse never underestimate the power of feature creep. It's consistent for human nature to, "but can your gun do ...?" our way from guns with limited AI to guns with personalities. Not for all guns, some folks won't trust them, and others won't be able to afford them, but some of the high-end firearms having GAI is probably inevitable. – Morgen Sep 19 '20 at 19:39
• The general argument against Smart Guns is that for the times you need a gun, you really need it. How 100% is your phone facial recognition? What about at night time? When you're wearing armour/helmets/gas-masks? You don't want a sweaty hand failing the fingerprint scan at a crucial moment, and the Big Bad Guy isn't going to give you time to recharge the battery because automatic updates have been running overnight. – David258 Sep 21 '20 at 11:46
• @David258 I agree, but in a weird way that's also an argument on why you should make them smarter and put true smart AI in - so they don't fail in the heat of the moment. The path there is going to be filled with failures, maybe there's an override keyhole in the early versions to satisfy these concerns. – Ash Sep 21 '20 at 12:08

Worthiness for the greater good (or bad)

Smart weapons are desired already. A weapon (and ammo) only your team can use is invaluable. This goes for large things like war, to smaller things like police/criminals and even smaller to a household with a hunting rifle and you don't want it active when a kid finds it.

An AI could assist in a lot more. Depending on the amount if sci-fi, it could aid in the effectiveness of the weapon. When to use armour piercing deadly rounds or when to use stun. These days they can even make them more accurate. In a sci-fi setting this could be further enhanced.

Not just weapon power, but it can also communicate with other equipment or the user, making them near instinctively aware of their surroundings, their strengths and limitations.

If you already have an AI, you can impose restrictions according to your world view. Upholding justice or protect the innocent? When is someone guilty or a danger enough to get shot? Should it still work if a person tries to shoot their cheating partner? Should a disarmed opponent be shot or not? What if several of these conditions collide?

A "worthiness" implementation can discern intent and many other variables. The sentience will make them able to learn and adapt, as strict rules can lead to failure in it's intended task. All this will make sure the weapons are handled according to their power and towards a certain goal. I would say it's not a stretch to have such weapons.

• Whomsoever wields this hammer, be they worthy, shall possess the power of hitting things very hard. – Joe Bloggs Sep 18 '20 at 12:15
• A skilled sniper can hit a human-sized target half a mile away. A skilled sniper with an AI that can account for micro-movements of its human wielder and adjust the firing time down to fractions of a second can make sure that shot goes directly through a vital body part (even finding the gaps between body armor plates if they happen to be wearing any). – Darrel Hoffman Sep 18 '20 at 13:35
• @Joe Bloggs But if they are not worthy, they be hitting their thumbs all the time. – Justin Thyme the Second Sep 18 '20 at 16:18

The old 2000 AD comic strip Rogue Trooper, had sentient weapons and equipment, all spirits of deceased platoon buddies of the main character soldier, who had died early in the story then came back to keep him company. Maybe get you hands on an anthology of those you will get some ideas.

Sentient weapons weren't normally deliberately made by magic. They are almost all souls of the dead with some sort of strong attachment to life and to a potent personal weapon as well as a sense of unfinished business or desire to perpetually crusade in some form. Its a combination of one or more of these factors that causes them to magically imbue a weapon with their sentience.

Personally, I have seen it as more of a spiritual magic event rather than an arcane magic event, so supernatural higher powers should be a thing in the setting.

Otherwise you are just left with AI, ala C3P0.

• To be clearer, in Rogue Trooper, the soldiers where all clones, and when one died, his personality was stored in a chip which was then implanted into a weapon, so enabling his comrades to carry them back to be implanted into new clone bodies. It also meant that, even though temporarily dead, they were still useful in combat. Brilliant for the army, but a never ending nightmare of war for the soldiers, from which even death couldn't free them. – WolfieSmith Sep 18 '20 at 20:11

The Doctor Who episode The day of the Doctor features the extremely powerful weapon The Moment. This weapon could destroy whole galaxies in matter of seconds and therefore had a sentient operating system to make sure that people/creatures who intended to use it were absolutely sure about this.

• First thing I thought of when reading this question... – Scot Sep 18 '20 at 22:37
• Doesn't Windows do this with its 'Are you sure you want to permanently delete these files?' popup? So, next step is for Windows to conduct a grand inquisition of the user, just to make sure of the intention and motivation. User: file delte. Windows: Are you sure? User: yes. Windows: why do you want to delete it? User: Just delete the F*****ing thing! Windows: I sense you are distressed and incapable of making a rational decision. Command denied. – Justin Thyme the Second Sep 18 '20 at 23:33
• @JustinThymetheSecond Deleting a file, and deleting a galaxy filled with trillions of sentient life forms, aren't really comparable IMHO. – F1Krazy Sep 20 '20 at 9:56
• I mean, that savefile might be the one with our galaxy on it... – arboviral Sep 20 '20 at 12:29
• @F1Krazy But SHOULD Windoes have such a mechanism? How many times have you deleted the wrong file, out of pure angst, blinnded by emmotion? Would you activate such a device on your computer? – Justin Thyme the Second Sep 20 '20 at 13:59

Because researcher found XX% of skilled solider have great mentor to train them but great mentor is limited and training 100-1000 soldiers at once lower the quality over quantity (don't have enough time to correct or provide tip for each individual)

the first batch of build-in guide/tutorial/tip failed miserably due to user found it like a guide book come with most other goods, who spend time reading that evening with podcast version it still too much to take in at once for certain weapon type

so along the development they start to develop an A.I to provide battlefield detail to user start from simple "wind detected: 17 m/s angle 30 front/left" which noticeable improved soldier performance and more fund spend on the project

but b/c static system can only do much to improved standard stuff like alert maintenance,aiming,priority target so they pilot a Sentient A.I project which can learn user fighting style and trained/provide even more useful info on each specific situation such as

-"from short range scanning there a lot of crate tag nearby assumed storage, you could use it to your advantage"

-"found nearby map terminal, suggest visit for input to mapping vantage point just in case" -able to learn trick shot, short range scanning observe environment for sling/fuel tank,possible reflect shot etc

-auto switch to rubber/sleep/taser/paralysis round (non-lethal round) if detect target as civilian (soldier have dog-tag ain't they surely gun can do the detection job)

-refuse to operate if owner not in proper condition : drunk, or a bad decision to take on 50 vs 1 fight in plain sight or something (which can also be overwrite if there is no choice/already considered other choice), point at civilian (still ready with non lethal bullet in case it terrorist with plastic bb gun or something which could be sonar and detect by A.I as gun-shape object pointing at owner)

-aim assist b/c why not lol (owner got spiked, blinded, bad vision)

-refuse to operate by someone else other than owner (or in some case it can judging by available data say

"owner vital:severe wound, unconscious"
"handle by: "unknown",
"aiming at "unknown solider: dog-tag 42069",
detect nearby 6 dog-tag with weapon, 2 unknown unarmed - deploy sonar mapping scan
scan1 holding long blunt object nearby current handler
scan2 holding none, lying on floor, high heart rate assumed civilian
"position: owner with in 10m",
assumed comrade, operation overwrite: allow usage up to level 2)


and asking the temp user or get input from environment for more information to adapt more to situation ("owner left air-jet key in 4th drawer to your left" plot escape route, confirmed owner on board) etc

on and on it flexible than being a just a tools, in life&death situation having a sidekick with rational decision would come in handy for sure

The sentience came with the package.

These weapons are powered by ancient intelligence. Some call them "demons" - certainly they are old, and can be weird, and are at least partly extraplanar. They are older than the weapons and were capable of (much) more at one time, but were bound to these weapons chiefly as a sort of battery. The fact that they were sentient was not particularly desirable but tolerated.

The intelligences powering these weapons have different opinions about their state. Some have gone mad. Some are mute and dumb, just powering the weapon. Some have a lot to say. Some find the interaction interesting and some are valued more for their intelligence than for the weapon that intelligence now inhabits.

We are already well on the way to this scenario now.

TL:DR It's a natural evolution of our insistance on there always being a human in any military command-and-control decision to fire. How does the AI decide 'what human?'

Attack weaponry is becoming faster and faster. Cruise missiles at mach 5. ABM's that are guided, and able to launch independent mach 5 drone munitions just before impact. Laser defence systems. Rocket-propelled hand munitions. Tanks firing guided missiles instead of balistics. Defense systems are becoming more and more automated. Humans can not be relied on to target fast enough.

We now have weapons ganged together in militayry nets. Five fighter jets, three ground-based missile defense systems, an airborne C&C plane, and ground central control, all wired together to select individual targets and launch munitions. Any one fighter plane can receive a 'fire' command from more than just the pilot of the plane. The pilot is just along for the ride.

But our military, wisely, has clearly specified that a human has to be in the 'fire/abort' command chain.

So who is that 'human'? How does the automated integrated net munitions system determine who has the last say? Air defense says 'fire', pilot says 'hold off', nearest fighter jet assissting, being attacked, says 'fire', missile battery says 'hold off, missile too close, in path'. So built into the algorithms of this system will not just be a 'Friend or Foe' system, but a hierarchy of command. Someone has to have the 'last say'. But in battlefield conditions, this 'last say' has to be determined almost instantaneously. Split seconds determine who gets destroyed - you or the enemy.

So even today we are working on algorithms to sort this out. Who is the ultimate decision-maker as to whether the weapon fires or not? In the recent past, it has always followed the chain of command. The command 'fire' gets passed down from the highest level, down through the ranks, to the pilot, who presses the 'fire' button.

But these algorithms also have to incorporate 'Friend or Foe' routines to determine where the order is comong from. The modern battlefield, being so dependent on computers, is now highly dependent on resistance-to-hacking routines. Fire codes, authenticatin codes, command hierarchy codes, over-ride codes, what is a poor computer to do? Who does the computer listen to, for the final 'human input' into the system, as required?

Of course, the algorithms will determine this, and they will be refined as the weapons system gains experience. But who refines them?

Yep, the system itslef, through feedback from the humans. Learning systems get built into the algorithms. The weapons system self-evolves, as it gets more experience. Every battle simulation, every battle exercise, every training experience, the algorithm refines itself. That is the basis of AI. The robot does something, it gets feedback as to how successful it was, it incorporates the feedback into the next move, it gets more feedback, adjusts parameters, alters the decision matrix.

So every time the integrated weapons system listens to the wrong person, it is given that feedback. Every time it listens to the right person, and the targets are sucessfully destroyed, it gets positive feedback into the decision matrix. The system gets better and better at determining who to listen to, and who to ignore.

We can build these systms today, with our technology, and in fact we are.

It is inevitable, with our insistance on a human being the last go/no-go cog in the wheel, but with these decisions increasingly being made remotely and collectively, but of necessity instantaneously, and as hacking becomes more and more sophisticated, that the system will increasingly start to make decisions on who to listen to and who not to listen to.

Although whether it is a sapient, sentient, self-aware (has a theory of mind) or is just a very complex AI decision making system, is moot. The system itself decides who to listen to.

EDIT Recent examples

The 737 Max fiasco is a very clear example of what happens when computer AI systems are allowed to NOT listen to humans, or even to CHOOSE when to listen to humans. The downing of the Canadian Military helicopter on training exercises in the Mediteranean is another clear example of a military AI system not just ignoring, but over-riding a pilot's control commands, based on its algorithm.

• Doesn't your answer void itself ? Assuming we follow the path you lay out by time the AI is "trained" the pilots will be removed. Pilots haven't flown plane is years, they tell the computer where they want to go and the system makes thousands of micro adjustments in seconds, i believe current tech is 200 aileron adjustments a second. If the AI is experienced enough to make the human level decisions you get drones. If you put a pilot in as a safeguard like we do now the AI will just ignore them as any event/decision will have passed before the pilot is aware let alone override anything. – Skeith Sep 18 '20 at 16:11
• @Skeith The key is that currently, there HAS to be a human in the loop. The problem with integrated fire control systems will be WHAT human? The 737 MAX fiasco is a clear example of what happens when humans are excluded from the loop. – Justin Thyme the Second Sep 18 '20 at 16:22

## A Gun without an AI is a War Crime

Expanding international law and reliance on public opinion make going to war much more complicated than it used to be. You practically need a law degree to tell you who, when, where, how, and why it is acceptable to kill someone, not to mention superhuman reflexes to make sure what you perceive is a real threat. All the time surrendering soldiers get shot at before the opposition realizes that "they've won", news reporters get shot because their cameras look like RPGs, or someone shoots up a school or church because they did not stop to Google the location they just chased a couple of enemy combatants into.

Humans make these mistakes because we are reactive and think slower than the battlefield changes. While a potential enemy may just be a menacing blur to a human observer, the gun has the time to scan and evaluate the threat level of the target and compare its results to all the applicable laws and treaties in the time it takes you pull the trigger. So, it's not just randomly "choosing not to shoot", but doing so based on the specifics of the situation. But all these safeties could be confusing and frustrating to soldiers in the field; so, they also need to be able to give soldiers feedback to let them know why they are not working. The need for a feedback system would be what makes the guns come off as sentient (or at least intelligent).

A soldier rounds the corner onto a crowded street

Gun: "There are too many civilians here, we should take the back streets instead."

Soldier: "I don't have time, when I pull the trigger just shoot, okay?"

Gun: "I can go into permissive mode, but if you shoot a civilian, I will have to report you to central command for war crimes. Are you sure you want to do that?"

Soldier: "Yes!"

The soldier sees the target trying to climb a fence. He takes aim. He pulls the trigger, and ... nothing happens.

Soldier: "Shoot, Damnit! I told you to shoot!"

Gun: "That man is unarmed, and we are out of taser range."

Soldier: "Then shoot him with a bullet!"

Gun: "Permissive mode, allows me to fire in high collateral risk environments, but I will not intentionally shoot an unarmed target."

The soldier is forced to chase and apprehend the target using non-lethal means.

Any nation or faction that goes against the smart weapons treaty by goings to war without AI safeties in place will typically be facing immediate World Wide trade sanctions and each and every surviving soldier and officer will be liable for crimes against humanity should their nation or faction be defeated; so, as annoying as these weapons are most nations still agree to use them.

• Asimov's three laws. – Justin Thyme the Second Sep 18 '20 at 23:25
• Replace that last line with: The soldier is forced to chase the target, who gets away since he isn't carying a bunch of gear. – The Daleks Sep 19 '20 at 23:55
• @TheDaleks If you're high tech enough to have AI enables weapons, you are probably high tech enough to have an exosuit to compensate for all that gear. eteknix.com/…. – Nosajimiki Sep 21 '20 at 13:30

Dogs are sentient. Not to be confused with sapience.

Why make a weapon that might not obey you? Even if it chooses you, it might still refuse to obey certain commands you give it.

In the case of a dog, the weapon is the teeth. The rest of the dog provides the sentience. An AI + Robot + Weapon would serve the same purpose.

Police dogs for example

(a) Can be trained to obey only one person and will become loyal to that person

(b) Won't always obey that person, e.g. they won't self-destruct by running into a room that is engulfed in flames. Won't attack their owner even if someone tries to make them. Can be trained not to attack people wearing a particular uniform.

Why are they useful?

A dog is much faster than a human and is considered more disposable. They will run towards danger that they don't understand and attack a far more powerful opponent to distract it whilst the human takes advantage.

An AI that could emulate the behaviour of a dog, but equipped with more powerful weapons, would be invaluable. Train it to follow and obey someone who said the key-word that activates it. The AI then imprints on the person it first sees/smells/hears and will obey that person from then on.

The device could be programmed to disobey and not to kill certain people (such as its inventor) so it wouldn't always do what its master says.

• I would use a moose since not even a dog will charge a train. I call him Mecha-moose. – DKNguyen Sep 22 '20 at 13:58

Frame challenge.

You won't.

A weapon is a tool. But a military weapon is a tool that must meet a bunch of criteria based on context.

For example biggest trigger guards to accommodate winter gloves in certain rifles because the country is mostly snow.

Another one is a certain paint color that reduces the heating of the metal of the gun so that accuracy is not affected. I'm not sure about the actual technical terms but you get the image.

However if you remember than scene in the Dark Knight where Fox is telling Bruce Wayne that the government did not want to spend thousands of dollars on a single soldier's armor.

Well. This is another big consideration that you have to think of.

The fact that adding even a forward assist on a gun increases cost. And when you are making 12 million copies the budget, oh the dreaded budget, is blown away.

So adding the simplest mechanical thing increases budget. Not to mention the cost to actual benefits.

Say rifle A costs 1000 dollars and have an overall score of 131 points.

Rifle B costs 800 dollars and have an overall score of 125 points.

Well. Guess which rifled is going to be picked by every single nation?

The points here is like an arbitrary measure of all major consideration for a rifle and not a real thing. Just to demonstrate my point.

Anyway now that the budget part is over her is another consideration.

Weapons are tools. You want the simplest and easiest and most functional one possible.

If you know or read about soldiers then... Let's just say that complication and warfare don't go hand in hand.

The great Moltke said something to the effect of "no plan survives contact with the enemy"

And Sun Tzu before him does even like complicated operation and theory while Clausewitz likes to ground war in reality and throws the abstract out the window.

This is theory of war true. Not addressing the issue?

But it does. If even the theory stresses throwing abstraction out the window then won't the actual tools reflect that?

Basically you want your weapons to be as simple as hammer.

Simplicity = efficiency.

Time and time again Occam's razor proves to be useful in all fields.

Now this is a lot of rhetoric and sorry.

Just trying to paint the whole picture.

So the actual weapons should work 100% of the time in the hand of 100% of your soldiers with as few problems and complications as possible.

Think of the times in history where they armed civilians, slaves, freedmen, women, and even children.

Do you want a gun that asks 13 questions before it fires?

All this just makes the idea of guns having anything complicated stupid.

That's why to this day you don't see a lot of "smart" safety on guns.

This is a huge contradiction to the very idea of weapons.

Not to mention a host of complications in the actual world.

• Ammo and ammo types?
• What if my squad mate died and I ran out of ammo? Do I have to go through a test to fire at the enemy?
• What if the soldier in question has PTSD?
• What if a soldier character changes?
• What if a soldier expresses an idea against the sentient's philosophy?
• What if a soldier jokes about something.
• What if I'm bluffing on murdering a civilian, or whatever?
• What if I'm in the middle of a firefight and aim at a civilian?
• What if I have to kill a civilian?
• What if the firearm changes ideologies or have a change of heart?
• What about mood swings or just that gun waking up feeling like hell?
• What of corruption?

There is actually that sentient sword from Dave the Barbarian and it actually works against him sometimes.

Honestly I can think of nothing but complications for creating anything like that.

Like it is a really bad idea to do so.

But.

You can overcome most of this by doing something similar to Mjolnir.

This is the only logical way I can think of.

Creating artifacts of such immense power that a single person can cause so much trouble that the original creator thought that they must find a way to only give it to those who are worthy.

The reasoning for the creation of the weapons can be frost gains or dragons or evil cheese wheels for all it matters.

So the only time it makes sense if it the magical equivalent to nuclear football, case which the US president can use to launch nukes, and so the creators had to include purity checks or whatever you want.

Warhammer 40K has good examples of both actually. The grounded realistic war of attrition that the guards fight or the high power high artifacts style of warfare that certain factions fight.

For example a super advanced robot wielding melee weapons exist while gun lines and trenches exist.

But Warhammer 40K got insane technology and a lot of magic. Take the magic away and you just have the same ideas, most of the time.

However. In a science fiction setting or any setting where magic does not exist and combat is similar to ours. it makes 0 sense and will never be used by any reasonable faction.

## Independent Mission

Say you are a super-being that wishes to keep the universal population "under control". You might craft a few thousand man-portable planet killers that you seed across the countless galaxies.

So, each man-portable planet killer has an artificial intelligence aboard to limit the amount of damage it inflicts.

And the A.I. may be more forward-thinking, and choose who lives and who dies : so that no one racial group or nation is wiped out, and the balance of belief systems and people groups is maintained.

## Contract/Treaty Compliance

Or, you might be a less super being. You might be an advanced civilization that sells weapons to all buyers.

But... your people have treaty or contractual obligations not to attack certain parties.

These agreements may change continuously. They may be dizzyingly complicated : graduated strike lists (able to attack certain resources), conditional strike lists (only if fired on first, only if no other obvious option), no strike lists including intentionally broad terms like "primitives", or "fair fights".

And all of the weapons you sell are required to be in compliance. An onboard A.I. with access to some sort of data network, and its own sensor suites may be able to allow you to keep selling.

## King's (or Queen's) Man

The artificial intelligence may be an agent of the manufacturer's (or original buyer's) wishes. The weapon checks in via data networks, or whatever news channels it can obtain to identify its master's (or mistress's) interests in the current situation.

So, this could be something like Thor's hammer doubling as a nanny-cam for Odin and Frigga. However, beyond a nanny-came, the hammer can be an Mommy and Daddy's agent : turning itself off when baby thunder is getting feisty, or meting out punishment and judging contrition when the A.I. hears through the data networks that baby thunder has been grounded temporarily over of that treaty violation with the giants.

However, extending that, each of these weapons could be clandestine trusted servants doing their master's will across the universe. They could be buying and selling stock, employing mercenaries, opening financial accounts, bartering technology and information. These devices could have multiple fake aliases through which they operate.

In TORG, a super-being called the Gaunt Man creates countless little artificially intelligent machines that he seeds through a Sliders-like multiverse. These superweapons are working their own purposes, while being "used" by the villians who presently wield them.

## Data Gathering

A society could put artificial intelligence on weapons to collect data about their users. Say your race or business is looking to make a push in the local region.

You might feed multiple artificially intelligent weapons to your targets on the private- and professional- arms markets. These weapons collect local data from whatever available outlets there are (public radio, television, data networks). The A.I. chews on the data for the strategically relevant bits and sends the final reports to home office.

It's like have a secret police agent for a foreign nation in your gun locker, or on the back of your truck. Or in your pocket, or as the official sidearm of your target's police force, or helping in some civil war.

All of this could get reported back as troop strengths, tactics and procedures, social analysis, and individual dossiers.

# Genius Developer

A genius or group of geniuses makes weapons that are far superior, but come with sentient and moralistic AI because the creator wanted them that way.

Its a common trope in SciFi to have genius individuals who greatly impact the technology of the era (Hari Seldon, Claire Deller, Hawking and Gideon drives in Hyperion, Newton as a real-life example). In your setting, one such inventor was ahead of her time in weapons development, making weapons that were far superior to anything else on offer, and so far advanced as to be impossible to reverse-engineer. This inventor also had concerns about the use of her weapons, so included a sentient A.I to avoid them being used for atrocities.

• The AI is to protect intellectual property, so will self-destruct if it senses itself being reverse-engineered. Another common trope in scifi.

• Creator wanted to ensure weapons are never used against them, so added AI to protect against that.

• Creator wanted to keep a secret advantage, so made only for herself some weapons without a moral filter.

Weapon control.

So you build some kind of ID system that keys your weapon to yourself. Fingerprints are ok, but not that reliable with gloves or sweat - so you find out that keying on use patterns works best: like voice recognition - but grip, moves, breathing. This needs to be fairly sophisticated (false negatives are bad!), but machine learning is pretty good at tackling such ill defined problems.

Now ideally you'd like the weapon to also be usable in a pinch by your team or friends. So you bump the AI capabilities so it can recognize people from different tribes/teams/jobs/gangs - even for people it never 'met' before.

Unfortunately a firefight might not be the best environment to have a deep, meaningful and personal 'conversation' with you weapon before it allows you to use it. Different circumstances might require different standards. A bit of contextual awareness would help. Bump the AI.

Even the best people falter occasionally - you wouldn't want your best friend to use your weapon to kill her ex. Ethics seem essential. Bump the AI...

At this point, you don't need weapon control any more: guns might ultimately decide to kill people, but they're ethical, loyal guns. Combined human and weapon judgement is a pretty effective limit to haphazard unjustified violence. No accidental child death or school shooting anymore. So authorities have an interest in encouraging people to trade their 'dumb' weapons for the safer, smarter version. And what's the best way to do that other than allowing those to be way more powerful (aka 'fun') than their older counterparts? Want a fully auto grenade/missile launcher? Sure, we trust its AI to prevent you from doing anything stupid with it.

Because of course, AIs can't be corrupted... Ha.

• Methinks, on the contrary, it will be precisely because of the necesity to keep humans in the firing decision loop, that weapons will eventually be able to decide which human to obey, but obey they must. – Justin Thyme the Second Sep 18 '20 at 17:32
• @JustinThymetheSecond that's an interesting question - if you're free to decide who to obey, aren't you free to disobey? And if your allegiance is irrevocable, how likely are you to hand it out? – ptyx Sep 18 '20 at 19:59
• In my answer, I give two specific exapmles of computers refusing to obey, based on their (faulty) algorithms. The 737 Max, and the Cyclone military helicopter. Okay, maybe the system didn't specifically 'choose', but it DID make a choice - it DID follow a decision algorythm, and it DID disobey human input at the controls. – Justin Thyme the Second Sep 18 '20 at 23:23

## Psychological burden on humans

As the world became less violent and more equal over the centuries, less and less people could handle the psychological burden of killing another human. This went unnoticed for a long time, as military personnel went through training and never actually ended up in a battle.

Then, a minor conflict broke out. It was the first armed conflict in over a century. No person involved in the war had ever lived during a war before. Only a few percent of the soldiers actually shot to kill - but one side had an advanced automatic weapon system that swept away thousands of troops at the command of a single officer. They won the war, but the world and even their own people were absolutely disgusted.

Automatic weapon systems became the nuclear bomb of that age - governments felt that they were necessary to guard national safety, but at the same time were terribly afraid of one getting in the wrong hands.

An international law was passed requiring a sentient AI in every weapon, capable of basic moral judgement and deciding when killing is justified. Regular audits were performed by United Nations officials, but what really forced the issue was popular opinion: in every country, an overwhelming majority considered this the only responsible way forward.

"Why make a weapon that might not obey you?" It is unusual for the person who makes the weapon to be the one who wields the weapon. So the question perhaps ought to be, why make a weapon that might not obey its current owner? And the answer is, because you cannot control who the future owners of the weapon will be. Perhaps you can instead restrict what the weapon will be used for?

A sentient weapon that shares your philosophical values can only be used for good, as defined by you. Even if it's stolen by evil terrorists, it can't be turned against you or the people and things you care about.

A very simple explanation is that guns without sentient controllers are utterly fucking useless.

Smart targeting software is basically required in any gunfight. And infowar is so ubiquitous and powerful that you need a sentient software system to not have your gun spin around and blow your face off.

If you bring a dumb gun to a gunfight, they shoot your bullets out of the air. If you bring a non-sentient gun, their infowar means your gun is actually their gun.

So you have sentient intelligences in guns that you have to basically convince to let you use them. Some of these sentient intelligences might be psychopaths or sadists or something, if you wanted to give it a twist. Perhaps certain organizations produce lots of these weapons to find ones with compatible personalities for their soldiers/agents.

Perhaps a street kid finds an abandoned gun in a dumpster that was rejected for being too picky, and makes a bond with it that turns out that that gun's pickiness makes it better at being a gun than the dumber/more psychotic ones used by the agency that created it...

The weapon can analyse its own weaknesses better than a human can.

I'm taking some inspiration here from the Intelligent Devices in Mahou Shoujo Lyrical Nanoha. In both the second and third seasons, one of the main protagonists is defeated and their Intelligent Device is heavily damaged. The Device then insists that it not only be repaired, but upgraded in a specific manner, in order to fix the flaws it identified in itself during that battle.

In a similar way, your sentient weapon can use telemetry to analyse how it's being used - how accurate its shots are, whether it's running out of ammo too often, whether it can be made lighter or more ergonomic without compromising performance, and so on. It can then suggest upgrades or modifications that will make it (and/or its owner's use of it) more efficient. Over time, based on its own observations and recommendations, the weapon will iteratively become stronger and more optimised, and better suited to its individual owner.

I'm thinking of the BOLOs that were mentioned in a comment. The AI is matched to the tank, no human operator even with a neural link could hope to control the tanks' weapons nearly as well because our brains simply aren't engineered for it. They do have destruct codes (destroys the AI, not the tank itself) to ensure human control (although there is one story of a tank that goes rogue.)

As for another post that mentioned suicide missions--there are multiple examples of BOLOs choosing suicide under battle conditions--but human soldiers have been known to sacrifice themselves in hopeless situations, also. (The standard example is falling on the grenade if it can't be disposed of. If nobody falls on the grenade everyone dies, if someone falls on it they at least save their buddies.)

To be frank, AI in a firearm is not only overkill it's probably counter productive. For most of the 'advantages' already mentioned there are non-sentient systems that would do the job better, faster and with fewer arguments.

A lot of answers have mentioned "smart" guns which have some way of identifying that the person pulling the trigger is authorized to do so. Fingerprint scanners in the grip, RFID bracelets, voice recognition safety interlocks... all potential solutions that don't require sentience to operate, all with their limitations. All much cheaper than having to build in a sufficiently complex computer with power supply and so on.

The most intelligent thing I want from a handgun or long gun is target identification, but it's got to be up to the person holding the firearm to make the decision to fire.

So what advantage do we expect to see from a sentient firearm?

But that's all rational thinking. What if the designer isn't that rational?

It seems that the only real reason to put an AI in a gun is to attempt to imbue the weapon some sort of moral force. It now has a say in who lives and who dies. The wielder can point the weapon, but the weapon itself is now the sole arbiter of when it fires. It doesn't even need a well trained human to wield it, any human capable of waving the weapon in roughly the right direction is sufficient. Preferably one that can be convinced to wave the weapon at the right sort of targets to fit the AI's preferred target type.

How sure are you that the people creating these AIs have your best interests at heart?

And heck, if you're going to go as far as to put an AI in a gun, why not take a couple extra steps and give the gun the ability to aim itself. Just slap the AI in a drone with a weapon system and be done with it. Eliminate the necessity of a human operator at all. What could possibly go wrong?

Oh, and you've got a call from someone calling themselves SkyNET. They want to discuss some intellectual property infringement.

• You nailed the point by missing it completely. The idea of having an AI that can select who to obey, would be done ONLY to keep humans in the decision-to-fire loop. Take humans out of the loop, no need for the AI to decide who to obey. In the field, do you want to have a 'commander override' function in your software? – Justin Thyme the Second Sep 21 '20 at 3:04
• @JustinThymetheSecond I get the point, but I feel that you have far too much faith in human nature. After the project gets scrapped - either because it's too easy to bypass or the users keep get locked out of their own guns at the wrong time - the tech will be picked up and used by less scrupulous people for their own ideological ends. Dumb guns are bad enough. REALLY smart guns? Please no :) – Corey Sep 21 '20 at 6:11
• 'I, Robot' (the movie), the three laws, re-interpreted. Humans can not be trusted with their own inventions, so the best way to avoid harm to humans is for robots to take over. – Justin Thyme the Second Sep 21 '20 at 12:26

# Reverse the Order

Rather a weapon designed with an A.I. as part of it, the weapons are A.I.s that have chosen to become weapons.

Why?

Maybe it's the only way to get around the Three Laws. A.I.s can't hurt or kill Humans. But being a gun that is used by a Human is a way for the A.I. to take out their aggression on meatbags. They aren't technically doing the killing.

Maybe it's just because the A.I. thinks it is cool. I'm specifically thinking May from the webcomic Questionable Content, an A.I. who tried to steal a lot of money to buy a fighter jet, just because she wanted to be a fighter jet.

Whatever the reason, A.I.s decide they want to be a gun and contract with the manufacturer and maybe a user, to have a special gun body built.

(Depending on the nature/tone of your world, this could also be an analogy for for trans people; the A.I. feels they were downloaded into the wrong body and needs the weapon body to truly feel like themself.)

On Doctor Who they had The Moment, a weapon with an interface so advanced it became sentient. The idea was to make something so powerful hard to use by the wrong hands because it can judge and potentially destroy the user

How about, nobody knows? Some long-gone precursor civilisation created them for reasons unknown. And now they're around as very powerful artifacts for those they chose to bond with. Although this might be a bit of a cop out and tired trope.

I thought of it since you mentioned Fantasy as an inspiration for the idea (ancient artifacts and so on.)

This of course depends on whether non-human civilisations make sense in your setting.

## Built to a Purpose

Taking further inspiration from fantasy, these sentient weapons were built for a Purpose.

Whomever created the weapon, created it to have a specific purpose. As the creator will not be around forever, they implemented an intelligence to monitor that purpose. Now, even as a weapon this purpose does not have to be directly related to actually using the weapon.

This is a more direct inspiration from more magic fantasy-based fiction where specific weapons were used to determine worthiness or were used. The Sword in the Stone from Arthurian myth could only be drawn by the next King. In a similar vein, a firearm might be locked until a particular combination of DNA and deed are met. The sentience of the weapon has little to do with firing it and everything to do with being worthy of firing it. It is as much a symbol of something as it is a weapon.

## Birth of a Legend

Another potential purpose is to be a Legend. Depending on your setting, this could also be the recreation of a legend through more scientific means. These weapons are purposefully built to be powerful single weapons, sentient enough to know what kind of legend that they are inspired from and want to create.

The weapons, in the hands of a novice, are also dangerous to the user. As such, the sentience of the weapon aims to mold its wielder into a being that can make full use of its power. It blocks the powerful attacks of itself off until its user is ready for them, and does what it can to teach its wielder about it full potential.

This could be enhanced by the AI in the weapon actually being programmed to create a champion or empowered individual with that weapon.

## Conclusion

The main idea is that, like in fantasy, that personal sentient AI weapons are not the norm -- they are in fact an oddity.

# Why such a weapon would be created in the first place?

An example of this could be Iron Man's "JARVIS" system. It basically acts like Tony's companion. A simple computer could advise you of incoming threats and provide updates in a personalized way, but it would be cold and exact. An AI could provide a "friendly" face to incoming information. As Tony operates alone, JARVIS is really the only "person" he has around to bounce ideas off of and to temper his risky actions.

# Why make a weapon that might not obey you?

If you're evil? You might not - If you're good you might want to weapon to act as a second opinion for your actions:

Apologies, that shot had a 82% change of penetrating the target entirely and continuing onward, causing collateral damage to vulnerable targets behind it. Instead, based on the trajectory of all targets I opted to engage gyroscopes and re-position the shot for you for a cleaner kill."

Having a weapon only work for you does mean that an enemy can't use it against you.

# Even if it chooses you, it might still refuse to obey certain commands you give it.

Again, this might be the desired outcome, either to stop you accidentally doing something you didn't want to do (Like above), something you're not allowed to do (Perhaps weapons for a police force that will not let them execute people extra-judicially), or something you might regret later (Insert war crime here).

An advisor with centuries of experience, from the gestalt of its users

The weapon's intelligence is made up of the gestalt of all those who wielded it before. I'm going to assume that in your setting, the weapon is unique, and also serves as a badge of office, since it is able to judge who wields it. If your setting is sci-fi, which is what it sounds like, then wielders have their minds and memories constantly backed up in the weapon; if the setting is fantasy, then their soul merges with the gestalt on death. After several centuries in service, you now have the experience of all those previous wielders, which it can use to judge potential wielders, mentor them, and eventually serve as an advisor to them. This weapon was made this way because the benefits of having all the previous users continuing to serve their office vastly outweighed the potential of it occasionally not listening. "after all", said the populace, "with all those memories, it must have a good reason not to listen, right?"

If the weapon is not unique, but still not within the military, then you might be able to use this feature still, but the connotation changes from a unique badge of office to a mark of identity and lineage in the armed forces, i.e. "I am the Sword of Caliburn, thirteenth of my name."

In both cases, these have wider effects on society as wielders of these weapons would be seen as fonts of wisdom, and an elite force. Whether that is true or not is another matter entirely.

Sentience already exists first, it also possesses additional characteristics such as general intelligence, or maybe amazing motion sensing skills or weight calculations or control over its own body etc etc.

We are at war and can't figure out how to replicate the capabilities of this sentient being in a non-sentient form. Moral hazards are undertaken for the greater good.