Unlike those two candidates, Ms. Cabán would come into office unencumbered by ties to the borough power structure and free to pursue her commitment to serve the community by doing more than just winning convictions. Her seven years as a public defender have given her insight into how the system works, and how it ought to be changed.

If she succeeds Mr. Brown, Ms. Cabán is likely to face resistance from prosecutors, investigators, the police, even some judges and defense lawyers. Reshaping any entrenched, calcified bureaucracy requires a balance of patience and determination. She will need to recruit qualified, committed lawyers and get the department’s best on her side. To overcome her lack of management experience she will also need to surround herself with seasoned prosecutors, as well as true believers, expertly guiding a staff of about 700 to carry out meaningful reforms.

Ms. Cabán has said she would increase funding for programs that provide alternatives to incarceration, like drug treatment and mental health counseling, and stop prosecuting many minor, so-called broken-windows offenses, like fare beating , drug possession, welfare fraud and loitering.

As Brooklyn district attorney, Mr. Thompson, among the first of the new breed of prosecutors , proved that a committed outsider could get the job done. Though he had served as a federal prosecutor, he was elected with little management experience. Mr. Thompson, who died in 2016, made welcome progress toward ending prosecution for low-level marijuana offenses and reviewing convictions that occurred under his predecessor.

With a focused, steady approach, Ms. Cabán can build on Mr. Thompson’s legacy of reform, and forge her own. If she wins the primary, she will most likely face Daniel Kogan, the only Republican in the race, in the Nov. 5 general election.

Ms. Cabán identifies as a queer Latina. She is of Puerto Rican descent and is the first in her family to graduate from college. She would bring a perspective suited to one of the world’s most diverse communities, one where elected officials have rarely reflected that reality.

The success of any prosecutor, and of the city itself, depends on keeping people safe. Ms. Cabán is the Democrat best poised to become one of a growing number of prosecutors to show that can be done without infringing on civil liberties, criminalizing black and Hispanic Americans and mistaking punishment for the only form of justice.