MY PAINED RELATIONSHIP with government security started in 2007. I needed a job to help pay my way through college in Chicago, and the Transportation Security Administration's callback, for a job as a security officer at O'Hare International Airport, was the first one I received. It was just a temporary thing, I told myself — side income for a year or two as I worked toward a degree in creative writing. It wasn't like a recession would come along and lock me into the job or anything.

I hated it from the beginning. It was a job that had me patting down the crotches of children, the elderly, and even infants as part of the post-9/11 airport security show. I confiscated jars of homemade apple butter on the pretense that they could pose threats to national security. I was even required to confiscate nail clippers from airline pilots — the implied logic being that pilots could use the nail clippers to hijack the very planes they were flying.

Once, in 2008, I had to confiscate a bottle of alcohol from a group of Marines coming home from Afghanistan. It was celebration champagne intended for one of the men in the group — a young, decorated soldier. He was in a wheelchair, both legs lost to an I.E.D., and it fell to me to tell this kid who would never walk again that his homecoming champagne had to be taken away in the name of national security.

I quickly discovered I was working for an agency whose morale was among the lowest in the U.S. government. In private, most TSA officers I talked to told me they felt the agency's day-to-day operations represented an abuse of public trust and funds.

Until 2010 (just after the TSA standard operating procedure manual was accidentally leaked to the public), all TSA officers worked with a secret list that many of us taped to the back of our TSA badges for easy reference: the Selectee Passport List. It consisted of 12 nations that automatically triggered enhanced passenger screening. The training department drilled us on the selectee countries so regularly that I had memorized them, like a little poem:

Syria, Algeria, Afghanistan

Iraq, Iran, Yemen

and Cuba,

Lebanon, Libya, Somalia, Sudan

People's Republic of North Korea

People holding passports from the selectee countries were automatically pulled aside for full-body pat downs and had their luggage examined with a fine-toothed comb. The selectee list was purely political, of course, with diplomacy playing its role as always: There was no Saudi Arabia or Pakistan on a list of states historically known to harbor, aid, and abet terrorists. Besides, my co-workers at the airport didn't know Algeria from a medical condition, we rarely came across Cubanos, and no one's ever seen a North Korean passport that didn't include the words "Kim Jong." So it was mostly the Middle Easterners who got the special screening.

Most of us knew the directives were questionable, but orders were orders. And in practice, officers with common sense were able to cut corners on the most absurd rules, provided supervisors or managers weren't looking.

Then a man tried to destroy a plane with an underwear bomb, and everything changed.

WE KNEW THE full-body scanners didn't work before they were even installed. Not long after the Underwear Bomber incident, in December 2009, all TSA officers at O'Hare were informed that training for the Rapiscan Systems full-body scanners would soon begin. The machines cost about $150,000 a pop.

Our instructor was a balding middle-aged man who shrugged his shoulders after everything he said, as though in apology. At the conclusion of our crash course, one of the officers in our class asked him to tell us, off the record, what he really thought about the machines.

"They're s---," he said, shrugging. He said we wouldn't be able to distinguish plastic explosives from body fat and that guns were practically invisible if they were turned sideways in a pocket.

We quickly found out the trainer was not kidding: Officers discovered that the machines were good at detecting just about everything besides cleverly hidden explosives and guns. The only thing more absurd than how poorly the full-body scanners performed was the incredible amount of time the machines wasted for everyone.

It worked like this: The passengers stood between two enormous radiation sensors — each of the machines twice the size of a refrigerator — and assumed the position for seven seconds, feet spread shoulder-width apart, hands above the head, making Mickey Mouse ears. The images were analyzed for threats in what was called the I.O. room, short for Image Operator, which locked from the inside.

I.O. room duty quickly devolved into an unofficial break. It was the one place in the airport free of surveillance cameras, since the TSA had assured the public that no nude images of passengers would be stored on any recording device, closed-circuit cameras included.

The I.O. room at O'Hare had a bank of monitors, each with a disabled keyboard — which perfectly summed up my relationship with the TSA. I spent several hours each day looking at nude images of airline passengers with a keyboard that didn't work, wishing I could be doing what I loved: writing.

Most of my co-workers found humor in the I.O. room on a cruder level. Just as the long-suffering American public waiting on those security lines suspected, jokes about the passengers ran rampant among my TSA colleagues: Many of the images we gawked at were of overweight people, their every fold and dimple on full, awful display. Piercings of every kind were visible. Women who'd had mastectomies were easy to discern — their chests showed up on our screens as dull, pixelated regions. Hernias appeared as bulging, blistery growths in the crotch area. Passengers were often caught off-guard by the X-ray scan and so materialized on screen in ridiculous, blurred poses — mouths agape, à la Edvard Munch. One of us in the I.O. room would occasionally identify a passenger as female, only to have the officers out on the checkpoint floor radio back that it was actually a man. All the old, crass stereotypes about race and genitalia size thrived on our secure government radio channels.

