He was a catch, a gold mine. The first and only mole ever to infiltrate Al Qaeda at such a high level. And the CIA was eager to meet him. On the afternoon of December 30, 2009, practically everyone who worked at the agency's base in Khost, Afghanistan, plus a few visitors—fourteen people in all—gathered outside in front of a makeshift interrogation center. The mole was due any minute. The point of the welcoming committee was apparently to show respect for the man, a Jordanian doctor named Humam Khalil Abu-Malal al-Balawi—to make him understand how important he was to the CIA's war on Osama bin Laden.

A red station wagon had been dispatched to pick up Balawi at the Pakistan border ten miles away, the base's Afghan driver at the wheel. At about 4:30 p.m., the car pulled up in front of the interrogation center. When Balawi stepped out, he kept one hand in his pocket. According to press accounts, this caught the attention of a security contractor from Xe Services (formerly Blackwater), who moved to search Balawi. But a former CIA officer with knowledge of the agency's internal investigation of the incident told me it was the mole's handler in the Jordanian intelligence service—the man who'd recruited Balawi in the first place—who first suspected something was wrong. What tipped him off ? Balawi started to pray: There is no god but God…

Two weeks earlier, on December 17, the chief of the Khost base turned on her Panasonic Toughbook laptop and quickly scrolled through the cables that had come in overnight from around the world. There were hundreds, but only one that interested her: a message from Amman, Jordan.

Balawi, the mole deep inside Al Qaeda, had sent an e-mail through Jordanian intelligence describing the damage from recent Predator drone attacks in the tribal areas of Pakistan. There had been at least ten missiles fired from five Predators, killing fifteen people, including seven foreigners, possibly Al Qaeda members. Of the villages Balawi had been able to visit, he reported the tally—the dead, the wounded, the buildings destroyed. He was even able to describe Al Qaeda's reaction, the helpless fury of Dr. Ayman al-Zawahiri, Osama bin Laden's number two.

The base chief needed only to compare Balawi's report with the photos taken by the Predator drones—photos that matched his description perfectly. Oh yeah, she must have thought. This guy is good. Very good.

The base chief is a covert employee of the CIA; her identity is protected by law. I'll call her Kathy. She was 45 years old and a divorced mother of three. She'd spent the vast majority of her career at a desk in Northern Virginia, where she studied Al Qaeda for more than a decade. Michael Scheuer, her first boss in Alec Station, the CIA unit that tracked bin Laden, told me she had attended the operative's basic training course at the Farm, the agency's training facility, and that he considered her a good, smart officer. Another officer who knew her told me that despite her training at the Farm, she was always slotted to be a reports officer, someone who edits reports coming in from the field. She was never intended to meet and debrief informants.

Kathy knew that there was a time when only seasoned field operatives were put in charge of places like Khost. Not only would an operative need to have distinguished himself at the Farm; he would've run informants in the field for five years or more before earning such a post. He probably would have done at least one previous tour in a war zone, too. And he would have known the local language, in this case Pashto. Kathy skipped all of this. Imagine a Marine going straight from Parris Island to taking command of a combat battalion in the middle of a war.

In the late '90s, when Kathy was first put on the bin Laden account, it was the Siberia of the CIA, located in a bleak office building in Tysons Corner, Virginia. If you needed someone important to pay attention to you, you had to drive down Route 123 to the main building in Langley. And even then you'd be lucky to get fifteen minutes of anyone's time.

Truth is that until September 11, not everyone in the agency was all that worried about bin Laden. The spoiled son of a Saudi construction magnate, he hadn't done any real fighting in the Afghan war. Yes, he'd been behind a truck bombing in Nairobi and Dar es Salaam in 1998. But neither truck got inside the building, and American casualties were relatively light. Was this the best bin Laden could do? To the old guard at the CIA, he looked like a wannabe, not in the same league as Hezbollah.

That all changed on September 11, of course, when every CIA station and base in the world turned their attention to "penetrating" Al Qaeda—recruiting a mole next to Osama bin Laden. In the span of a few years, the CIA's counterterrorism center went from a couple of hundred ocers to 4,000. If you wanted to rise in the CIA, you needed to prove you were doing your part to get bin Laden.

