PROJECT SUMMARY Adherence to once daily tenofovir disoproxil fumarate/emtricitabine as pre-exposure prophylaxis (PrEP) is nearly 99% effective in preventing HIV infection yet adherence remains challenging especially among men who have sex with men (MSM) with substance use disorder (SUD). MSM continue to experience disproportionate risk of HIV; 10% of new HIV infections in the United States in 2018 were among MSM. Substance use is a significant comorbidity and risk factor for HIV infection due to increased risky sexual activity, needle sharing, disorganized routines and difficulty learning adherence skills. Among MSM with SUD, measuring adherence remains critical to understanding methods in which to support PrEP adherence among at risk individuals. A digital pill system (DPS) comprising an ingestible radiofrequency emitter integrated into a gelatin capsule which overencapsulates PrEP can provide direct confirmation of PrEP ingestion events. The context in which these events occur can provide important insights into the etiology of nonadherence and challenges that may be addressed through personalized behavioral interventions. Our current work has demonstrated that MSM with SUD will accept and operate the DPS to measure PrEP adherence and are willing to accept interventions that account for patterns of PrEP ingestion from the digital pill. This Avenir Award takes a high risk, yet high reward advance by developing SmartSteps, a context aware, antecedent intervention that digests PrEP adherence data from the digital pill, combines it with digital phenotyping to anticipate potential PrEP nonadherence. In the face of anticipated nonadherence SmartSteps will deliver empiric corrective feedback thereby mitigating PrEP nonadherence before it occurs. This proposal will consist of two phases. In phase I, we will inform the specification of an algorithm that utilizes smartphone digital phenotyping features (location, Bluetooth, charging, accelerometry, app usage, phone and text usage) to anticipate PrEP nonadherence annotated by the digital pill. We will utilize a digital phenotyping app, Beiwe, which securely and anonymously collects raw smartphone use data. We will recruit N=40 MSM with substance use to utilize the digital pill for PrEP adherence in concert with Beiwe over 60 days to generate a dataset that will be used to train the algorithm behind SmartSteps. In phase II, we will conduct a pilot randomized controlled trial of SmartSteps compared to treatment as usual among HIV negative MSM with substance use disorder with a primary outcome of understanding the potential for an effect of SmartSteps in mitigating nonadherence and improving both overall and weekly adherence. The overall impact of this proposal will be to develop a context aware, anticipatory intervention that advances the science of adherence interventions in HIV prevention and SUD. SmartSteps will also serve as an architectural framework to inform the development of similar interventions t...