AI for Substance Use and Overdose Prevention

AI can support identification and treatment outreach, but the strongest recent implementation evidence is observational. In a prospective pre/post evaluation, patients who received an addiction consultation had 47% lower adjusted odds of 30-day readmission than eligible patients who did not receive one; overall hospital readmission did not significantly change, and the design does not establish that the NLP screening system caused the difference (Afshar et al., 2025). Medicaid-claims models and wastewater surveillance provide additional population signals, with important limits in transportability, privacy, stigma, and treatment capacity.

Learning Objectives

This chapter examines AI applications across the substance use continuum. You will learn to:

  • Evaluate EHR-based risk models for opioid use disorder identification
  • Understand PDMP-integrated AI tools and their validated accuracy metrics
  • Assess digital therapeutics for addiction treatment and their evidence base
  • Navigate 42 CFR Part 2 privacy requirements for substance use data
  • Distinguish demonstrated capabilities from theoretical applications
  • Identify implementation barriers specific to addiction medicine contexts
  • Apply surveillance AI for real-time overdose spike detection

Prerequisites: Machine Learning Fundamentals, The Data Problem, Ethics, Bias, and Equity.

The Big Picture: U.S. drug-overdose deaths peaked near 108,000 in 2022 and declined substantially by 2024, while remaining a major public-health burden (CDC, 2026). AI shows promise for identifying at-risk individuals, optimizing treatment, and detecting overdose spikes, but implementation faces stigma, fragmented data, privacy duties, and limited treatment capacity.

What Works (Demonstrated):

  • EHR-based screening: A 2025 prospective pre/post evaluation found lower adjusted readmission odds among patients who received addiction consultation, while overall hospital readmission did not significantly change
  • Claims-based risk prediction: A Medicaid-claims model predicted hospital or emergency-department overdose in the next three months and was externally validated across later Pennsylvania and Arizona cohorts
  • Wastewater surveillance: Community drug-metabolite tracking avoids individual testing but can raise group privacy and stigma concerns for small or identifiable sewersheds

What Struggles:

  • Alert fatigue: Provider override rates for opioid alerts mirror patterns seen in sepsis prediction (high false-positive burden)
  • Data fragmentation: Records created by federally assisted Part 2 programs have specific confidentiality protections that can complicate linkage and reuse
  • Equity gaps: Models trained on clinical populations miss populations without healthcare access

Critical Regulatory Context:

  • 42 CFR Part 2 (final rule effective April 16, 2024; compliance required by February 16, 2026) applies to records created by federally assisted Part 2 programs. The rule permits a single consent for future treatment, payment, and health-care operations uses and aligns several requirements with HIPAA (HHS, 2024)
  • NIDA HEAL Strategic Plan FY 2025-2029 prioritizes AI for high-risk population identification
  • PDMP-generated risk scores are “not validated against clinical outcomes such as overdose” per CDC guidance

Key Implementation Questions:

Before deploying substance use AI, ask:

  1. Was the model validated on populations similar to yours?
  2. Does implementation comply with 42 CFR Part 2 consent requirements?
  3. How will false positives affect already-stigmatized patients?
  4. What happens when AI flags someone but treatment slots are unavailable?

Bottom Line: AI for substance use shows promise in observational implementation and external-validation studies; controlled outcome-trial evidence remains limited. Translation to real-world settings requires navigating privacy regulations, addressing stigma, and ensuring treatment capacity matches identification capacity.

Introduction

The overdose crisis remains a major public-health burden. U.S. drug-overdose deaths peaked near 108,000 in 2022 and declined substantially by 2024 (CDC, 2026). Prescription opioids were followed by heroin and illicitly manufactured fentanyl, which is now found across multiple drug markets, but prevalence varies by place and substance.

