Objective To analyze the predictive factors for loss to follow-up of tuberculosis treatment in people deprived of liberty in the state of São Paulo, Brazil. Methods Retrospective cohort study. Data were collected from secondary sources on people deprived of their liberty notified of tuberculosis in the state between 2015 and 2017. The risk of loss to follow-up according to the exposure variables (sociodemographic, case detection, clinical and follow-up) was established by the crude Odds Ratio, which, when significant, were included in the multiple model with the forward method, determining their adjusted Odds Ratio. Results A total of 9,153 cases were included in the study, of which 6% were closed as loss to follow-up. In the multiple analysis, the predictor variables for loss to follow-up were: female gender; notification by certain coordinating bodies; re-treatment after abandonment, ongoing drug resistance without information, type of treatment without information and need for hospitalization. Conclusion The study’s findings highlight the importance of raising awareness among health professionals in prisons about identifying the risk profile for loss of follow-up in tuberculosis treatment among people deprived of their liberty. This includes women detained in the metropolitan region, in pre-trial detention centers and prison progression centers. In addition, this should include people in post-abandonment retreatment, in need of hospitalization and without information on drug resistance and type of treatment.