An implantable medical device, such as a pacemaker or implantable cardioverter defibrillator (ICD), is configured to automatically detect ingestion of medications to verify that prescribed medications are taken in a timely manner and at the correct dosage. Briefly, individual pills are provided with miniature radio frequency identification (RFID) devices capable of transmitting RFID tag signals, which identify the medication contained within the pill and its dosage. The implanted device is equipped with an RFID transceiver for receiving tag signals from a pill as it is being ingested. The implanted system decodes the tag to identify the medication and its dosage, then accesses an onboard database to verify that the medication being ingested was in fact prescribed to the patient and to verify that the correct dosage was taken. Warning signals are generated if the wrong medication or the wrong dosage was taken. Therapy may also be automatically adjusted. Non-RF-based ID devices are also described, which instead transmit ID data via biphasic current pulses.