The newest wrinkle to the Bill Cosby saga is one that could bring the entire criminal case against the 78-year-old entertainer toppling down.

Lawyers will argue at Cosby's Feb. 2 hearing whether an agreement between Cosby and former Montco D.A. Bruce Castor that the office would not prosecute must be honored by current DA Kevin Steele.

Steele doesn't think the agreement was valid, telling CNN, "There is a specific legal method to grant immunity. That was not done in 2005."

RELATED: Cosby case brings up definition of rape

Cosby's lawyers said in a court filing to dismiss the case that he only testified in a deposition for a lawsuit filed by alleged victim Andrea Constand without invoking his Fifth Amendment rights to non-self-incrimination because of the non-prosecution agreement with Castor.

"The Commonwealth, through then-District Attorney Bruce Castor, promised in 2005 that Mr. Cosby would not be charged in connection with these allegations, in exchange for Mr. Cosby giving testimony in the complainant's civil case against him," states a motion by Cosby's lawyers to dismiss the charges against him. 

Castor's successor Steele "not only breached the agreement, but in the probable cause affidavit is using the very testimony Mr. Cosby provided in reliance on that agreement against him as a basis for the charges," the motion states.

RELATED: Tiny town bore brunt of Cosby media circus

Steele has acknowledged the criminal complaint charging Cosby with aggravated indecent assault is based heavily on that deposition, which was unsealed in federal court in July after requests by the Associated Press.

Castor also reportedly emailed the office of Steele's immediate predecessor, DA Risa Vetri Ferman, to remind her of his agreement with Cosby.

But there is no version of this agreement on the record. It appears to have been a oral agreement between Castor and Cosby's old attorney, Walter M. Phillips — who died in February, 2015.

RELATED: Cosby victim thought drug was 'medicine,' kept silence for a year: docs

Defense attorneys say such an agreement would be unenforceable.

"Nothing 'off the record' binds a prosecution office, especially when the leadership changes and the new chief can't be accused of unethical backtracking," said Ephraim Savitt, a New York defense lawyer. "What a good defense attorney should do is to get the DA to commit to no prosecution in writing ... That was not done here, so it's open season on ex-Doctor Huxtable."

Without a letter or email memorializing the agreement, much less a formal on-the-record agreement, any deal with Castor won't hold up in court, Savitt opined. 

"Formal transactional immunity from prosecution ... would have been needed for giving the Coz a complete pass forever, at least from state prosecution," he said.

Other lawyers said the question is difficult and may need to go to a higher court, potentially delaying 78-year-old Cosby's trial even longer.

"The general rule is that off the record promises between attorneys are not enforceable," New York defense lawyer Scott Cerbin said via email. "I think the answer is, at best, unclear and the issue may have to be decided in the appellate courts."

At any rate, Castor, who recently deleted his social media accounts after being intensively questioned about his handling of the Cosby case is standing by the agreement, will testify to the agreement at Cosby's Feb. 2 hearing on the defense's motion to dismiss.

Cosby's preliminary hearing, at which prosecutors need to make out a prima facie case to get the charges held for trial, remains to be re-scheduled.