Inmates in a Chicago jail have been offered pizza as a reward for abstaining from masturbation for 30 days, a lawsuit alleges.

Female lawyers in the city's main prison say they have faced chronic masturbation and constant sexual harassment from detainees, and a system to reward abstainers with pizza has worsened the situation.

A class action lawsuit filed on behalf of female law clerks and assistant attorneys in the Cook County Public Defender’s Office describes a deteriorating security situation.

It says employees are routinely subjected to harassment and abuse from male detainees at Cook County Jail and courthouses – and that both the Cook County Sheriff’s office and the Cook County Public Defender’s Office have failed to protect them.

“They are forced to regularly endure heinous sexual misconduct,” the lawsuit alleges, adding that male detainees threaten to assault attorneys, deliberately expose themselves to female employees and masturbate at them.

When the issue was brought to Sheriff Thomas Dart and Public Defender Amy Campanelli, the lawsuit alleges, they acknowledged the problem was “severe and pervasive” but didn't take effective steps to stop it.

In fact, the lawsuit claims, they made matters worse. It says Mr Dart created a system to reward offenders with pizza if they went 30 days without publicly masturbating or exposing themselves.

But that only encouraged people who hadn’t committed such offences to do so so they could abstain and, 30 days later, obtain their reward, according to the lawsuit.

“The sheriff’s rewards for intermittent indecent exposure and/or masturbation led to an increase in exposure incidents as detainees without prior incidents were now incentivised to commit indecent exposure and masturbation in order to qualify for a pizza reward,” it says.

Shocking photos emerge of suspected Isis fighters held in overcrowded prison

A representative for the Cook County Public Defender’s office did not respond to a request for comment. Cara Smith, chief policy officer for the Sheriff’s department, called the allegations of a pizza reward system “absurd” and “an absolute untruth with no basis in fact”.

“The safety and security of our staff – including our female corrections officers – is of paramount concern to the sheriff and our office, and we’re going to continue to do everything we can to address this despicable criminal behaviour by the detainees,” Ms Smith said.

“Indecent exposure in correctional settings is unfortunately a reality,” she added, “and we use a lot of different techniques to try and address the behaviour”.

Documents filed with the case show the public defender has tried to curb the abuse for some time. Months before the lawsuit was filed, Ms Campanelli pleaded with the sheriff to address the simmering “crisis”.

In a March letter filed along with the complaint, the public defender warned detainees were regularly exposing themselves to female law clerks and attorneys, creating an “intolerable” situation and compromising her office’s work as staff began to fear speaking with abusive clients.

She faulted Mr Dart’s response, saying he responded to a request for better security by shackling inmates.