Part A: All newly admitted prisoners (80-120 new inmates on admission days) undergo a complete assessment, including a brief exam and mandatory rapid HIV test by the prison medical unit. Each prisoner waiting to be evaluated will be invited for participation in TB screening activities (not currently part of standard care). If they verbally assent to wanting to learn more in a group session, their names and ID will be recorded and then invited for informed consent privately, followed by a brief survey, WHO symptom assessment, tuberculin skin testing (TST) with reading after 72 hours, sputum induction on 2 consecutive mornings for AFB smear, TB culture (results back 6-8 weeks using the BACTEC MGIT 960 liquid culture gold standard), and point-of care (POC) Gene Xpert. Each person will have phlebotomy for HBV and HCV Ab, LFTs, and if HIV+, CD4 testing (all of these are POC using Alere™). For those with CD4\<50, they will undergo POC low-cost, urinary TB-LAM lateral flow testing (sensitivity=67%) (Alere™ Determine) to identify disseminated TB. Additional demographic, drug use, and TB risks will also be assessed along with prison data (release date, previous incarcerations, type of offense). Participants will then undergo CXR testing. A TB specialist will review all patients and results, ensuring that patients with suspected TB initiate treatment. All suspected or confirmed cases active TB cases in HIV+ prisoners will have ART initiated after 2 weeks of TB treatment initiation (if CNS TB not suspected) if CD4\<50 and within 8 weeks for all others.

Part B: All HIV+ prisoners with latent TB infection (LTBI) (TST reaction 10 mm or greater) from part A will be asked to participate in Part B. Enrolled participants will undergo block stratified randomization, stratifying on three factors: a) CD4\<350; b) HCV Ab status; and c) ART status. After randomization and allocation to 12HR or 40H, participants will be provided 12HR weekly (12 weeks) and INH daily (26 weeks) as directly observed therapy. Every 4 weeks, patients will be monitored for AST/ALT and adverse side effects. Premature treatment discontinuation will occur for any DAIDS Grade 4 toxicity or patient refusal to continue.

Part C: All HIV+ or HIV-prisoners with active, LTBI or no TB and who meet pre-incarceration DSM-V criteria for opioid dependence and who may (or may not) require transitional treatment for active or latent TB infection will be approached. If these TB patients have \>3 month remaining to complete their TB treatment, but are expected to discharge home before completing treatment (6 months for active TB and 26 weeks for INH), they will be eligible; among HIV+ patients, active TB incidence is 16% annually and LTBI prevalence is 84%. All HIV+ patients with active TB will receive PCP prophylaxis, as will those with LTBI and CD4\<200. Because previous studies have documented negative attitudes about opioid agonist maintenance therapies (OAT) in PWIDs in Malaysia (including in prisoners) and that readiness for treatment may not be high, the investigators will enroll participants in a preference trial that will allow patients to choose OAT i.e. MMT, or no OAT, with the help of a shared decision-making aid. Because preferences may change when better informed, they will be informed about the risks and benefits of OAT and asked to see if their preference changes. Those preferring no OAT, will be followed post-release with monthly interviews. Using previously described procedures, MMT allocated participants will initiate MMT immediately with a target dose \>80mg (n.b. Cytochrome P450 induction by rifampin and ART will likely be completed before MMT is initiated, making opioid withdrawal precipitation unlikely). Consented participants will undergo a detailed baseline assessment and administered a using Research Electronic Data Capture (REDCap) in our private research room with guidance from the research assistant (RA). Using procedures from our completed RCT of released prisoners, and in an effort to integrate patients into the health system, all participants will be met on the day of release and transitioned to Klinik Kesihatan (KKs), government clinics, (which will collaboratively act as our research sites) and undergo a day-of-release interview to facilitate familiarity with our team in the community. All participants, regardless of OAT, will complete monthly follow-up visits for 6 months. MMT will be dispensed at KKs using previously described protocols by the Ministry of Health with guidance from our team. At monthly visits, patients will be assessed for adverse side effects, drug/alcohol use, and ART and TB medication adherence using the visual analogue scale (VAS). TB, HIV and substance abuse treatment outcomes will be assessed. All participants will be maintained on OAT after study completion.

Buprenorphine/Naloxone arm was removed from protocol in 2021.