In 2009, California High Desert state prison inmate Michael Bloom was put in a small cage and told to strip naked. Two correctional officers put his boxers on backwards and taped them to his body, wrapping the tape around his waist and thighs numerous times.

Then they put a second pair of underwear on him, facing the front, and taped those to his body. They dressed him in a jumpsuit and wound tape around his ankles, waist, thighs, and biceps. Then they put another jumpsuit on him, backwards, and taped it the same way. His legs were chained to one another at the ankles and his wrists were shackled to a chain around his waist.

Thirty-three year old Bloom, imprisoned in 2007 for assault with a firearm and first-degree robbery, was then put in a cell, empty of everything but a metal bed. A correctional officer sat directly in front of his door and watched him constantly. At night, he was brought a thin mattress, but the bright lights were left on. He wasn’t given a blanket or anything to cover his eyes. He remained shackled as he tried to sleep. His chains dug into his back and wrists.

“By the second day I was already getting sores on my ankles since the leg cuffs were cutting into my skin,” he wrote. “At times I wanted to separate my legs so bad to stretch out that I would use all my strength to do it but the cuffs just dug deeper into my ankles.”

He remained like this for eight days. Some nights, correctional officers would force him to stand every 15 minutes and turn in a circle, preventing him from sleeping. At meal times, some guards refused to loosen his chains, so he had to bend over to eat directly off the tray with his mouth.

This is how Bloom recounted his experience, via written correspondence with the Guardian. He is one of hundreds of California inmates subjected to “contraband surveillance watch”, a routine procedure the state authorities say is essential to check the smuggling of drugs, weapons and other illicit items in prisoners’ digestive tracts, but which critics say is “cruel and unusual” punishment akin to torture.

Corrections Department records show that California prisoners underwent the procedure at least 524 times last year.

The state’s Corrections Department declined to comment on Bloom’s case, but his account is similar to that of more than 20 other inmates who described their experience of the process.

Most of the details of Bloom’s recollection also align with the state’s official guidelines for the procedure. In fact, he was not subject to the full range of restraint devices authorized for use, some of which make it impossible for inmates to use their hands at all.

Bloom recounts that, when he had to defecate, guards took him to a small concrete yard where the tape was cut off his body, his clothes were brought down to his ankles, and he was surrounded by several guards, male and female, as he attempted to defecate into a receptacle. “As I would be standing there naked I felt violated, and I times I could not even go to the bathroom,” he said.

When he was successful, the guards would dig through his feces in search of contraband, in keeping with corrections department policy. For the eight days he remained on contraband surveillance watch, he was never allowed to bathe. The ordeal was much the same on an earlier occasion when he was put on contraband surveillance watch for 14 days.

Bloom says in the end he was not found to have ingested any contraband. According to records, less than half of California inmates who underwent contraband surveillance watch last year were found to have ingested illegal substances, most of which were drugs. One inmate last year was kept on contraband surveillance watch for 52 days before he was determined to be contraband-free.

“Being completely chained and taped up, placed in an empty cell with only a metal bed and a bright light that remains on 24 hours a day for numerous days. This is torture, no matter how you look at it,” Bloom wrote.

It is common for prisons around the country to have “dry cell” procedures that require suspected inmates to pass stool a number of times before they are released back into the general population, but not even Texas keeps inmates chained and shackled during the process like California does.

California corrections department spokesperson Jeffrey Callison says the practice has been in effect for at least 40 years. Over the years, a number of California prisoners have sued to challenge the practice, claiming it violates the eighth amendment ban on cruel and unusual punishment. But every case has failed so far.

Among those upholding California’s procedure is ninth circuit judge Jay Bybee, who signed off on a controversial Bush administration “torture memo” that said acts only constitute torture if they produce the sort of severe pain associated with organ failure or death.

In 2013, Bybee served on a three-judge panel that reversed a federal judge’s ruling in a case where Rex Chappell, an inmate at California state prison in Sacramento, claimed he was subject to cruel and unusual punishment while on contraband surveillance watch for seven days.

