The fight over the appointment of Leon Panetta as CIA director died down as fast as it flared up. The question now is whether Panetta, never having worked in intelligence, will figure out how espionage works fast enough to save the CIA--and keep the president out of trouble.

The CIA certainly needs saving. Many believe 9/11 could have been prevented if the CIA had notified the FBI in enough time when two hijackers moved to San Diego in early 2000. In a Parthian shot, the Bush administration is blaming the CIA’s bad intelligence for leading us into war in Iraq. And now, with the two enduring wars in Afghanistan and Iraq, the Pentagon is firmly on top of the intelligence heap. The CIA needs to be thinking about its relevance. The Pentagon already has 80 percent of the intelligence budget, and would be more than happy to take the rest.

Obama’s decision to appoint Panetta was likely influenced by the presence of Hillary Clinton at State and Robert Gates at the Pentagon. Obama has been around Washington enough to know that intelligence is a blood sport--bureaucratic blood, that is. He knows that appointing a CIA director from the ranks of the agency--an intelligence professional--no matter how capable and smart, would be eaten alive by Clinton and Gates. George Tenet knew the intelligence community inside and out, but still caved on Iraqi WMDs when the White House turned on the heat.

This isn’t going to happen to Panetta. He may go along with a White House consensus, but it won’t be because he is outgunned. Having served as Clinton’s chief of staff, Panetta knows his way around the Oval Office as well as Clinton and Gates. He’s a man who will not be satisfied with a day-pass to the White House or wait for an invitation to see the president.

Let’s not forget Jim Woolsey’s unfortunate tenure at the CIA. Bill Clinton’s first CIA director, Woolsey couldn’t get through either the front door or back door of the White House. He himself likes to tell the joke that when a nut flew a plane into the Clinton White House, White house insiders thought it was Woolsey trying to see the president. During my time in the CIA, I was summoned to the White House enough to know that your message will never be heard if you are of a lower caste. The CIA languished under Woolsey if for no other reason than the director couldn’t see the president.

Historically, it hasn’t seemed to matter much whether the director was an intelligence professional or not. Porter Goss, who followed George Tenet as director in 2004, achieved nothing at the CIA, although he had more intelligence experience than any director since Richard Helms. He had been a CIA operative overseas for almost ten years, and then headed the House intelligence committee until he became CIA director. But in two years, he ran for the exit, a revolt in the ranks nipping at his heals.

It is true that Panetta will be faced with an armature of wariness, mistrust, and anxiety as soon as he walks through the front door. It doesn’t help that he served in the Clinton administration, which harbored the same wariness, mistrust, and anxiety about the CIA. But if Panetta is smart and the CIA’s professionals are equally smart, they will put their heads together and figure out how to save the place--and, who knows, maybe even reform it.

Panetta’s first task will be to remind Obama daily that it was the president and his team that cherry picked the bad intelligence on Iraq, just as it was the administration that forced extraordinary renditions and torture on the CIA. Along the way, he will also need to convey the message that the CIA is capable of doing excellent work when left alone--work that neither the State department nor the Pentagon can do.

If he can accomplish those two things, and hold his own against Obama’s cabinet heavyweights, Panetta could be the man to save a young and inexperienced president. In 1961, another young, idealistic president was convinced by “intelligence professionals,” among them then-CIA Director Allen Dulles, to green-light the Bay of Pigs. This administration will face more crises, more wars, and more temptations to ask the CIA to undertake some harebrained covert action like Kennedy’s attempted invasion of Cuba. Panetta will have the stature to stroll into the Oval Office and tell the president, “No.”

Robert Baer served in the CIA as a field operative from 1976 to 1997. He writes a column for Time.com. His memoir See No Evil was turned into the film Syriana. His latest book is The Devil We Know: Dealing with the New Iranian Superpower (Crown Publishers, 2008).

By Robert Baer