For at least the past decade, the U.S. intelligence relationship with Egypt and other countries in the Middle East and North Africa has been almost exclusively about terrorism and working together to prevent it.
But the uprisings in Tunisia, Egypt and Libya have forced U.S. intelligence agencies to rethink how they operate in this part of the world.
"The essence of an intelligence officer's job is to be prepared for surprise," says John McLaughlin, the former deputy director of the CIA.
In the Middle East and North Africa, he says, intelligence officers now are trying to answer a big question.
"Who are the key players here? Who are the go-to people?" he says. "In a way, it's mapping the influence systems in these countries. Because ultimately, the U.S. wants to have a relationship, an influential relationship."
Laying the foundation for that relationship means identifying the new power brokers and tracing their relationship to the government, institutions and political groups.
For a long time, the CIA's map of Egypt's power structure was drawn in ink. The agency knew the main players â€” President Hosni Mubarak and Omar Suleiman, the country's longtime chief of intelligence. Now, Mubarak is out, and so is Suleiman. McLaughlin says the power map has to be redrawn.
The closest parallel to what's happening there now is Eastern Europe when the Iron Curtain fell. McLaughlin was running the Eastern European desk at the CIA back then.
"We kept a running list every day of who was up and who was down," he says, "and we provided cards to people in the government, saying, today it's these five people, and tomorrow that's changed, these people seem to be gaining â€” so this is one of the first things you have to do."
Understanding who the power brokers are in these countries means understanding internal dynamics in the countries. CIA Director Leon Panetta talked about this when he testified before the House Intelligence Committee last month.
"What I've asked for from all of my chiefs of stations is better collection on issues like popular sentiments, issues like the strength of the opposition, issues like what is the role of the Internet in that particular country," he said.
Former CIA officer Robert Grenier says those are the kinds of issues that U.S. intelligence operatives in the field haven't been spending a lot of time on.
"In many of these countries, the primary â€” almost the sole â€” preoccupation of the U.S. has been with regards to their cooperation against terrorism," says Grenier. "And now we're having to take a much broader look at these societies, and to once again to try to understand their domestic politics in ways that would not have been a priority in the recent past."
Intelligence professionals on the ground have to be able to do both â€” track domestic politics in these countries and work on terrorism.
"The pace of change, the magnitude of demands, is going to make for not much sleep," says Thomas Fingar, former chair of the National Intelligence Council who's now a fellow at Stanford University.
For intelligence officers in Cairo, the job may have just gotten more complicated.
"Knowing who's going to be best informed about a situation in flux with high certainty is very hard," says Fingar. "I'm glad it's not me."
For one thing, he adds, "Who's in charge of Egypt?"
"The military's in charge of certain things," he says, "but what was happening out in the square â€” you can't look up in the phone book and get the name of the party, the company, the organization that is responsible for revolution."
That's pretty much what intelligence officers on the ground are trying to do right now â€” build that new contact list.
But even if you could identify the leaders of a leaderless uprising, it might not do much good when the situation in these countries is changing as fast as a Facebook news feed.