To prevent imprisonment in the first place, community-based services need to be strengthened and more widely used, especially for substance use, sexual and reproductive health and mental health; these should also provide adequate care on release from prison.