The secret weapon in Harvey Weinstein’s legal arsenal is a former NYPD detective who worked in the Manhattan district attorney’s office for years and is now using that experience as a private eye to punch holes in their case against the former Hollywood mogul accused of rape.

Herman Weisberg is the man the rich and famous turn to when they need someone investigated, or to shut down blackmail plots and extortion threats. Current and former associates describe him as a “bloodhound” investigator with an expertise in finding and interrogating witnesses. That includes Weinstein’s defense attorney, Benjamin Brafman, who credits Weisberg for a recent string of successes against prosecutors.

“Whatever success I may have in the Weinstein case, Herman has played a substantial part in those accomplishments,” Brafman told The Daily Beast. “In the Weinstein case, he has extraordinary success to date in helping me uncover materials which demonstrate that several of the important prosecution witnesses in this case may have not told the truth in the claims they made against Mr. Weinstein.”

Last week Brafman filed a motion to dismiss all the counts against his client after it was revealed the lead NYPD detective in the case, Nicholas DiGaudio, hadn’t told the D.A.’s office about a witness with potentially exculpatory evidence before Weinstein was indicted this past spring. In the motion Brafman laid out a new text message from one of Weinstein’s accusers, Mimi Haleyi, in which she sought to meet up with the producer seven months after the alleged assault.

In another instance, DiGaudio told an alleged Weinstein victim she could delete text messages she deemed unimportant to the investigation. “It’s ridiculous” how Vance’s office has handled DiGaudio, who has since been sidelined, said a former senior investigator with direct knowledge of the case.

“ You don’t want Herman and one of his colleagues standing at your doorstep. ” — attorney Jeremy Saland

While Brafman was tight-lipped about Weisberg’s work in the ongoing case, a fellow high-powered defense attorney who uses the P.I. suspected what he has been doing.

“I am overwhelmingly confident that one of his roles is determining the credibility of the witnesses,” said Jeremy Saland, who worked with Weisberg in the Manhattan D.A.’s office when he was a prosecutor. Since then Saland said he has used the P.I. on several major investigations in private practice over the past eight years.

Weisberg, 52, started in the 1990s as a beat cop in Queens and worked undercover on the NYPD’s vice squad, as a narcotics investigator and on the dignitary protection unit, serving on details that included protecting Vice President Al Gore and President George W. Bush when they visited New York.

As a detective, Weisberg was detailed to the D.A.’s Manhattan office, where he was one of roughly 20 members of a hand-picked team that worked under former D.A. Robert Morgenthau and for the first few years Cyrus Vance—the same D.A now prosecuting the Weinstein case.

During his time as a detective assigned to the Manhattan D.A.’s office, Weisberg helped investigate extortion plots against NBA star Carmelo Anthony in 2004 and comedian David Letterman in 2009, both of which led to convictions.

“Herman is the guy in the field. He’s the one who’s the knock at the door you don’t want at the break of dawn or late at night. You don’t want Herman and one of his colleagues standing at your doorstep,” Saland said.

A former senior prosecutor under Vance said that Weisberg was generally well-liked by prosecutors who worked with him in the Manhattan D.A.’s office and since leaving the NYPD in 2010 has been seen at several parties thrown by former prosecutors.

Another former high-ranking prosecutor who worked alongside Weisberg in the D.A.’s office said he has “the ability to be a gumshoe and interview people. He is a tenacious investigator.”

Saland described a shakedown where Weisberg’s experience helped save his client, a married man who was being extorted by a woman after the two used cocaine and had sex in his home. When they were done, the woman demanded hush money.

With the help of Weisberg, Saland had the man make a “controlled call” from his law office, one that is recorded under their supervision to gather incriminating evidence that would be admissible in court. After the call, they arranged a face-to-face meeting—but instead of the client, “I had Herman go,” Saland said.

“Herman confronted this person,” Saland continued. “Herman went out and met her and advised her of the error of her ways and told her to stop. He lays out the next time it might not be us, it could be law enforcement. They need to be aware you can’t extort, you can’t blackmail, you can’t stalk. To a certain extent, the law speaks for itself.”

Saland said Weisberg has worked on a range of cases that include everything from accusations of white collar crime, extortion, and revenge porn and Weisberg’s work has included wiring people, meeting with witnesses, confronting victimizers who are attacking clients with revenge porn or blackmail.

“I would describe him as a trusted investigator who plays by the books but also has the skill set of being able to testify at trial,” Saland said. “He is the go-to guy because of his ethical foundation and know-how. He has a unique combination. I know that he’s going to get it done and I trust him.”

The former high-ranking prosecutor said while it may seem odd for a former law-enforcement officer to work for accused criminals, it’s not wrong.

“They are entitled to a zealous defense. In our system if you are working for an attorney as an investigator it’s your job to discredit every witness against your client. That’s the system we have.”