A system for use with a drug delivery device includes a sensor unit and a deactivation unit operatively coupled to an output of the sensor unit and to a drug-retaining region of the drug delivery device, wherein the drug-retaining region contains a drug. The sensor unit is configured to detect a characteristic of a local environment and generate an output corresponding to a value of the detected characteristic. The deactivation unit is configured to render the drug ineffective when the output of the sensor unit satisfies a predetermined condition.