“It’s rare that a California lawmaker seeking a policy model would turn to Kentucky. But with the Legislature on summer recess, that’s precisely what Sen. Bob Hertzberg is doing.

The mission: travel to the Bluegrass state to investigate how Kentucky gets its defendants awaiting trial to show up for court dates and keep them from committing crimes—all without locking them up. Civil rights advocates point to Kentucky as a shining example of reform, and Hertzberg, a Democrat who represents the Los Angeles suburb of Van Nuys, is convinced California ought to take notice.

He contends California’s use of bail has spun out of control—costing five times the national average, and leaving thousands of poor people behind bars awaiting trial while the rich go free.

“The system is upside down,” Hertzberg says. “It’s unconstitutional, and I think there are people using excessive bail to keep people in jail.”

Historically, courts used bail to ensure people charged with a crime showed up for court. Then  judges began to levy high bail as a way to increase the odds that people charged with serious crimes remain locked up until trial. In California, anybody who can’t afford bail can contract with a bail bond company, which then guarantees their bail according to a county bail schedule that lists amounts by crime. In return, the arrestee pays the bail company a 10 percent nonrefundable fee.

Hertzberg is carrying controversial legislation that would require all of California’s 58 counties to create “pretrial services agencies” to screen the arrested and conduct a formal risk assessment. Local magistrates, judges or court commissioners could use that guidance to recommend release, as opposed to bail, if the accused isn’t found to be a danger to society or a flight risk.

The premise: A thorough evaluation and supervision could allow someone—while awaiting trial—to reunite with family and return to work rather than sit in jail.

Civil liberties groups champion the risk assessment as a way to objectively and, they say, scientifically determine who can be safely released. But law enforcement, judges and the bail industry argue the bill would burden courts, saddle counties with huge costs and is far too lenient on criminals.

“SB 10 creates a new complex structure,” Elizabeth Ratinoff of the Los Angeles County District Attorney’s office told lawmakers last month. “It is fair to some, but not to others, and the language that says all of that is confusing.”

Sacramento County Superior Court Judge Steve White, president of the Alliance of California Judges, said the bill would result in “a near shutdown of the court system” and pose “a serious risk to public safety.”

“We recognize that not everyone has the ability to post bail pending trial. We address that concern by adjusting bail amounts and releasing defendants on their own recognizance or on pretrial release under appropriate circumstances,” White wrote in a May letter opposing the bill.

Critics contend that California’s current bail system is a hardship for many, and is particularly punitive to the poor.

“The whole criminal process is class discrimination,” says Malcolm Feeley, a law professor at the University of California, Berkeley, who has written about bail reform and argues the poor are the ones most often arrested and charged with crimes.

A handful of states don’t allow private bail bonds, opting for supervised release or bonds with the court for eligible defendants. California’s Constitution guarantees a person’s right to bail, but excessive bail is prohibited by the U.S. Constitution.

The concern about excessive bail, along with jail overcrowding, have led a growing number of states and local jurisdictions to embrace the risk assessment idea. Those who have created their own pretrial services include not only Kentucky but also Arizona, Colorado, Virginia and Washington, D.C.

Lawmakers in Illinois, Connecticut, Maryland and New York have legislation pending to remake the money bail system. Meanwhile, class action lawsuits targeting bail have been filed in Illinois, Louisiana, Texas, Georgia, Tennessee, Missouri, and Massachusetts, according to the Equal Justice Under Law, a nonprofit civil rights organization.

In the U.S. Senate, California Democratic Sen. Kamala Harris and Kentucky Republican Sen. Rand Paul teamed up to introduce a federal bail reform bill.

“We’ve worked for years to get people to acknowledge there was something wrong with the money bail system,” said Cherise Fanno Burdeen, chief executive officer of the Pretrial Justice Institute, a nonprofit Maryland advocacy group. “All of a sudden, it’s like a fire hose. The movement is washing…across the country.”

A 2015 report by the Public Policy Institute of California that found that even with California’s median bail at $50,000—five times the national average—the state was no better than the rest of the country at getting defendants to appear in court or keep them from committing a crime.

