Guns among Prisoners
Prison guards don't carry guns because of the proven, well-known danger that the prisoners will overpower the guard and disarm him. This isn't speculation; it has happened many times over the years. Deputies and bailiffs in charge of courtroom security are also vulnerable to such attacks, especially in the back rooms that serve as holding cells in the courthouse, where many prisoners who are all scheduled for court that day will be held prior to actually walking into the courtroom when their case is called.
One way to deal with the problem is to have more armed officers, so that after the bad guy gets the good guy's gun and kills him or her with it, the responding officers will shoot the bad guy. But the bad guy can still take out a couple of good guys before this happens.
Another way to deal with the problem is to tether the gun to the deputy's belt with a thing but strong steel cable. It wouldn't save that deputy's life, but it would make it awfully difficult for the bad guy to use that gun effectively against anybody else, once the gun's owner is "dead weight" on the end of a short cable.
Another way to address the problem is for deputies and bailiffs to have a special ring or bracelet that activates the gun, and if anybody not wearing that item of jewelry picks up the gun, it won't fire for them. A company called Mag-Na-Trigger has had such a system in place for DA revolvers since the late 1970s. Massad Ayoob praised it and has used it. I like the concept.