Holly Joshi wore many hats in her 14 years as a police officer in Oakland, but no job was more significant than her work on the sexual exploitation of underage girls on the streets of the city.

It became her raison d’être and area of expertise during a career that included stints as a patrol officer and chief of staff to Police Chief Sean Whent.

In December, Joshi, 39, turned in her badge and service weapon and graduated with a master’s degree in leadership for social justice at St. Mary’s College. Last month, she took a job as deputy director of Youth Uprising, a nonprofit children’s advocacy group in East Oakland that serves as a sanctuary for kids from the violence in the streets. Thousands of children have taken art and health classes there and learned about careers and civic life.

It should come as no surprise that Joshi, who grew up in East Oakland, would feel a strong pull to return to her roots to give kids a chance to grow up and thrive. She carries around a childhood school picture as a constant reminder that she once walked the same streets as a child.

She followed in the footsteps of her father, Lt. Rick Hart, a 26-year veteran of the Oakland Police Department. But her mid-career change was motivated by the frustration she felt at encountering troubled young girls long after the damage was done.

“I felt ill-positioned to help,” she said in an interview at Youth Uprising last week.

“Where was the intervention when this child was 5?” she asked. “Because now she’s 15, and she’s a train wreck.”

“It just seemed insurmountable,” she said. “I’d pull a girl off the street, put her pimp in jail — and she’d be back on the street with a new pimp in two weeks.”

As a police officer, Joshi worked the streets and headed the department’s Vice and Child Exploitation Unit. She served on a human trafficking task force formed in 2011 by Attorney General Kamala Harris and created a joint task force with the FBI that brought resources and federal funding.

Joshi did undercover work as a decoy prostitute strolling the well-worn “track,” an area along International Avenue with an active sex trade.

“We had lots of success, winning awards and (national) TV features on how we were finding solutions to human trafficking, but at the end of the day I was still just responding (after the fact), and I wasn’t happy with that,” Joshi said.

Despite her penchant for a more humanistic approach to the victims of human trafficking, Joshi understood her role as a police officer. She toed the line.

“My view was different than some of my colleagues, but if you’re an Oakland cop, you’re an Oakland cop,” she said. “When you put on that blue uniform, you are putting on all the history (good and bad) that it carries.”

She has fought men, chased down murder suspects in West Oakland and flirted with violent pimps who tried to recruit her — all in the hopes that their own words will later be used against them in a courtroom.

It’s safe to say Joshi understands the role — and the need — for police to protect and serve the community — but she has lost faith in some of their methods.

“Let’s be honest — this ain’t working,” she said of enforcement strategies in Oakland and around the nation where too much force and too little empathy are applied.

“Picking yourself up by your bootstraps doesn’t work when you don’t have bootstraps,” Joshi said.

She believes there are no ready-made, easy solutions to reverse the mind-set — repeated like a mantra for generations — that leads to racial segregation and continues to divide many American communities today.

But after 14 years of trying to initiate positive change by enforcing the law, Joshi, a mother of three, is convinced the only way fix the problem is early intervention in children’s lives and a community commitment to keep them on track — and away from harm — until it’s safe for them to be on their own.

Chip Johnson is a San Francisco Chronicle columnist. His column runs Tuesdays and Fridays. E-mail chjohnson@sfchronicle.com Twitter: @chjohnson