A former coder for the Central Intelligence Agency says he’s been thrown into solitary confinement under conditions amounting to “torture,” preventing him from defending himself against charges that he leaked some of the CIA’s most important secrets to WikiLeaks.

Joshua Adam Schulte, 30, was charged last June under the Espionage Act for allegedly leaking the trove of 8,000 CIA files that WikiLeaks published last year under the rubric “Vault 7.”

The files had been copied from an internal agency wiki at some point in 2016, and contained documentation and some source code for the hacking tools used by the CIA’s intrusion teams when conducting foreign surveillance.

Last December, U.S. District Judge Paul Crotty of the Southern District of New York revoked Schulte’s pretrial release and ordered him held without bail, a decision upheld in March by a three-judge panel of the Second Circuit Court of Appeals.

In a letter to Judge Crotty filed Monday but postmarked October 23, Schulte accuses officials at Manhattan’s Metropolitan Correctional Center of interfering with his defense and subjecting him and his fellow inmates to “cruel and unusual punishment” in the detention center’s segregation unit.

“The shit-filled showers where you leave dirtier than when you entered; the flooding of the tiers and cages with ice cold water; the constant blast of cold air as we are exposed to extreme cold without blankets or long-sleeve shirts; the uncontrollable lights that are always on as we are sleep deprived.... No human being should ever have to experience this torture,” he wrote.

The jailhouse plea appeared on the public docket in Schulte’s case on Monday, but was later removed with a notation that it had been “incorrectly filed in this case.”

The claims carry an echo of the first WikiLeaks espionage prosecution against former Army intelligence officer Chelsea Manning. Manning spent nearly a year under solitary confinement, locked in her cell for 23 hours a day and often forced to give up her prison jumpsuit at night. A military judge later ruled that Manning had been “illegally punished” and awarded her an extra 112 days off her sentence because of the mistreatment.

As Schulte tells it, jail officials abruptly placed him in solitary confinement on October 1 pending the conclusion of an unspecified investigation. Since then he’s been refused access to his legal papers and hasn’t been permitted to phone his lawyers, he claimed, preventing him from coordinating a new bid for pretrial release.

“[T]hey tell me I'll be here indefinitely while they ‘investigate’—which just means they will hold me in this hell forever while they do nothing,” he wrote. “I am unconvicted. I am an American. I am a human being. How is it I should be subjected to this?”

“Terrorists receive better treatment in Guantanamo Bay, Cuba—I have seen the footage myself,” wrote Schulte, who worked at the CIA from 2010 to 2016 and held a top-secret clearance.

Schulte asked Judge Crotty to order the Bureau of Prison “to give me back my legal work and discovery they stole from me; to give me back access to the public defender phone to contact my lawyer during the day; to give me access to finish typing and emailing my attorney the motion response; to give me access to pens and papers and legal books; to give me access to medical and my blood pressure medication.”

In the letter, Schulte also argues the case against him was built on sworn FBI search-warrant affidavits that misstate facts. “This entire case is a lie, but don’t take my word for it—read it for yourself,” Schulte wrote. Schulte and his lawyers have not challenged the search in court.

In addition to espionage, hacking, and related crimes, Schulte’s federal indictment charges him with possession of child pornography because of images the FBI found on his hard drive while investigating the WikiLeaks dump. He’s also charged in an unrelated sexual-assault case in Loudoun County, Virginia. A trial in the New York case is tentatively set for April.

The Metropolitan Correctional Center and Schulte’s lead defense attorney did not respond to inquiries for this story.