AI enters this landscape with both promise and peril. Machine-learning models can estimate overdose risk, treatment discontinuation, and community-level drug trends. A 2025 prospective pre/post evaluation associated addiction consultation after NLP-supported screening with lower adjusted readmission odds among patients receiving consultation, but did not show a significant change in overall hospital readmission or establish causality.

However, substance-use AI faces distinct implementation barriers. Part 2 protections apply to records created by federally assisted Part 2 programs and can complicate linkage and reuse; applicability is record- and program-specific rather than universal to all substance-use information. Stigma amplifies harm from false positives. Most critically, treatment capacity constraints mean that identifying high-risk patients accomplishes nothing if no treatment slots exist.

AI applications span prevention, identification, treatment, and surveillance. The evidence base includes demonstrated capabilities backed by clinical trials, distinguished from theoretical applications, alongside the regulatory, ethical, and practical challenges specific to this domain.

The AI Opportunity in Substance Use Prevention

In 2023, an estimated 107,543 Americans died from drug overdoses, followed by a substantial decline in 2024 (CDC, 2024; CDC, 2026). Synthetic opioids, primarily illicitly manufactured fentanyl, drove most deaths, but burden varies by place and substance.

AI offers potential interventions at multiple points:

Intervention Point AI Application Current Evidence
Prevention Identify high-risk prescribing patterns Claims-based models externally validated for defined short-term overdose endpoints
Identification Screen hospitalized patients for OUD Prospective pre/post implementation evidence; no causal overall readmission reduction shown
Treatment Predict medication adherence, relapse risk Limited validation studies
Surveillance Detect community overdose spikes Demonstrated in wastewater, EMS data
Harm Reduction Optimize naloxone distribution Theoretical, emerging evidence

The Unique Challenges of Substance Use AI

Substance use AI faces barriers distinct from other clinical AI applications:

  1. Stigma amplifies harm from errors: False positives in cancer screening cause anxiety. False positives for opioid misuse can trigger discrimination, loss of pain treatment, and criminal justice involvement.

  2. Part 2 has a specific scope: 42 CFR Part 2 applies to records created by federally assisted Part 2 programs; duties depend on the record, program, consent, and proposed use.

  3. Treatment capacity constraints: Identifying patients is insufficient when treatment access is delayed or unavailable.

  4. Shifting drug supply: Models trained on prescription opioid patterns may not generalize to illicit fentanyl, which now dominates overdose deaths.


Overdose Prediction and Prevention

EHR-Based Risk Models

Electronic health record data contains signals predictive of overdose risk. AI models analyze clinical notes, diagnoses, prescriptions, and utilization patterns.

University of Wisconsin NLP-Supported Screening Evaluation

A 2025 prospective pre/post evaluation published in Nature Medicine assessed NLP-supported screening and addiction consultation (Afshar et al., 2025):

Design: - 51,760 hospitalizations across a 16-month preimplementation period and an 8-month postimplementation period - AI analyzed EHR documentation in real-time using convolutional neural networks - High-risk patients triggered alerts recommending addiction medicine consultation

Results: - Among eligible patients, those who received addiction consultation had 47% lower adjusted odds of 30-day readmission than those who did not - Overall hospital readmission did not significantly change between the preimplementation and postimplementation periods - The nonrandomized pre/post design does not establish that the NLP system caused the consultation or readmission difference

# Conceptual example: EHR-based OUD risk screening
# Actual implementation requires clinical validation

