Talking to veteran counterterrorism officers, I hear a common theme that unites these two disastrous lapses: The CIA has adopted bureaucratic procedures that, while intended to avoid mistakes, may actually heighten the risks. In the words of one CIA veteran, “You have a system that is overwhelmed.”

But those standard agent-handling rules have been violated routinely, in Iraq and now Afghanistan, because senior officials have concluded it’s too dangerous outside the wire. “At least 90 percent of all agent meetings are conducted on bases,” estimates one CIA veteran. The agency wants to protect its people, understandably — but the system actually works to increase vulnerability.

The Khost tragedy shows that the CIA needs to take the counterintelligence threat from al-Qaeda more seriously. Intelligence reports over the past year have warned that groups linked with al-Qaeda were sending double agents to penetrate CIA bases in Afghanistan.

The brave CIA officers serving overseas deserve a better system than this.

CIA Director Leon Panetta should use these searing events to foster a culture of initiative and accountability at a CIA that wants to do the job — but that needs leadership and reform.