As an Al Qaeda expert, Kathy did more than her part. But Khost was her first field command, her first real chance to run informants. She lived in a trailer, ate in a common mess, experienced the isolation of life behind blast walls and razor wire, surrounded by the dun countryside of eastern Afghanistan. Like every other American serving in this part of the world, trapped on base for fear of the Taliban, she must have felt like a prisoner. But from what I've be able to glean about her, this hardship would've made her all the more determined to show her bosses that she could do the job.

to understand the CIA, you need to know that from its beginning in 1947, it was divided by a class system, as rigid and acrimonious as any. Everyone in the agency, wherever he or she stood, knew about it and either benefited or suffered from it.

On top were the field operatives, the officers who served overseas, ran informants, conducted covert action. In the early years, most operatives came out of Ivy League schools. Many lived off trust funds, not their modest government pay. They played tennis, lived in Georgetown, and could tell the difference between a spinnaker and a jib. But by the mid-'60s, the establishment's romance with the CIA and espionage had cooled (the Bay of Pigs had a lot to do with this), and the CIA had to turn to Main Street to fill its ranks. Ohio State took over from Yale, and the bowlers from the tennis players.

But that shift did not end the operatives' belief that they were members of a professional elite. Operatives were obsessed with the craft of espionage. They knew how to steal secrets, break into banks, and overthrow governments. They prided themselves on learning languages: Russian, of course, but also Arabic, Persian, Chinese, even obscure tongues like Afrikaans and Pashto. A four-month paramilitary course was mandatory until the early '70s. Operatives learned to fieldstrip a Kalashnikov blindfolded, prime explosives, and jump out of an airplane. After training an operative, the CIA sent him overseas for four or five years to work under a seasoned agent, a mentor. The mentor looked over the rookie's shoulder to see how he intended to meet his informant, to check the questions he was going to ask, and even to go over the route he intended to take to avoid a tail. It took years to acquire these skills and decades to perfect them.

The CIA's other breed of agent—a much lesser animal in the eyes of the operatives—was the analyst. Analysts spend their careers at headquarters writing reports. Many have Ph.D.'s, and they're smart in a bookish way. You'd find their desks stacked with The Economist, Pravda, Le Monde. They always seemed to be shabbily dressed. When they did get out of Washington, it was to attend an academic conference.

The one thing all analysts shared was a disdain for the operatives and their cloakand-dagger pretensions. As far as they were concerned, the operatives' "tradecraft" was a lot of hocus-pocus. Operatives were cowboys—and of questionable utility.

Analysts were convinced that most good information was right out in the open. All you needed was a good brain to make sense of it. And what you didn't know from open sources, you could learn from intercepts and satellites.

It's impossible to pinpoint exactly when the operatives' sun started to set, but many CIA insiders would point to John Deutch, the former MIT provost and Bill Clinton's second CIA director. From the moment Deutch set foot in Langley, he made it plain that he hated the operatives, their swagger and arrogance. Deutch held them responsible for some of America's worst foreignpolicy fiascoes, from the Bay of Pigs to the overthrow of Allende in Chile. In December 1995, he told The New York Times: "Compared to uniformed officers, [CIA operatives] are certainly not as competent, or as understanding of what their relative role is and what their responsibilities are."

Deutch's first shot at the operatives was his appointment of Dave Cohen as deputy director of operations, the CIA's most senior operative. Cohen was an analyst who had never served overseas or run a foreign informant. Deutch's message couldn't be any clearer: Anyone can do an operative's work.

The first thing Cohen did was order a "scrub" of every informant with dirty hands. Drug dealers, dictators' minions, arms dealers, terrorists—Cohen ordered the operatives to sever ties with all of them. The only problem was, these were the people who mix well with our enemies—rogue regimes like Iran and North Korea and terrorist groups like Hezbollah and Al Qaeda. Deutch and Cohen didn't care; they had a mandate to clean up the CIA, and that's what they were going to do.

Headquarters ofiicers started taking more and more of the important jobs in the field. For the first time in the CIA's history, analysts, reports officers, and logistics officers were given stations and bases to run. (As a reports officer, Kathy technically belonged to the directorate of operations, but in spirit she was much closer to an analyst.) Field experience no longer mattered, either for assignments or promotions.