class OUDRiskScreener:
    """
    EHR-based opioid use disorder risk screening
    Based on approach from Afshar et al. 2025
    """

    def __init__(self, model_path):
        self.model = self.load_validated_model(model_path)
        self.part2_review_required = True  # Scope and authority require case-specific review

    def screen_patient(self, patient_data):
        """
        Screen hospitalized patient for OUD risk

        Parameters:
        - patient_data: Dict containing EHR elements

        Returns:
        - risk_score: Float 0-1
        - recommendation: String
        - confidence: Float
        """

        # Confirm Part 2 scope and lawful authority before using protected records.
        # Consent is one possible authority, not a universal prerequisite for every record or use.
        if not self.verify_part2_authority(patient_data['patient_id']):
            return {
                'error': 'Part 2 scope or lawful authority not confirmed',
                'part2_review_required': True
            }

        # Extract relevant EHR features
        features = self.extract_features(patient_data)

        # Features used in validated models include:
        # - Clinical notes (NLP-processed)
        # - Diagnosis history (ICD codes for pain, mental health)
        # - Prescription history (opioid MME, benzodiazepines)
        # - ED utilization patterns
        # - Social history documentation

        risk_score = self.model.predict_proba(features)[0, 1]

        # Threshold based on clinical validation
        if risk_score >= 0.7:
            recommendation = "Consider addiction medicine consultation"
            alert_level = "high"
        elif risk_score >= 0.4:
            recommendation = "Monitor for signs of OUD"
            alert_level = "moderate"
        else:
            recommendation = "Standard care"
            alert_level = "low"

        return {
            'risk_score': risk_score,
            'recommendation': recommendation,
            'alert_level': alert_level,
            'model_version': self.model.version,
            'validation_population': 'Hospitalized adults, Midwest US'
        }

    def extract_features(self, patient_data):
        """Extract and process EHR features for prediction"""

        features = {}

        # Prescription history
        if 'medications' in patient_data:
            features['total_mme_90d'] = self.calculate_mme(
                patient_data['medications']
            )
            features['concurrent_benzo'] = self.check_concurrent_benzo(
                patient_data['medications']
            )
            features['num_prescribers_90d'] = len(set(
                med['prescriber'] for med in patient_data['medications']
                if med['is_controlled']
            ))

        # Clinical notes (NLP)
        if 'notes' in patient_data:
            features['note_embeddings'] = self.process_clinical_notes(
                patient_data['notes']
            )

        # Diagnosis history
        if 'diagnoses' in patient_data:
            features['pain_dx_count'] = self.count_pain_diagnoses(
                patient_data['diagnoses']
            )
            features['mental_health_dx'] = self.has_mental_health_dx(
                patient_data['diagnoses']
            )

        return features

PDMP-Integrated AI

Prescription Drug Monitoring Programs (PDMPs) track controlled substance prescriptions across all dispensers in a state. AI models built on PDMP data can identify high-risk patterns.

Medicaid Claims Overdose Prediction Model

Researchers developed and externally validated a machine-learning model using Medicaid claims (Lo-Ciganic et al., 2022, Lancet Digital Health):

Data: - 284 candidate predictors from Pennsylvania Medicaid claims - Training cohort: Pennsylvania, 2013–2016 - External validation: later Pennsylvania and Arizona cohorts - Endpoint: hospital or emergency-department overdose in the next three months

Model: - Gradient boosting machine - Performance and thresholds varied across validation cohorts; the model did not predict fatal overdose and was not a PDMP product

Key predictors: - Morphine milligram equivalents (MME) prescribed - Number of prescribers - Number of pharmacies - Overlapping opioid and benzodiazepine prescriptions - History of medication for opioid use disorder

CDC Caution on PDMP Risk Scores

Per CDC clinical guidance:

“PDMP-generated risk scores are created by algorithms in software applied to patient information. Such scores have not been validated against clinical outcomes such as overdose and should not take the place of clinical judgment.”

This applies to commercial tools like NarxCare. Research models with published validation (like the Pennsylvania study) have demonstrated predictive validity, but most deployed commercial tools lack such validation.

Commercial PDMP Tools: A Critical Assessment

NarxCare (Bamboo Health) is embedded in most state PDMPs and generates “Overdose Risk Scores.” However:

  • The algorithm’s validation has not been published in peer-reviewed literature
  • Clinicians report using scores to justify denying pain treatment
  • Civil liberties groups have raised concerns about algorithmic discrimination

