People with mental disorders can receive treatment in the community. Some, however, fall out of services and into the criminal justice system, running the risk of imprisonment and a deteriorating mental health cycle. This editorial describes Mental Health Treatment Requirements (MHTRs), that is court-imposed sentences that enable people in the UK to access treatment in the community and divert them from short custodial sentences. MHTRs have proven successful for people with primary care mental health needs. It remains difficult to secure these sentences for people with secondary care mental health needs. Three new ‘proof of concept’ sites for secondary care MHTRs may help understand barriers and find solutions.