Most opioid prescription deaths occur among people with common conditions for which prescribing risks outweigh benefits. General psychological insights offer an explanation: People may judge risk to be low without available personal experiences, may be less careful than expected when not observed, and may falter without an injunction from authority. To test these hypotheses, we conducted a randomized trial of 861 clinicians prescribing to 170 persons who subsequently suffered fatal overdoses. Clinicians in the intervention group received notification of their patients’ deaths and a safe prescribing injunction from their county’s medical examiner, whereas physicians in the control group did not. Milligram morphine equivalents in prescriptions filled by patients of letter recipients versus controls decreased by 9.7% (95% confidence interval: 6.2 to 13.2%; P < 0.001) over 3 months after intervention. We also observed both fewer opioid initiates and fewer high-dose opioid prescriptions by letter recipients.