AC MAINS- it's about 30 years, here in Italy, that in any house/office it must be installed a safety switch. In US that's not mandatory? Basically it is a switch (normally closed), that opens as soon the difference of current between the hot and the neutral are above 30mA. This would be the typical situation when you touch accidentally the hot wire, but all the current flowing through your body is going toward ground. That makes the switch opens.
It works very well, and you almost don't feel anything: too fast to feel the shock.
Cheers
Mario,
We have much the same regulation here, except it doesn't apply to all outlets. Outlets in a wet location (WC/bathroom, kitchen) and exterior are required to be GFCI (the technical name for the "safety switch" you mentioned), or protected by an upstream GFCI or GFCI breaker.
On the one hand they are nice to keep you from frying yourself, on the other hand they can be a complete pain in the butt. I have to replace the exterior outlet I plug my car into in the winter once every year or so because it goes "soft" due to the draw of the block heater on my car.
-dan