Two weeks after Chesa Boudin took the oath of office as San Francisco’s newest district attorney, the city’s top prosecutor announced Wednesday that his office will no longer ask for cash bail as a condition for defendants’ pretrial release.

The policy, in which prosecutors will use a “risk-based system” that weighs whether a defendant might flee or poses a threat to public safety, fulfills one of Boudin’s key campaign pledges before his election in November. The former public defender has often said the cash bail system unfairly affects indigent defendants and people of color.

“For years I’ve been fighting to end this discriminatory and unsafe approach to pretrial detention,” Boudin said in a statement. “From this point forward, pretrial detention will be based on public safety, not on wealth.”

The shift to remove cash bail goes a step further than Boudin’s predecessor, George Gascón, who scaled back requests for cash bail by introducing an algorithmic risk assessment tool in 2016. The district attorney’s office on Wednesday said this tool “has allowed prosecutors and judges to preserve the constitutional protection of presumed innocence, while maintaining public safety through objective data.”

Human Rights Watch, a nonprofit network of journalists, attorneys and policy experts that reports on abuses, has published studies that found the pretrial release of defendants who pose no threat to public safety did not result in increased crimes or more missed court dates.

“District Attorney Boudin’s policy is a great step towards a more just system,” said John Raphling, a senior researcher with the organization. “For too long, prosecutors have used money bail and pretrial incarceration as leverage to pressure people to plead guilty regardless of actual guilt. Boudin’s policy favoring pretrial release is a welcome change and will help build the credibility of our courts.”

San Francisco’s police union criticized Boudin’s decision.

“Mr. Boudin is in the process of building the largest criminal justice revolving door imaginable, and San Franciscans will pay a heavy price for it,” said Tony Montoya, president of the San Francisco Police Officers Association. “Relying solely on an arbitrary math equation regarding who remains in custody and who gets out early will endanger residents and police officers but it sure will make career criminals and gang members happy.”

Disparities in cash bail requirements in San Francisco have resulted in African American defendants paying an average of $120 per year for pretrial release compared to $10 for white defendants, according to the district attorney’s office. Officials said this kind of inequality has led to a transfer of wealth in communities of color to private industry.

Raj Jayadev, co-founder of the Silicon Valley De-Bug, said he was “excited” to see the end of money bail, an issue his community advocacy organization has challenged for years in Santa Clara County and other parts of the Bay Area.

“It is a scheme that shatters families, communities and lives, and the due process we claim is a right afforded to all,” Jayadev said. “If we are to move away from pretrial detention, and towards a just and safe community, it starts with ending the indefensible ransom of money bail.”

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: evan.sernoffsky@sfchronicle.com Twitter: @Evan Sernoffsky