Bill Cosby  could be a free man today.

Cosby — cane in hand — was gingerly guided into the courthouse by 2 bodyguards.

The comedian’s lawyer will argue he got a solid promise from the former D.A. in suburban Philadelphia that he would NOT be prosecuted in the case of Andrea Constand. Based on that promise he sat for a deposition on Constand’s civil case where he admitted he had given her 3 half-pills of Benadryl before a 2004 sexual encounter. She says it was assault … he says it was consensual.

The former D.A. is scheduled to testify on behalf of Cosby … saying he indeed made the promise not to prosecute.

Read more:

Also On 101.1 The Wiz: