Opinion writer

The unexpected fall of Ramadi to the Islamic State this month is the latest sign of a basic intelligence problem: The United States doesn’t know enough about its jihadist adversaries to combat them effectively.

This intelligence deficit afflicts the military, the CIA and other agencies. The problem has been several decades in the making, and it won’t be fixed easily. The solutions — recruiting more spies and embedding Special Operations forces — will bring greater risks.

A vivid example of the knowledge gap came in an interview with Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, that was broadcast this week by PBS’s “Frontline.” Correspondent Martin Smith asked him whether the United States had plans for the loss of Mosul last June.

“Well, no, there were not,” Dempsey answered. “There were several things that surprised us about [the Islamic State], the degree to which they were able to form their own coalition both inside of Syria and inside of northwestern Iraq, the military capability they exhibited, the collapse of the Iraqi security forces. Yeah, in those initial days, there were a few surprises.”

Lessons learned? It doesn’t seem so: Nearly a year later, the United States was blindsided again by the collapse of Ramadi. What’s wrong?

The first answer is that the CIA must work with partners to build spy networks inside the Islamic State. Recruiting jihadists is not “Mission: Impossible.” The Islamic State is toxic and has made enemies wherever it operates. But to work this terrain, the agency will have to alter its practices — taking more operational risks and reducing its lopsided emphasis on drone strikes and other covert tools.

The intelligence problem has been building since before Sept. 11, 2001, according to former CIA deputy director Michael Morell. In his new book, “The Great War of Our Time,” Morell cites failures that began with Alec Station, a unit that chased Osama bin Laden in the late 1990s, and continued through the Iraq war and the Arab Spring. The CIA, by Morell’s account, simply didn’t know enough.

“One of the consequences of the way Alec Station was managed in the early years was that we did not have al-Qaeda penetrated with spies to the extent that we should have,” Morell writes. Later, assessing the disastrously mistaken intelligence about Iraqi weapons of mass destruction, Morell argues: “I believe that one of the reasons CIA failed on the collection front . . . was our focus on covert action in Iraq.”

Finally, Morell describes how the CIA was surprised by the Arab Spring: “We failed because to a large extent we were relying on a handful of strong leaders . . . to help us understand what was going on in the Arab street. We were lax in creating our own windows.”

Let’s be honest about what it would mean to fix the problems Morell describes. CIA officers would have to get out of protected enclaves to spot and recruit the principal agents who, in turn, could find sources within the jihadist lair. Staying “inside the wire” isn’t just ineffective, it’s dangerous, as became tragically clear in 2009 when a Jordanian double agent entered the CIA sanctuary in Khost, Afghanistan, and killed seven Americans.

The agency has been wary of sending case officers onto the streets in war zones without bodyguards from the paramilitary Global Response Staff. But John Maguire, a veteran of many dangerous CIA assignments, says officers traditionally understood the rubric that “you will not be captured.” Under a special training program called Case Officer Defensive Action, operatives were taught to evade surveillance and, if that failed, shoot their way out of trouble. This course was abolished, Maguire says.

The U.S. military, too, will have to put some well-trained officers in harm’s way to stiffen resistance to the Islamic State. Iraqis and Syrians will do the fighting, but they will perform better if U.S. Special Operations forces are embedded with them, in the battle zones. It’s not just that Americans can point lasers at targets; they are warriors who can mentor their comrades. As with the CIA, a few brave U.S. troops will have to be on the streets, in the fight.

For decades, the CIA and the military have tried to fix intelligence problems by relying on National Security Agency surveillance. But the jihadists have gone to school on the leaks about U.S. capabilities and learned to mask their operations. Gathering intelligence against this 21st-century jihadist adversary, paradoxically, will require the kind of old-fashioned spying and resistance operations we associate with the CIA’s founding generation in the OSS.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.