Evidence gap: Despite widespread deployment, no published clinical trial demonstrates NarxCare reduces overdoses. The tool may reduce prescribing without reducing harm, or shift patients to illicit markets.

A 2026 study in npj Digital Medicine reinforces this concern: Wang et al. replicated NarxCare-aligned feature sets across PDMP and claims data and found precision ranging from 0.01 to 0.32, far below the vendor-reported benchmark of 0.75. The authors conclude that commercial tool opacity makes independent bias auditing impossible and call for mandatory transparency requirements in AI-based clinical decision support regulation (Wang et al., 2026).


Treatment Optimization

Medication-Assisted Treatment (MAT) Adherence

Medications for opioid use disorder (MOUD), including buprenorphine, methadone, and naltrexone, are highly effective but adherence is challenging. AI models attempt to predict treatment discontinuation.

Current evidence:

  • Multiple studies develop predictive models for MOUD discontinuation
  • Features include demographics, prior treatment episodes, co-occurring disorders
  • Validation typically limited to single health systems
  • No published trials demonstrate that predictions improve retention

The intervention gap: Predicting who will discontinue treatment is straightforward. What to do with that prediction is unclear. Evidence-based interventions for improving MAT retention are limited.

Relapse Prediction

AI researchers have attempted to predict substance use relapse using:

  • Ecological momentary assessment (EMA): Smartphone-based mood, craving, and context reporting
  • Passive sensing: GPS, accelerometer, phone usage patterns
  • Social media analysis: Language patterns on public posts

Evidence status: Research-stage. Studies demonstrate correlation between digital biomarkers and relapse, but no clinical trials show prediction-based interventions improve outcomes.

Theoretical vs. Demonstrated

Demonstrated: AI can predict relapse risk from digital data

Not demonstrated: Acting on predictions improves outcomes

The gap is significant. Alerting someone that they are “high risk for relapse” could be helpful, harmful, or neutral, and we do not yet know which.

Digital Therapeutics for Addiction

Several digital therapeutic products have received FDA clearance for substance use disorders:

reSET and reSET-O (Pear Therapeutics, company dissolved 2023): - Prescription digital therapeutics for SUD and OUD - Cognitive behavioral therapy delivered via app - Historically FDA authorized based on submitted clinical evidence - Company bankruptcy in 2023 left patients without access

Lessons from the Pear Therapeutics failure: 1. Clinical evidence does not guarantee commercial viability 2. Digital therapeutics require ongoing maintenance and support 3. Patients lose access when companies fail 4. Business model sustainability matters for public health tools

Current landscape: The digital therapeutics for addiction space remains fragmented. Academic-developed tools (like A-CHESS) continue in research contexts, but commercial products face reimbursement and adoption challenges.


Surveillance Applications

Wastewater-Based Epidemiology

Wastewater surveillance can detect drug metabolites at the community level without individual testing, but it does not eliminate group privacy or stigma risks, particularly in small or identifiable sewersheds.

How it works: 1. Collect samples from wastewater treatment plants 2. Analyze for drug metabolites (fentanyl, methamphetamine, cocaine, etc.) 3. Normalize by population biomarkers (caffeine, creatinine) 4. Track trends over time and compare across communities

AI applications: - Time series forecasting of drug trends - Anomaly detection for sudden changes (new drug introduction) - Spatial analysis linking wastewater data to overdose hotspots

Advantages: - Population-level data without individual identification - Captures drug use by people not in healthcare system - Near-real-time (24-48 hour lag vs. weeks for overdose death data) - Avoids individual testing, but small or identifiable catchments can create group privacy and stigma concerns

Limitations: - Infrastructure requirements (access to treatment plant samples) - Cannot distinguish therapeutic use from misuse - Geographic resolution limited to sewershed

Emergency Department Syndromic Surveillance

ED chief complaints and triage notes can signal overdose surges before death data becomes available.