There were other types of bad behavior in the I.O. room — I personally witnessed quite a bit of fooling around, in every sense of the phrase. Officers who were dating often conspired to get assigned to the I.O. room at the same time, where they analyzed the nude images with one eye apiece, at best. Every now and then, a passenger would throw up two middle fingers during his or her scan, as though somehow aware of the transgressions going on.

But the only people who hated the body scanners more than the public were TSA employees themselves. Many of my co-workers felt uncomfortable even standing next to the radiation-emitting machines we were forcing members of the public to stand inside. Several told me they submitted formal requests for dosimeters, to measure their exposure to radiation. The agency's stance was that dosimeters were not necessary — the radiation doses from the machines were perfectly acceptable, they told us. We would just have to take their word for it. When concerned passengers — usually pregnant women — asked how much radiation the machines emitted and whether they were safe, we were instructed by our superiors to assure them everything was fine.

Then, in March 2012, a blogger named Jonathan Corbett published a video on YouTube, titled "How to Get Anything Past the Full Body Scanners." In it, Corbett revealed one of the greatest weaknesses of the scanners, known to everyone I talked to within the agency: A metal object hidden on the side of the body was invisible to an image operator. Corbett showed how a passenger could bring a pistol to the airport and get it past the full-body scanners and onto a plane.

More than a million people saw the video within a few days of its being posted. Finally, the public had a hint of what my colleagues and I already knew. The scanners were useless. The TSA was compelling toddlers, pregnant women, cancer survivors — everyone — to stand inside radiation-emitting machines that didn't work.

Officially, the agency downplayed the Corbett video. Behind closed doors, supervisors instructed us to begin patting down the sides of every fifth passenger as a clumsy workaround to the scanners' embarrassing vulnerability.

NOT LONG AFTER, I created an anonymous blog, Taking Sense Away. It was to be my forum for telling the public all that I had experienced in my five years of employment with the TSA. I felt an obligation to speak out, consequences be damned.

In the six months that I secretly blogged, I did my best to record every notable piece of stupidity TSA had to offer. There was "The Things They Ran Through the X-ray," a post that detailed the craziest items I had seen put through the X-ray belt at O'Hare: dildos, puppies, kittens. Even a real live TSA officer: In 2009, one of my friends had run her male colleague through a carry-on X-ray machine. (It was a slow night.) When management happened upon video footage of the episode, they were both fired.

There was also "No, You Don't Know What It Is," a post revealing that the enhanced screening you receive is often just as mystifying to the TSA officer administering it as it is to the traveler. But we would also sometimes pull a passenger's bag or give a pat down because he or she was rude. We always deployed the same explanation: "It's just a random search."

Then there was my "Insider's TSA Dictionary." One of the first terms I learned from fellow male TSA officers at O'Hare was "Hotel Papa," code language for an attractive female passenger — "Hotel" standing for "hot," and "Papa" for, well, use your imagination.

I hinted several times on the blog that a determined terrorist's best bet for defeating airport security would be to apply for a job with the TSA and simply become part of the security system itself. A fellow officer once returned to O'Hare from a trip to TSA headquarters and confessed that he had run into some complications: Someone realized that his background check had never been processed in the four years he had been an employee. He could have been anyone, for all the TSA knew — a murderer, terrorist, rapist. The agency had to rush to get his background investigated. Who knows how many similar cases there were, and are, at airports around the nation.

A few weeks after my site went viral, the TSA announced it was canceling its contract with Rapiscan, the manufacturer of the full-body scanners, in favor of a new type of scanner that produced a generic outline of the body instead of graphic nudes.

I knew I didn't want to spend the rest of my life as a mindless cog in a vast bureaucratic machine. So my heart was not heavy on the May afternoon when I went to turn in my uniform and tell the TSA I wouldn't be coming back. I'd been accepted to graduate school for creative writing.

The exit interview turned out to be nothing more than a pleasant conversation with a woman in admin. There was no last-minute grilling by a grim-faced government suit. The interview consisted of "Jane" reading from a checklist of TSA uniform pieces I was on record as owning, and me, for the most part, apologizing for having lost many of them years ago.

Jane smiled, assuring me it was fine. She shook my hand and wished me luck. I left headquarters, officially relieved of my post.

Excerpted from a piece that originally appeared in Politico Magazine. Reprinted with permission.