As the CIA purged informants, it leaned on allies to do our dirty work in the field. Friendly Muslim intelligence services, not CIA operatives, were asked to comb jihadi circles. All this only got worse after September 11. The wars in Iraq and Afghanistan sucked the CIA dry. In 2006 there were nearly 750 officers assigned to Baghdad station, mostly staff officers on their first overseas assignment. That number may not sound like a lot, but throughout the '90s there were at most 1,200 to 1,500 CIA employees assigned overseas at any one time.

As the wars dragged on, the CIA's problems cascaded, leaving an agency with almost no officers with real field experience. Personnel were shifted in and out of assignments for three-month stints, too brief a period to really know a place or do any meaningful work. Over time, these patterns completely undid the old standard that you needed experience to lead. After a year's tour in a post like Baghdad, an officer could pretty much count on landing a managerial position. Never mind that he'd spent his time locked down in the Green Zone, never getting out or meeting an informant.

What John Deutch set in motion was the deprofessionalization of the directorate of operations, handing it over to bureaucrats who only went overseas to get a quick taste of life in the field before returning to the safety of the Beltway. The idea that an officer would spend his entire career abroad learning the fundamentals of espionage is incomprehensible to the new CIA.

SINCE BALAW I'S family has talked to the press, we know a lot more about him than we do about Kathy. Humam Khalil Abu-Mulal al-Balawi was a Jordanian of Palestinian descent. He went to medical school in Turkey and married a Turkish woman. He blogged on a jihadist site and let it be known that he'd been radicalized by the wars in Iraq and Afghanistan. It was his blog, in fact, that attracted the attention of Jordanian intelligence in 2008.

Jordanian intelligence had seen its share of homegrown Islamic militants and believed they knew exactly what to do with Balawi. Deep under its headquarters in Amman is a block of interrogation cells where no one comes out the same as he went in. As Balawi was led into that block to face his interrogator, he surely shuddered when he read the black banner over the door: justice has come.

It's unknown how long it took Jordanian intelligence to break Balawi, force him to renounce his radical beliefs, and agree to become a mole. Nor is it clear why the Jordanians thought Balawi would have been so easily accepted into Al Qaeda's ranks. Were his blog posts really enough to win their trust? The salient point is that the Jordanians had been under intense American pressure to infiltrate Al Qaeda, and Balawi was the best they could do.

Throughout the fall, Balawi filed regular reports through Jordanian intelligence. With each e-mail, Kathy grew more convinced he was the real thing, the man who would help us decapitate Al Qaeda. Balawi wasn't shy about intimating in his e-mails what kind of information he could deliver. According to one former CIA officer I talked to, he all but said he could call in a Hellfire missile right on top of Dr. Zawahiri's head. He sent pictures of himself posing with Al Qaeda fighters to prove his bona fides.

Headquarters was convinced, but they felt they needed to meet Balawi. They wanted to run him themselves, taking over from the Jordanians. The problem was where to meet him. The CIA couldn't send an officer into the Taliban-controlled regions of Pakistan, where Balawi was holed up with Al Qaeda. Nor could it call him back to Amman, because the risk was too high that Al Qaeda would become suspicious. The CIA office in the Pakistani capital of Islamabad refused to meet Balawi, arguing that there was no way he could safely come out of the tribal areas without being picked up by Pakistani intelligence. As for the Pakistanis, no one trusted them enough to tell them about Balawi. That left Afghanistan—Balawi walking across the border to a rendezvous with a car from Khost base.

The normal protocol for meeting an informant is either a car pickup, in which the operative debriefs the informant while driving around, or a meeting in a secret CIA safe house. Neither was an option in this case. The area around Khost is shot through with armed Taliban. A lone CIA officer driving around with Balawi risked being either ambushed or kidnapped. The same went for a meeting in a safe house.

A decision was made to bring Balawi into Khost base, behind three lines of security. And even that wasn't as secure as it sounds. The CIA knew the Taliban was onto the base. Two months before, in late October, a CIA car was stolen. It was found a couple of days later on the side of the road. When it was inspected, explosives were discovered in the door panel and behind the radio; the car had been rigged to explode when the radio was turned on.

In the days leading up to the meeting with Balawi, the White House was briefed. That's a rare thing in clandestine operations, and it raised expectations as well as pressure. In order to make sure nothing went wrong, someone—it's not clear who—decided that the more people who attended the meeting with Balawi, the better. Not only to show respect to Balawi but also to make sure nothing fell between the cracks.