ESSENCE (Electronic Surveillance System for the Early Notification of Community-based Epidemics): - CDC-developed syndromic surveillance platform - Analyzes ED visit data in near-real-time - Includes overdose syndrome category

AI enhancements to syndromic surveillance include: - NLP classification of free-text chief complaints - Anomaly detection for geographic/temporal clusters - Forecasting models to anticipate resource needs

EMS Naloxone Administration

Emergency medical services data on naloxone (Narcan) administration provides another real-time signal:

  • Each administration indicates suspected opioid overdose
  • GPS data enables geographic clustering
  • Timestamp data enables temporal pattern detection

Several jurisdictions use EMS naloxone data for: - Directing mobile outreach resources - Alerting harm reduction organizations - Triggering public health advisories


Implementation Challenges

The 42 CFR Part 2 Privacy Framework

Records created by federally assisted substance-use-disorder programs covered by Part 2 receive specific protections under 42 CFR Part 2. Not every mention of substance use in a health record is a Part 2 record.

2024 final rule timeline: The final rule is effective April 16, 2024, and persons subject to the regulation must comply by February 16, 2026 (HHS, Feb 2024).

Key provisions (2024 final rule):

Part 2 question 2024 final-rule boundary
Scope Records created by federally assisted Part 2 programs, not all substance-use information
TPO consent A single consent may authorize future treatment, payment, and health-care operations uses and disclosures
Redisclosure HIPAA-regulated recipients may redisclose records under HIPAA after a valid TPO consent, subject to the final rule’s conditions
Counseling notes Receive protections analogous to HIPAA psychotherapy notes
Breach and enforcement Several requirements and penalties are aligned with HIPAA

2024 updates (effective February 2026): - Single consent for treatment, payment, and healthcare operations now permitted - Aligns notice requirements with HIPAA Notice of Privacy Practices - Redisclosure rules depend on the recipient, consent, purpose, and whether HIPAA applies - SUD counselor notes receive protections analogous to psychotherapy notes

Implications for AI: 1. Determine whether the source records were created by a Part 2 program 2. Map consent, recipient, purpose, redisclosure, and data-linkage authority before use 3. Determine whether model inputs or outputs retain protected Part 2 information 4. Apply institutional privacy, security, and de-identification review in addition to technical controls

Stigma and Discrimination Risks

AI for substance use carries unique risks of harm:

Treatment denial: Patients flagged as “high risk for opioid misuse” may be denied appropriate pain treatment, even when they do not have an opioid use disorder.

Criminal justice: Unlike other medical conditions, substance use can trigger legal consequences. AI predictions could inform decisions about probation, parole, or prosecution.

Employment/insurance: Despite ADA protections, discrimination against people with substance use disorders remains common. AI-generated risk scores could leak into non-medical contexts.

Trust erosion: Patients who learn their records are analyzed by AI may withhold information, harming both their care and data quality for future models.

Treatment Capacity Mismatch

Identifying at-risk patients is meaningless without treatment access:

  • Buprenorphine: DEA X-waiver removed in 2023, but many providers still do not prescribe
  • Methadone: Only available through federally licensed opioid treatment programs, with limited geographic availability
  • Residential treatment: Wait times often exceed 30 days
  • Outpatient counseling: Insurance coverage and workforce shortages limit access

The equity paradox: AI may be most accurate for populations with extensive healthcare data, but those populations often already have treatment access. The populations most in need (uninsured, rural, justice-involved) are underrepresented in training data and underserved by the healthcare system.


Regulatory and Policy Landscape

NIDA HEAL Strategic Plan FY 2025-2029

The National Institute on Drug Abuse’s HEAL Opioid Use Disorder and Overdose Strategic Plan includes specific AI priorities:

“Utilize data, monitoring, technology, and Artificial Intelligence (AI) to identify and inform the deployment of interventions for populations at high-risk of opioid use and overdose.”

