In the fall of 2004, as President George W. Bush and Sen. John Kerry entered the home stretch of the presidential campaign, portions of a bleak intelligence estimate about the future of Iraq were leaked to reporters. Among the most alarming findings was the possibility that sectarian violence and political incompetence in Iraq's fledgling governmental institutions could ignite a civil war. Bush had seen this report months earlier, but in his public remarks, he didn't ratchet down his sunny optimism about Iraq's future. Did intelligence analysts privy to the Iraq report's contents decide to leak them in order to embarrass the president and trip up his reelection bid?

The president thought so. A former senior intelligence official who spoke regularly with the president told me Bush became convinced that a left-wing contingent of CIA employees had given the embarrassing information to reporters. Bush also thought that this fit a pattern of information control emanating from Langley. Earlier the same year, The New York Times and The Washington Post had run the first stories about the CIA's covert program of detaining and interrogating certain "high-value terrorists." A former CIA official, who was directly involved in the program, told me that alarm bells went off at headquarters. The information contained in the news reports was so specific--and accurate--that senior officials presumed the leak must have come from within the agency's Counterterrorist Center, which was managing the program day-to-day, or the larger operations directorate, of which the CTC was a part. At the time John Helgerson, the inspector general, had just wrapped up a lengthy report about the program, which quoted CIA officers who were convinced that the agency's activities would be exposed by the media.

The fall of 2004 marked an apex in the White House's bitter public feud with the CIA. A year earlier, Bush had found himself defending the now infamous charge that Iraq had tried to purchase enriched uranium from Africa. National Security Adviser Condoleezza Rice took great pains, in press briefings and on Sunday talk shows, to point the finger back at the agency that vetted the president's remark, contained in a State of the Union Address. "I can tell you, if the CIA, the Director of Central Intelligence, had said, 'Take this out of the speech,' it would have been gone, without question," she told reporters aboard Air Force One while traveling with the president in Africa. On that same trip, Bush also turned the tables on his spies: "I gave a speech to the nation that was cleared by the intelligence services."

Bush survived re-election, but the CIA director, George Tenet, didn't fare so well. In June 2004, he announced his retirement, after accepting responsibility for including the disputed line in the president's speech. To replace him, Bush tapped one-time CIA operative and chairman of the House intelligence committee Porter Goss. He was widely seen as a clean up man, sent to quell a restive agency that had politically lined up against the administration.

Goss was in office for just over a year when, in November 2005, Dana Priest published a blockbuster expose in The Washington Post about the agency's overseas network of "black sites," where the high-value terrorists were held and interrogated. This touched off a massive leak investigation at the agency in which senior officers, including Helgerson, were forced to take polygraph examinations. One former CIA officer, a veteran of almost 30 years, told me he was hooked up to the lie detector and asked what contacts he'd had recently with journalists. Another officer, the one who was directly involved in the interrogation program, said that the agency's leadership believed the Post would not have run a story with only one source, and so there must have been several leaks. "Everyone was a suspect," he said.

But despite earlier suspicions that employees in the Counterterrorist Center or the operations directorate were airing the CIA's dirty laundry, the leak investigation led to a different source: the inspector general's office. There, a veteran analyst named Mary McCarthy was on her last assignment, overseeing allegations of criminal wrongdoing in the CIA's interrogations in Iraq and Afghanistan. She was weeks away from retirement, and had already filled out her paperwork, when she was summarily terminated and escorted off the Langley campus.

McCarthy had admitted to having unauthorized contacts with journalists, a violation of CIA's rules. But she has insisted that she was not the source for the Post article that identified specific countries where the prisons were located. Indeed, she claimed she didn't even have access to that information. McCarthy was investigating allegations of abuse in Iraq and Afghanistan, and by the time she started her assignment in the summer of 2004, the inspector general's report on the secret facilities had already been completed.

It was practically unheard of to fire a senior CIA officer for talking to reporters, and it signaled to some of her colleagues at the time that the leak investigation truly was in full force, and that Goss and Bush were out to send a message: "Leak, and you will be punished." But after McCarhty left the agency, the investigation stopped, according to the former CIA officer. Why, if Goss' leaders believed that there must be more than one source of the information? That's still not clear, though in hindsight, a convincing narrative emerges. McCarthy was a Democrat, and according to another Post article had told some of her CIA colleagues that agency officials were not being completely honest about the interrogation and detention program with members of Congress. McCarthy had led a distinguished career and, according to a number of people who know her, was widely regarded as a professional analyst, not swayed by her personal political beliefs. But by criticizing the administration, and having unauthorized contacts with journalists, she might have made herself a convenient target. If Bush truly believed that a left-wing conspiracy of well-informed leakers was out to get him, he might be convinced that McCarthy was part of it.

But in the end, the joke was on the president. If there really was a conspiracy at the CIA, it clearly wasn't disrupted by McCarthy's firing. Leaks continue to emanate from the agency to this day, plenty of them unflattering and inconvenient for Bush and for his successor. Furthermore, if McCarthy really did spill the beans to the Post, why wasn't she punished? She was allowed to keep her pension, and she has never been prosecuted for any crime. True, the CIA is historically reluctant to pursue such matters in court, since that would likely lead to more classified information coming out. But in retrospect, McCarthy's very public termination looks like so much sound and fury signifying nothing. Nothing, that is, but a political message.