This is a piece about the defibrillator from Wikipedia:
Also known as automatic internal cardiac defibrillator (AICD). These devices are implants, similar to pacemakers(and many can also perform the pacemaking function). They constantly monitor the patient's heart rhythm, and automatically administer shocks for various life threatening arrhythmias, according to the device's programming. Many modern devices can distinguish between ventricular fibrillation, ventricular tachycardia, and more benign arrhythmias like supraventricular tachycardia and atrial fibrillation. Some devices may attempt overdrive pacing prior to synchronised cardioversion. When the life threatening arrhythmia is ventricular fibrillation, the device is programmed to proceed immediately to an unsynchronized shock.
There are cases where the patient's ICD may fire constantly or inappropriately This is considered a medical emergency, as it depletes the device's battery life, causes significant discomfort and anxiety to the patient, and in some cases may actually trigger life threatening arrhythmias. Some emergency medical services personnel are now equipped with a ring magnet to place over the device, which effectively disables the shock function of the device while still allowing the pacemaker to function (if the device is so equipped). If the device is shocking frequently, but appropriately, EMS personnel may administer sedation.