Valerie Plame is a former covert CIA operations officer and the author of “Fair Game” and several fictional spy thrillers.

In a world of seemingly random massacres in Paris, Brussels and San Bernardino, Calif.; Islamic State beheadings; and an erratic potentate in a nuclear-armed North Korea, we like to think that the CIA, the FBI and the other 14 agencies charged with gathering intelligence are doing their damnedest to keep us safe. And, for the most part, they are. But embedded within the vast U.S. intelligence complex is a bloated bureaucracy that creates turf battles and inefficiencies that can lead to dire and even deadly consequences. The tale of Robert Levinson — a retired Drug Enforcement Administration and FBI agent turned CIA contractor who disappeared in 2007 from a resort island in the Persian Gulf — underscores the dangers of the multi-headed bureaucratic monster called the CIA.

In January of this year, after the United States and Iran reached a deal to curb the Islamic republic’s nuclear program, the two countries swapped prisoners. Levinson was not part of the agreement. Proof that he was alive has come only twice — in a 2010 video, during which he pleaded for help from his government, and in 2011 photos of Levinson wearing an orange prison jumpsuit and looking ill and disheveled.

Barry Meier’s new book, “Missing Man,” catalogues how Iranian and U.S. officials knew far more about Levinson’s disappearance than previously acknowledged. Through the contacts and machinations of Doug Coe, head of a powerful and secretive Christian organization called the Fellowship, the U.S. government learned from the Iranian ambassador to France in late 2011 that Iran was holding Levinson. But the ambassador would not say where he was being held or by what faction. He said Levinson would be released on one condition: An upcoming report by the International Atomic Energy Agency on Iran’s nuclear program had to conclude that its activities were peaceful. When the report was released, though, it did no such thing. It held that Iran was indeed working on components of a nuclear weapon. Levinson never materialized.

Levinson’s disappearance is the stuff of intrigue. As a CIA contractor, he had to continually justify his access to intelligence sources. In late 2006, he went to CIA headquarters and dangled the possibility of collecting information on illicit funds and front companies used by the Iranian leadership to channel money to the regime. With an enthusiastic nod from the CIA, but without revealing how exactly he would obtain the information, Levinson set up a meeting on Kish, the resort island, with American-born David Theodore Belfield.

Belfield had converted to Islam in his early 20s and assumed the name Dawud Salahuddin. He went to work for the Islamic republic in 1980, shortly after the revolution, as a security guard at an Iranian diplomatic office in Washington. In an act of seeming religious zeal, he then accepted an assignment from the regime to assassinate Ali Akbar Tabatabai, a former official of the shah’s government who was living in exile in Bethesda, Md. Salahuddin shot Tabatabai dead at his front door, then fled to Iran via Canada and Switzerland. The reason Levinson decided to take this high-risk, truly reckless trip to Kish, leading to his kidnapping and probable death, lies in part in the CIA’s byzantine culture.

One key player in the mystery is Anne Jablonski, who was a CIA senior analyst in the Directorate of Intelligence with an expertise in Russian organized crime. She and Levinson met in the early 1990s at a training conference and struck up a friendship. He nicknamed her “Toots,” and she called him Bob. They stayed in touch over the years, trading gossip on Russian mobsters. In 2006, when Levinson had retired from his government job but was still scrambling as a consultant to support his wife and their seven children in South Florida, Jablonski got him a CIA contract with her team, the Illicit Finance Group.

The CIA’s analytical branch is forbidden to run clandestine operations for good reason: Analysts aren’t trained in tradecraft, and running ops can get somebody killed. Historically, there is deep and ongoing mistrust between CIA case officers (the folks who run the ops) and their analytical counterparts. Each views the other as inferior for a variety of reasons related to their different character types and roles in the bureaucracy, even though both sides are necessary to the collection and dissemination of intelligence. Analysts such as Jablonski pull information for their reports from a range of sources — newspaper articles, the Internet, public documents — and can task overseas operatives to gather information that is collected in reports and then distributed throughout the intelligence community. These requests are prioritized by the CIA based on national security needs. Operatives jealously guard their human intel turf and view their specialized training as exclusive to their cadre.