Kathy's direct boss at Kabul station (he is still undercover) was told to come down to oversee the meeting. Two contractors from Xe Services—Jeremy Wise, a former Navy Seal from Virginia Beach, Virginia, and Dane Clark Paresi, a former Special Forces soldier from Dupont, Washington—would provide security, as would two CIA security officers, Harold Brown Jr., a former army officer from Fairfax, Virginia, and Scott Michael Roberson, a former Atlanta undercover narcotics officer. A beacons technician and a satellite-photography analyst would also be there, to debrief and train Balawi. Elizabeth Hanson, a 31-year-old analyst, would assist in the debriefing. Balawi's Jordanian handler, Sharif Ali bin Zeid, would come from Amman to hand Balawi over to the CIA. He would be accompanied by a young operative from the CIA's office in Amman, whose identity remains secret.

Right up until the CIA's driver picked up Balawi at the border, the big question was whether he would show. What if he was grabbed by the Taliban, if only by mistake? What if he was shot while crossing the border by our own soldiers? What if he just changed his mind and disappeared? That would be difficult to explain to the White House. So there must have been a collective sigh of relief when the group of fourteen spotted the red station wagon approaching with a man in the passenger seat.

Why wasn't Balawi searched at any one of the three hard-line security perimeters before he was brought inside the wire? Or at least run through a metal detector? No one could tell me. But as a result, the Jordanian double agent found himself standing exactly where he wanted to be in the final moment of his life—on an American base in an Islamic land, a suicide vest strapped to his body, surrounded by infidels.

A great white light, then silence.

Kathy was killed instantly, as was Sharif Ali bin Zeid, the operative from Amman, staffer Elizabeth Hanson, the two CIA security officers, and the two Xe contractors. The other six were gravely wounded, as was the CIA itself. It was the agency's bloodiest day since the bombing of the U.S. embassy in Beirut in 1983, more than twenty-five years ago.

On January 10, 2010, CIA director Leon Panetta wrote a Washington Post op-ed in which he disputed that poor tradecraft was a factor in the Khost tragedy. Panetta is wrong.

An old operative I used to work with in Beirut said he would have picked up Balawi himself and debriefed him in his car, arguing that any agent worth his salt would never expose the identity of a valued asset to a foreigner like the Afghan driver. I pointed out that if he'd been there and done it that way, he'd probably be dead now. "It's better than what happened," he said.

One thing that should have raised doubts about Balawi was that he had yet to deliver any truly damaging intelligence on Al Qaeda, such as the location of Zawahiri or the plans for the Northwest bomb plot. Balawi provided just enough information to keep us on the hook, but never enough to really hurt his true comrades. And how was it that Balawi got Al Qaeda members to pose for pictures? This should have been another sign. These guys don't like their pictures taken. So there were a few clear reasons not to trust Balawi, or at least to deal with him with extreme caution.

But the most inexplicable error was to have met Balawi by committee. Informants should always be met one-on-one. Always.

The fact is that Kathy, no matter how courageous and determined, was in over her head. This does not mean she was responsible for what happened. She was set up to fail. The battlefield was tilted in Al Qaeda's favor long ago—by John Deutch and his reforms, by the directors who followed him, by the decision to drop the paramilitary course from the mandatory curriculum (which would have made Kathy a lot more wary of explosives), and by two endless wars in Iraq and Afghanistan that have worn the CIA down to a nub. Had Kathy spent more time in the field, more time running informants, maybe even been stung by one or two bad doubles, the meeting in Khost probably would have been handled differently—and at the very least there would have been one dead rather than eight.

If we take Khost as a metaphor for what has happened to the CIA, the deprofessionalization of spying, it's tempting to consider that the agency's time has passed. "Khost was an indictment of an utterly failed system," a former senior CIA officer told me. "It's time to close Langley."

I'm not prepared to go quite that far. The United States still needs a civilian intelligence agency. (The military cannot be trusted to oversee all intelligence-gathering on its own.) But the CIA—and especially the directorate of operations—must be stripped down to its studs and rebuilt with a renewed sense of mission and purpose. It should start by getting the amateurs out of the field. And then it should impose professional standards of training and experience—the kind it upheld with great success in the past. If it doesn't, we're going to see a lot more Khosts.

robert baer was a CIA operative for twenty-one years. He is the author of See No Evil, a memoir of his time in the agency.