Metal Detectors are found in each prison, usually at the entrances to work rooms (those marked with green locks).
A Metal Detector raises your Guard Heat to 99% when passed through with contraband in your inventory. However, this does not apply to weapons equipped in your weapon slot and outfit equipped in your outfit slot..
Despite the name, Metal Detectors are not set off by non-contraband metal items such as cans of Shaving Cream and Razor Blades and are set off by non-metal contraband items such as the Glass Shank. Therefore they can essentially be considered "Contraband Detectors".
Contraband can be smuggled safely through metal detectors by keeping a Contraband Pouch in the player's inventory. Also, you can safely carry an unconscious inmate or guard with contraband in their inventory through a metal detector.