In tacitly agreeing to Levinson’s suggestions about what information he could gather for the CIA without asking for details of how that would actually happen, Jablonski may have let her long friendship with him cloud her judgment. There is no evidence that she or her supervisors thought to confer with appropriate ops officers about Levinson’s scheme or travels. As a former ops officer myself, and with that admitted bias, I am incredulous at this carelessness and complete lack of managerial oversight. Levinson was not a CIA-trained operative. Although he had experience with the DEA and the FBI, those jobs did not prepare him for intelligence collection overseas in a risky environment. Jablonski herself had no operational experience, and Levinson’s confidence and enthusiasm covered up his lack of special training.

Jablonski seemed to be pretty much the only one excited about the various and copious reports Levinson had submitted to the CIA on a freelance basis, even before his contract was signed. She enthusiastically encouraged him in his work for the CIA without going through the boring but critical bureaucratic protocols that come with running a source who gathers intel overseas. In addition, Levinson’s reports tended to read like FBI investigative memos, and people who read them might have assumed he was involved in clandestine work, not analysis. So in 2006, Jablonski invited Levinson to CIA headquarters to tell him that her team was “looking for ways to reframe his reports, rather than change what he was doing.”

She told him: “We teeter on the edge of some legal issues here — since we’re NOT anything but an ‘analytical shop.’ So we have to kind of shape things a bit differently (same info, different prism) and maybe work with you to change the ‘format’ of the material you send.”

For Levinson, that was an easy enough adjustment, if it meant keeping his CIA pay. He was struggling to put seven kids through college and pay his mortgage, and was working the system hard. He had figured out how to be paid by a multitude of clients, private ones as well as the CIA, for the same travel and in some cases the same information, just formatted differently. Although clearly a devoted family man, Levinson was opportunistic and didn’t always play by the rules. For example, he sometimes didn’t pay his sources, stiffing one shady Russian to the tune of $80,000. People get mad when that happens.

When Levinson checked into the Maryam Hotel on Kish on March 8, 2007, expecting to meet Salahuddin, he was nervous but figured it was worth the sizable risk: He thought he’d come back with information for the CIA and his other clients on Iran and Russian mobsters.

Meier is a prize-winning, thoughtful journalist who has followed this story closely and written about it extensively in the New York Times. Which is a good thing, because the cast of shadowy characters and cameo appearances (including, bizarrely, one by 1990s actress Linda Fiorentino) makes the convoluted story tough to follow. Questionable players with questionable agendas create such a sordid tale that the only people you feel for are Levinson’s heartbroken family. While Meier knows the details intimately, the reader needs more signposts.

Levinson was a loving husband and father. But after a career of dealing with those who saw nothing wrong with breaking the law and working on the fringes, he took shortcuts and used the dysfunctional system to his financial advantage. He was able to do so because oversight and attention to detail sometimes get lost in the enormous CIA — and those institutional failings also contributed to his disappearance.

In the years since 9/11, the size of the intelligence community has doubled. More than 5 million Americans now have security clearances. While growth in personnel and physical assets has been explosive, what has not grown at all is accountability for this massive undertaking. We have spent untold billions to enhance our intelligence collection, but we failed to detect the Paris or Brussels attacks ahead of time and have few clues about what happened to Levinson. Meier missed the real story: Despite massive spending on intelligence, we rely on a financially strapped contractor to run off on unsupervised missions that the system can’t collect.

Democracy and the intelligence apparatus live in uneasy tension. The only way to allow secret intelligence organizations to exist is with appropriate and active oversight, robust accountability and consequences for mistakes. The press generally blames a few “rogue” CIA analysts for Levinson’s situation. But in fact, it is the entire sclerotic intelligence system that has failed spectacularly in the search for him and his safe return. And, like bureaucracies everywhere, it trundles on, oblivious to damage wrecked and lives lost, and impervious to change.