For a dollar an hour and credit toward early parole, more than 1,700 convicted felons fought on the front lines of the destructive wildfires that raged across Northern California this October. While communities from Sonoma to Mendocino evacuated in the firestorm’s path, these inmates worked shifts of up to 72 straight hours to contain the blaze and protect the property residents left behind, clearing brush and other potential fuel and digging containment lines often just feet away from the flames. Hundreds more are on the fire line now, combatting the inferno spreading across Southern California.

Inmates have been fighting California’s wildfires since the 1940s, when the state first called up prisoners to replace men assisting the war effort. More than 3,700 men and women—and even some juvenile offenders—now voluntarily serve on the force. Collectively, they make up roughly a third of the state’s wildfire-fighting personnel, and work an average of 10 million hours each year responding to fires and other emergencies and handling community-service projects like park maintenance, reforestation, and fire and flood protection.

But over the course of the last decade, their ranks have begun to thin. As drought and heat have fueled some of the worst fires in California’s history, the state has faced a court mandate to reduce overcrowding in its prisons. State officials, caught between an increasing risk of wildfires and a decreasing number of prisoners eligible to fight them, have striven to safeguard the valuable labor inmates provide by scrambling to recruit more of them to join the force. Still, these efforts have been limited by the courts, public opinion, and how far corrections officials and elected leaders have been willing to go: The number of inmate firefighters has fallen 13 percent since 2008.

This push-and-pull between changing carceral policy and the demands of firefighting is unlikely to abate anytime soon, and surely not before the next fire season begins this spring. After a series of intensely destructive seasons linked to climate change, scientists are projecting that California will face still more disastrous blazes in the future; at the same time, voters and officials are contemplating further reducing imprisonment around the state. The fate of the inmate-firefighting program lies in the balance between these trends: buoyed by the increasing need for cheap labor, threatened by the pending decline in incarceration.

For inmates, the reduction in state prison populations that first nudged that balance was long overdue. In the 1990s and 2000s, increasingly severe overcrowding in California prisons compromised medical services for prisoners and led to roughly one preventable death each week. A federal court ruled in 2009 that the inadequate health care violated the Eighth Amendment’s embargo against cruel and unusual punishment, and ordered the state to reduce its prison population by just shy of 27 percent—a cut of nearly 40,000 prisoners at the time of the ruling. California appealed the decision, but the Supreme Court upheld it in May 2011.

In the years since, the state and its voters have enacted a series of criminal-justice reforms that have removed or redirected tens of thousands of inmates from state prisons, sending them to county jails or back out into the public. The measures, which brought the prison population below court-mandated levels beginning in January 2015, dramatically reduced the number of low-security inmates in state prisons—just the sort the California Department of Corrections and Rehabilitation recruits to serve on the firefighting force with promises of better pay and better living conditions.

The pool of potential recruits was limited long before the courts’ mandate. It comprises only inmates who earn a minimum-custody status through good behavior behind bars and excludes arsonists, kidnappers, sex offenders, gang affiliates, and those serving life sentences. To join the squad, inmates must meet high physical standards and complete a demanding course of training. They also have to volunteer.

“But,” cautioned David Fathi, the director of the ACLU’s National Prison Project, “you have to understand the uniquely coercive prison environment, where few things are clearly voluntary.” In the eyes of criminal-justice reformers, corrections officials recruit inmates under duress. “In light of the vast power inequality between prisoners and those who employ them,” Fathi continued, “there is a real potential for exploitation and abuse.”

Many inmates join the force to escape unpalatable prison conditions. In doing so they take on great personal risk, performing tasks that put them in greater danger than most of their civilian counterparts, who work farther from the flames driving water trucks and flying helicopters, among other activities. By contrast, inmates are often the first line of defense against fires’ spread, as they’re trained specifically to cut firebreaks—trenches or other spaces cleared of combustible material—to stop or redirect advancing flames. The work can be fatal: So far this year, two inmates have died in the line of duty, along with one civilian wildland-firefighter. The first, 26-year-old Matthew Beck, was crushed by a falling tree; the second, 22-year-old Frank Anaya, was fatally wounded by a chainsaw.

“Obviously this is not something that everyone is willing to volunteer for,” said Bill Sessa, a CDCR spokesman. “We’ve always been limited by the number of inmates who were willing to volunteer for the project.” Even when state prisons were at their most crowded, the camps where inmate firefighters live weren’t filled to capacity. And as the pool of qualified prisoners has contracted, he said, corrections officials have had to “work harder now than we did before to bring the camp to the inmates’ attention.”

That’s meant making more prisoners aware of the “many advantages ... that can benefit [them] immediately if they choose to volunteer,” as Sessa put it.  “You’re more out in the open, you’re not behind an electrified fence,” he explained. “It’s perhaps a little more welcoming for family visits than going through the electric detectors inside a prison. They get paid well by prison standards. They eat better by prison standards. They also get to accelerate time off their sentence faster than other inmates do.”

