CHICAGO (CBS) — A federal judge is taking steps to halt the lewd behavior of Cook County Jail detainees who expose themselves to guards and public defenders, or engage in other sexual misconduct behind bars.

The order requires inmates with a history of indecent exposure, masturbation or sexual misconduct to be handcuffed at all times during courthouse visits, although it allows a criminal court judge to order an individual detainee unshackled. It requires detainees accused of such behavior to wear a jumpsuit that will thwart such action.

Sheriff Tom Dart did not object to the order.

U.S. District Judge Matthew Kennelly’s order follows a series of lawsuits by female Cook County jail guards and assistant public defenders complaining that Dart has failed to stop daily occurrences of detainees masturbating in front of them.

“The safety of our staff is paramount,” said Cara Smith, Dart’s Chief Policy Officer. “The order entered today reflects an agreement among the parties by which our office will continue to do what we have been doing to protect our staff and others from the despicable behavior by some detainees in our custody. The provisions of the order reflect what we have long been doing to address this outrageous behavior.”

Kennelly issued his order for “the pendency” of the lawsuits filed by the jail guards. It also requires the sheriff to prohibit retaliation against anyone who participates in the litigation or reports an incident. .

The judge issued a similar order in the case involving the public defenders.

(CBS Chicago and the Sun-Times Media Wire contributed to this copy. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Watch & Listen LIVE