The US continues to grapple with an opioid epidemic, with ~69,700 opioid overdose deaths in 2020. Health systems have instituted multiple interventions to reduce patient risk, many focusing on decreasing unsafe opioid prescribing among those viewed as high-risk. However, there are limited tools to identify who is truly at high risk of overdose, leading to burdensome interventions targeting an overly broad population or missing key high-risk individuals. Even if those who are at risk can be identified, the interventions lack effective strategies to change clinician behavior, focusing instead on blunt tools to reduce prescribing rather than reduce risk. In prior work, we developed and externally validated machine-learning algorithms that identify patients at high risk of opioid overdose, even if not actively prescribed opioids. Separately, we demonstrated how behavioral nudge alerts embedded in the electronic health record (EHR) can be combined with risk prediction tools to change clinician behavior. In this project, we propose to reduce opioid overdose risk by bringing together machine-learning based overdose risk prediction and behavioral nudges through a scalable EHR intervention to improve clinician prescribing behavior. In a large academic health system (UPMC), we propose the following specific aims: (1) Incorporate our previously validated machine learning algorithm into the EHR to predict 3- month risk of opioid overdose; (2) Pilot test a clinician-targeted behavioral nudge intervention in the EHR for patients at high predicted risk for opioid overdose; (3) Evaluate the effectiveness of providing risk scores in the EHR with and without a behavioral nudge to improve opioid prescribing safety and reduce overdose risk. In Aim 1, we will apply our gradient boosting machine overdose prediction algorithm to the UPMC Epic-based EHR. We will optimize the algorithm for use in UPMC primary care practices, addressing model accuracy and algorithmic biases. In Aim 2, we will combine the risk score generated by our algorithm with clinician nudges in the EHR, using a 3-phase pilot with focus groups, silent testing, and live testing in 3 primary care practices. The nudge intervention will target clinicians caring for high-risk patients and will use active choice prompts for naloxone and accountable justifications for opioid and benzodiazepine prescribing. In Aim 3, we will conduct a cluster randomized trial in 45 UPMC primary care practices, with 3 arms: (1) usual care; (2) EHR-embedded risk score; 3) EHR-embedded risk score coupled with the nudge from Aim 2. The EHR-embedded risk score arm will consist of an alert in the EHR that identifies the patient as high risk for overdose. In the risk score coupled with nudge arm, a similar EHR alert about high-risk status will flag, along with the nudges from Aim 2. The primary outcome will be a composite of 3 prescribing practices associated with reduced risk of overdose: naloxone prescription, opioid dosage <50MME...