Across the state’s jails, there are twice as many “unsentenced” inmates than those who are serving a sentence after conviction, according to Jail Profile Survey data made available by the Board of State and Community Corrections website. A query showed 48,349 un-sentenced inmates compared to 25,111 who had been convicted as of December 2016, the most recent figures available.

Nationally, 434,600 un-convicted felony inmates sat in jails across the country, according to 2015 figures released by the U.S. Bureau of Justice Statistics. That number (which excludes misdemeanors) is high, in part, because judges nationwide have become more reliant on bail. The percentage of pretrial releases with financial conditions climbed from 37 to 61 percent between 1990 and 2009.

It’s hard to know, however, exactly how many people are in jail because they can’t afford bail. Neither state nor federal authorities collect such statistics.

Nine in 10 defendants nationwide are in jail because they have not posted bond, according to one figure circulated by the Pretrial Justice Institute.

But the Judicial Council of California contends that “a significant portion” of people in jail are there because of  probation, parole or immigration holds, or because they’ve skipped previous court appearances.

“It’s a movement that’s being pushed on our voters and citizens with a false narrative,” said Topo Padilla, president of the Golden State Bail Agents Association. “This is being pushed as if poor people are languishing in jail. The reality is that people who are being charged with a crime are languishing in jail.”

Rather than create a new government-run entity, Padilla argues the Legislature should start with a simple reform: Reduce California’s high bail amounts, something bond agents say they tried to get through the Legislature about six years ago.

The state Senate passed Hertzberg’s bill in May over the objections of Republicans who defended the bail system as critical to the courts and law enforcement.

“This is another piece, if you will, in the destruction of the criminal justice system in this state,” Republican Sen. Jim Nielsen of Gerber argued in a floor debate.

The bill faces an uncertain future in the Assembly, which narrowly rejected a similar bill by Democratic Assemblyman Rob Bonta of Oakland earlier this summer. Bonta and Hertzberg have since worked together to amend SB 10 in hopes of addressing critics’ concerns—giving judges more discretion, ensuring victims are given notice before a defendant is released, and allowing a prosecutor to freeze a defendant’s assets in certain cases.

Hertzberg pledged to further amend the bill to address law enforcement concerns about people charged with violent felonies who could be released under the current version of the proposal. It already prevents the release of people accused of certain violent crimes, such as murder or a violent sexual assault. And it actually strengthens existing law to ensure that people charged with serious crimes can’t post bail without a hearing.

“I don’t want to write a law that’s not going to work or isn’t tough on crime,” Hertzberg said. “There’s a problem that exists, and I want to fix it.”

One county that has an existing pretrial services department is Santa Clara County. It estimates saving the county roughly $265,000 a day in detention costs by supervising roughly 1,380 defendants in the community.

The cost to supervise a released defendant runs about $13 a day, says Aaron Johnson, director of the Office of Pretrial Services for Santa Clara County. That’s much less than the $205 a day it would cost to put them in a Santa Clara jail. And the department reports a 96 percent success rate of supervised defendants showing up for court dates, and a 99 rate of defendants remaining crime-free until trial.

“We have the numbers, we have the ability to show the outcomes that people were skeptical of,” Johnson said. “There are better alternatives to keeping people in jail.”

Back in Kentucky, where a pretrial services program took effect in 1976, roughly 90 percent of defendants make all future court appearances and 92 percent don’t get rearrested, according to the program’s executive officer, Tara Boh Blair.

Still, the upfront costs to create these entities in each county concern some lawmakers.

“I just don’t see without spending a lot of money, a lot of money, in big counties how this works. And in small counties, to be honest,” said Democratic Assemblywoman Lorena Gonzalez Fletcher of San Diego, who chairs the Assembly Appropriations Committee where the bill will be heard next.

She’s warning the bill’s authors “to sit down and do the hard work” to modify the measure so it can win the Assembly support necessary to land on the governor’s desk.

Samantha Young is a contributing writer at CALmatters.org—a nonprofit, nonpartisan media venture explaining California policies and politics.