Specific objectives include: - Develop real-time or near-real-time substance use monitoring - Mine EHR, clinical trial data, digital health devices, and social media - Optimize clinical data standards for AI research - Address challenges in pain management alongside OUD treatment

FDA Regulation of Addiction AI

FDA regulates AI/ML-based software as a medical device (SaMD) when it is intended for diagnosis or treatment recommendations:

Historical authorization: - FDA authorized reSET and reSET-O as prescription digital therapeutics; Pear Therapeutics later ceased operations, so authorization history should not be read as current commercial availability (FDA, 2017) - Clinical decision support tools (various)

Regulatory considerations: - Prospective clinical trial evidence strengthens clearance pathway - Post-market surveillance requirements - Algorithm change protocols (predetermined change control plans)

State-Level PDMP Mandates

All 50 states plus DC now operate PDMPs, with varying AI integration:

  • Some states mandate PDMP checks before prescribing
  • NarxCare or similar risk scores displayed in most state systems
  • Data sharing agreements between states are inconsistent
  • Clinical decision support rules vary by state

Evaluation Framework

When assessing substance use AI, consider:

1. Validation Rigor

Question Red Flag Green Flag
Was external validation performed? Single-site internal validation Multi-site prospective validation
Is the validation population published? “Representative sample” (vague) Specific demographics, timeframe, setting
Were outcomes clinically meaningful? AUC only Clinical outcomes (overdose, treatment retention)

2. Equity Assessment

Question Red Flag Green Flag
Were subgroup analyses performed? “No significant differences” without data Published performance by race, SES, insurance
Are high-risk populations represented? Insured patients only Includes Medicaid, uninsured
Were justice-involved populations considered? Not mentioned Explicit analysis of carceral settings

3. Implementation Readiness

Question Red Flag Green Flag
Is 42 CFR Part 2 compliance addressed? Not mentioned Scope, authority, consent where applicable, recipient, and redisclosure are mapped
Are workflow integration plans described? “Alert-based” without details Usability testing, alert burden analysis
Is treatment access coupled to identification? Identification only Linked to treatment navigation

Key Takeaways

  1. The 2025 Nature Medicine evidence is prospective but nonrandomized. Patients receiving addiction consultation had 47% lower adjusted readmission odds than eligible patients without consultation, while overall hospital readmission did not significantly change.

  2. Claims-based models can estimate near-term overdose risk. Lo-Ciganic et al. predicted hospital or emergency-department overdose in the next three months using Medicaid claims and external validation; this evidence does not validate commercial PDMP scores.

  3. 42 CFR Part 2 creates record- and program-specific data duties. Updated regulations permit a single TPO consent and align several provisions with HIPAA, but AI implementations still must verify scope, consent, recipients, and redisclosure.

  4. Treatment capacity must match identification capacity. Identifying at-risk patients without ensuring treatment access is ethically questionable and clinically pointless.

  5. Stigma amplifies harm from false positives. Substance-use predictions can trigger discrimination, criminal-justice involvement, and treatment denial. Threshold selection should reflect the relative harms of false positives and false negatives for the specific intervention.

  6. Wastewater surveillance avoids individual testing, not every privacy concern. Small or identifiable catchments can create group privacy and stigma risks.

  7. Digital therapeutics face sustainability challenges. Pear Therapeutics ceased operations after receiving FDA authorization for prescription digital therapeutics. Product continuity and access require attention alongside regulatory status.

  8. The NIDA HEAL Strategic Plan FY 2025-2029 prioritizes AI. Federal research priorities include real-time monitoring, EHR mining, and AI deployment for high-risk populations.


Further Resources

Official Guidance

Key Research

Professional Organizations

  • SAMHSA - Substance Abuse and Mental Health Services Administration
  • ASAM - American Society of Addiction Medicine
  • Legal Action Center - 42 CFR Part 2 guidance for practitioners