When Sandra was arrested for smuggling drugs into a men’s prison in 2015, she accepted it as part of the familiar cycle of her life. She’d been in and out of detention since she was 14, when she moved on to the streets, fleeing abuse at home.

But a lot has changed in the penal system since Sandra, whose last name has been omitted for privacy, first arrived at Costa Rica’s only women’s prison in the 1990s. The institution changed names, the soccer field crumbled into a river during a rough rainy season, and the prison population exploded, growing by upwards of 50 percent nationwide between 2006 and 2012.

Following Sandra’s most recent arrest, she learned of an even more profound change: her life experiences would be studied and taken into consideration during sentencing, and there were alternatives to going to jail.

The narcotics-law reform that resulted in Sandra going to rehab, getting job training, and serving three years of probation instead of years behind bars is known as 77-bis. The law is narrow – it only applies to women arrested for smuggling drugs into jails – but it’s revolutionary in a region that prioritizes hard-line punishments for drug crimes. As organized crime carves out deeper and more far-reaching paths across the Americas, most citizens and politicians are arguing for solutions that result in more people, and more time, behind bars.