A contact sensor is a type of proactive security device that is made up of two parts – a magnet and a sensor. The magnet attaches to a window or door frame, while the sensor attaches to the door or window. When the connection is broken, the alarm will sound.