Washington - So it turns out that the top brass at the CIA had an inbox of secrets of the all-too-human, sexual variety. Titillating, unquestionably. But what about the other secrets - the intelligence secrets that are the agency's reason for existence? How are they doing on this score?

When the uproar passes over the personal misjudgments of Gen. David Petraeus, the country will be left with this question of intelligence goals and missions. And here's where an overlooked problem of the Petraeus era should be fixed.

Petraeus was picked for the job, and eager to take it, partly because the White House believed that in an era of counterterrorism, the CIA's traditional mission of stealing secrets was morphing into a wider role that increasingly stressed paramilitary covert action. Petraeus, with his matchless experience in running wars in Iraq and Afghanistan, was seen as well suited to run an agency that combined the trench coat and the flak jacket.

But the Petraeus-era CIA had a hidden defect, quite apart from any errant emails, which was that the paramilitary covert-action function was swallowing alive the old-fashioned intelligence-gathering side of the house. This actually seems to me to be one the central lessons of the disaster in Benghazi.

The CIA had a substantial base in Benghazi, with at least a half-dozen former military special forces assigned there as part of the "Global Response Staff." These were the muscle-bound security guys known to flippant earlier generations of CIA case officers as "knuckle-draggers." They were in Benghazi in such numbers in part because the CIA was supporting the State Department's program to collect the shoulder-fired anti-aircraft missiles that had gone loose after the fall of Col. Moammar Gaddafi. Agency officers may also have been working with Libyan militias to help them become effective security forces.

Given the large number of security personnel at the base in Benghazi, they implicitly took on responsibility for security at the smaller U.S. consulate a mile away. The consulate didn't have normal State Department security, so when the attack came on Sept. 11, the CIA base was the only 911 number to call. The agency's officers and contractors acted with great courage but they should never have been in such a position. Similarly, they made a mistake in relying on Libyan militias for the heavy weapons they needed that night but didn't get in time. Petraeus himself visited the Benghazi base about a week before he resigned, to bolster agency officers there and review what happened. His account, in person or in writing, will be important in understanding what went wrong.

Benghazi showed the reason the United States needs clandestine intelligence officers in dangerous countries such as Libya. They're in country, under cover, to collect the secrets that will keep American citizens safe. That night, the U.S. needed to know what was going down in Benghazi, and in Cairo, Tunis and a half-dozen other capitals. It's hard to do this intelligence collection - recruiting and running clandestine agents - when you're operating from a quasi-public base, as seems to have been the case in Benghazi, and is certainly true in many others parts of the world.

The CIA inevitably will continue to mount some paramilitary operations. America is still fighting a war against al-Qaeda, and the CIA's Counterterrorism Center has become proficient in managing drone attacks, to the point that they've made assassination from 10,000 feet an almost addictive covert tool of policy.

And there's a role for paramilitary action in Syria, too, including an idea suggested to me by Hank Crumpton, a former top CIA officer who recently published a book called "The Art of Intelligence." He suggests that the CIA train a team of Syrians that can hunt Iranian fighters from the Quds Force of the Iranian Revolutionary Guards Corps who are working with Bashar al-Assad's regime. The U.S. has mounted similar clandestine training missions in Lebanon, Iraq and Afghanistan. I like this proposal because it underlines that this is a fight for Syrians, not Iranians or Americans.

But one resolution for the post-Petraeus CIA should be to put intelligence collection back in the driver's seat at the agency. Maybe this will only be possible when the agency fully deploys a new network of deep-cover "platforms" that can hide CIA officers better than that embattled annex in Benghazi did.

And one more thought, sent by a wise reader who passed along this sobering quote from Karl von Clausewitz: "The higher the rank, the more necessary it is that boldness should be accompanied by a reflective mind ... for with increase in rank it becomes always a matter less of self-sacrifice and more a matter of the preservation of others, and the good of the whole."

(c) 2012, Washington Post Writers Group