Chappell claimed he was chained to a bed and “forced to eat like a dog” since his restraints were not loosened for mealtimes. A district court had ruled that he was subject to unconstitutional sleep deprivation, since he was forced to sleep in shackles with no mattress and under bright lights that were never turned off. Bybee disagreed.

“I think it’s interesting that a guy who has notoriety for approving very similar practices [by US interrogators] approved what happened to Mr. Chappell,” says Chappell’s lawyer Caleb Mason. “The world seems to universally decry these practices as unconstitutional but with respect to Americans at home in our own prisons, the courts continue to uphold them. I find that troubling.”

Mason says prison officials get a “carte blanche” when it comes to combating drug trafficking. “Contraband watch has been upheld everywhere it’s been challenged … If what they did to my client is consistent with the eighth amendment, then prisoners have no protection against such treatment if there is contraband around, which in prison, there always is.”

In letters, other prisoners frequently complained of sleep deprivation and dehumanizing treatment.

One 34-year-old Pelican Bay state prison inmate, Brandon Brasier, wrote: “The cells you are placed in are small and have no air circulation (the air vents are covered with tape and no air escapes.) At times, the tape is removed and ice cold air is pumped in full blast to the point where you are literally shivering … No sheets or blankets are provided …

“You are lucky to get 15-20 minutes of sleep at a time due to the restraints … Whenever you want some water, they stick a straw through a small hole in the door and you are forced to drink it like some kind of animal or go without.”

The California corrections department would not permit the Guardian to visit a contraband surveillance watch cell.

“The practice is the worst I’ve seen of prison abuses,” said Laura Magnani, a program director at the American Friends Service Committee (AFSC). Her organization, a Quaker human rights group, has lobbied for tighter regulations of the practice in California.

A particular issue that AFSC pressed was Pelican Bay State prison’s use of restraint devices known by inmates as “hellboys”. The devices were made by correctional officers, Magnani said, fashioned out of large PVC tubes which were put over an inmate’s arm and extend from their fingers to their elbows. The tubes would be removed only for the inmate to eat and wipe himself after defecating. After the AFSC worked with state legislative staff to pressure the corrections department, the device was discontinued in 2011.

Many inmates say they formally requested to be X-rayed rather than be subject to contraband surveillance watch, but were routinely denied.

California Corrections Department spokesperson Jeffrey Callison says X-rays are intended for use in a medical setting, as they are not reliable surveillance tools and are potentially unsafe with repeated use. He also says that any use for involuntary contraband surveillance would require a search warrant from the state.

Yet alternatives exist. Prisons and county jails around the country are implementing low-dose X-ray machines similar to those used in airports that can detect foreign objects inside the body. Such machines can reportedly be used safely hundreds of times per year for each person.

Inmate Brent Taylor, 46, was denied an X-ray exam at High Desert State prison in 2008, he wrote in an internal prison complaint. Instead, he and his cellmate were dressed in a diaper, then a pair of underwear, then double jumpsuits and were taped up tightly with fiberglass strapping tape at the waist, thighs, ankles, and arms.

“We were put in a cell for four days taped up like this with waist chains and leg shackles and no mattress,” Taylor wrote. “We were given no bedding at night and in the day the heat of the two jumpsuits and all the tape was sometimes unbearable. The strapping tape was so tight it would cut off circulation. Often times it was taped directly to our skin and would rip hair and skin when in the process of taking it off.

“When we did use the bathroom we were only uncuffed long enough to get the jumpsuit down then cuffed back up. To wipe ourselves we had to do the best we could with our wrist chained to our waist. Often times we couldn’t get completely clean and the fecal matter would eat our skin … We were denied our psych medication.”

Callison, the California corrections department spokesperson, contends that contraband surveillance watch is justified because “contraband can undermine the safety of the facility and the community”.

Yet the proportion of inmates found to have ingested weapons is low — only 6 percent of people who underwent contraband surveillance watch last year. And metal should be even easier to detect than drugs. Corrections departments in other states and the federal system use special metal detecting chairs to find weapons. Callison said he was unaware of them.

This article was reported in partnership with The Investigative Fund at The Nation Institute, now known as Type Investigations.