Sessa’s description isn’t wrong, strictly speaking. In exchange for typical prison work—say, mopping floors or making license plates—California inmates receive between 8 and 95 cents an hour. By contrast, fire-camp inmates can receive much higher pay: one dollar an hour when they’re actively fighting fires, and two dollars a day when they aren’t.

But they still receive very little in return for risking their lives, and for doing work that’s unusually valuable to the state and to its residents. They regularly pull 24-hour shifts for less than a tenth the wages of even their lowest-paid civilian counterparts, with no pensions, workers’ compensation, or promise of future employment. At the end of their shifts, when civilian firefighters return home, the inmates remain in state custody. And they don’t just protect buildings and belongings; according to CDCR, they also save state taxpayers an estimated $100 million each year—money that would otherwise be spent on civilian firefighters.

Inmate firefighters’ wages, controlled by the California legislature, have stayed the same in recent years despite the prison-population downturn. But officials have sought alternative means of keeping fire-camp populations up. When reforms first began redirecting inmates from state prisons in 2011, CDCR started recruiting from county jails to compensate for the reduced number of potential volunteers. This change made little difference, so in 2015 CDCR proposed expanding the pool of potential recruits to include more inmates serving longer sentences for violent offenses. (For at least 20 years, a portion of fire-camp populations has been made up of violent offenders who have earned minimum-custody status, though that wasn’t publicly known until 2015.) Following press reports on the proposal, and amid public criticism, CDCR officials abandoned those plans.

Another controversial—and ultimately unsuccessful—effort to maintain camp populations illustrates the tension between the state government’s competing priorities. In 2014, lawyers for the state attorney general’s office argued against extending a parole-credit program in federal court. Previously, for each day of good behavior, inmate firefighters earned two days’ credit toward their parole, while other state prisoners earned one. When federal judges ordered the state to extend the two-credit system, the lawyers argued that doing so would negatively affect the camps.

“Fire-camp placement has become increasingly difficult as the number of potentially eligible inmates has been diminished by realignment,” they wrote, referring to the major 2011 reform that relocated many non-serious, non-violent, and non-sexual offenders out of state prisons. “Extending two-for-one credits to all minimum-custody inmates at this time would severely impact fire-camp participation—a dangerous outcome while California is in the middle of a difficult fire season and severe drought.”

The lawyers’ argument, Fathi said, provided “a glimpse of a phenomenon [the ACLU is] concerned about: that the desire for this cheap and powerless and literally captive labor force will distort decision making about the criminal-justice system. … People should be incarcerated to protect public safety, not to provide cheap labor for either the government or for private employers.” Senator Kamala Harris, then serving as California’s attorney general, expressed a similar concern with her own staff’s argument. “The idea that we incarcerate people to have indentured servants is one of the worst possible perceptions,” she told ThinkProgress. “I feel very strongly about that. It evokes images of chain gangs.”

But Sessa and CDCR have a different assessment of the program. “Our primary mission as a corrections system or a department is to provide inmates with skills to improve their lives when they leave,” he said. “Our focus is on rehabilitation. [The argument made in federal court] did not at all reflect what we believe, or what the attorney general’s office believed either.”

In truth, he argued, CDCR’s focus is “on the benefit to the inmates” who live and work in the camps—not on emergency response or on the value the inmates provide to the state. It’s that benefit, he said, that has made corrections officials fight to maintain fire-camp populations as the number of prisoners has declined.

No matter the motivation, there’s a strong incentive for officials around California—from state assembly members to county supervisors—to seek out ways to keep inmates on the fire line despite reforms. California’s Department of Forestry and Fire Protection, known as Cal Fire, has been “working closely with CDCR in keeping [fire-camp] numbers up” by helping “entice other inmates to join the ranks,” said spokesman Scott Mclean. Cal Fire, which manages 40 of the state’s 44 fire camps jointly with CDCR, has also stepped up recruitment of civilians. Since 2011, the department has added 1,000 new people to its fire-protection staff.

More firefighters and more damaging fires translate to more spending: Also since 2011, Cal Fire’s annual fire-protection budget has swelled from $963 million to over $1.8 billion. At the same time, however, the state’s carceral spending has also increased, with additional funds going toward health care, county jails, and other reform-related costs even as prison populations have gone down. Magnus Lofstrom, a researcher with the Public Policy Institute of California, said the “only way to noticeably reduce corrections expenditures” is to once again significantly depopulate the state’s still-overcrowded prisons.

In the dry, hot, expensive years ahead, officials and voters could choose to implement more reforms. If they do, it could mean further stepping up recruitment among the inmates left behind (though CDCR has still found no way to broaden parameters). Or it could mean finally ending the state’s reliance on prisoners to protect Californians from natural disaster.