KABUL — Najibullah, 32, a shopkeeper and law-school dropout who sells knock-off Chinese military garb in a crowded urban bazaar, followed the American presidential election closely on his small counter-top TV set.

Like many in the Afghan capital, he was happy when President Obama was elected in 2008, largely because he hoped it would bring about a change in U.S. military policy toward his country. But when he saw the news flash Wednesday afternoon about Obama’s re-election, his reaction was much more mixed.

“In one way I was happy he won, because he has a softer approach to the world than Romney, but I am also disappointed because he said so little about Afghanistan in his campaign,” said Najibullah, who uses only one name. “We don’t know what his plans are. All we know is that the American troops are going to leave, and everyone is very scared what will happen to us then.”

Across the capital Wednesday, people interviewed about the 2012 election immediately flashed forward to 2014, a year in which the remaining U.S. troops in Afghanistan will begin their final departure after a decade of war against Taliban insurgents, and in which Afghan presidential elections are scheduled to be held under tense and turbulent conditions.

Like Najibullah, many expressed deep ambivalence about the Obama administration’s past role in ratcheting up the war against Taliban insurgents and its current plan – now about to become official U.S. policy in a second Obama term – to get out of the conflict altogether except for a smaller role in training Afghan forces.

“As a Democrat, I’m happy for him. As an Afghan, I’m not,” said Shukria Barakzai, a liberal member of parliament who often visits the United States. “Everyone is worried about 2014. This is not a closed chapter. Obama promised us a responsible exit, and we hope he means it,” she said. “My message to him would be, please don’t step back and give up. Let’s begin a new relationship and work for a common vision. Please don’t ignore us.”

Afghan President Hamid Karzai, whose relationship with Obama has often been acrimonious, issued a lukewarm message of congratulations from Indonesia, where he is attending a conference. In a statement tweeted by his office, Karzai said he hoped Obama’s second term would lead to “an expanded relationship based on mutual interests.”

Karzai cannot legally run for another presidential term, and last week he formally announced the schedule leading to elections on April 5, 2014. But critics fear the election might be tainted by the same kinds of fraud that marred Karzai’s re-election in 2009, leaving Afghanistan with a weak, poorly credible government that must face a persistent insurgency without international military support.

The Taliban, in a statement e-mailed to Western media outlets Wednesday evening, urged Obama to rethink American foreign policy, saying the United States should “stop policing the world” and “further burning the flames of world hatred.

“Obama knows the American nation is fed up with war and faces a dire economic tragedy,” it said. “Therefore he needs to withdraw soon his invading troops from our country and prevent further losses of American soldiers.”

The dominant feelings expressed by dozens of people in Kabul Wednesday were worry, confusion and enormous ambivalence about the past and future U.S. role in their country. Many offered complaints about the behavior of foreign troops, especially their insensitivity to Afghan culture. Yet in the next breath, they pleaded for Obama to keep U.S. forces in the country until it can achieve a modicum of political stability and self-defense.

“Your American troops violated our traditions and customs. They burned our holy Koran, and Americans made the video that insulted our Islam,” said Mohammed Daoud, 25, a student who was snacking between classes at the national teachers’ college. “Now they will go and leave behind only fighting and insecurity.”

Jawad Qazimi, 35, a pharmacist in a neighborhood of West Kabul, said his family survived heavy rocketing but lost their home and possessions during the civil war of the 1990s that nearly destroyed the capital and led to the Taliban takeover.

“I am praying to God that the dark days do not return again,” he said Wednesday afternoon.

“I don’t watch TV and I don’t know about the American election,” Qazimi said. But I know one thing: we need the Americans to stay until our forces can defend us.”

“Damn it,” Obama says under his breath. “Bibi told me he was going to hold off.”

Within 45 minutes, the president’s national security brain trust has convened in the Situation Room. Defense Secretary Leon Panetta informs the group that attempts to reach Israeli Prime Minister Benjamin Netanyahu have so far failed but that Israeli military commanders are briefing the Pentagon on Israel’s targets.

Panetta lays out the United States’ options: either persuade Netanyahu to call it off, or shoot down the planes.

“Shooting down the planes is not an option!” Vice President Biden explodes. “Tell Bibi the president of the United States wants to talk to him now!”

Within minutes, Netanyahu’s voice is heard on the speakerphone, and he immediately preempts any attempts to call off the mission.

“I couldn’t wait any longer, Mr. President,” he says firmly. “I am responsible for the security of the Jewish nation.”

As Netanyahu explains the operation, Obama eyes the large electronic map of the Middle East on the Situation Room wall. The coordinates of the Israeli planes show that they’re nearing Iran.

“Mr. President,” Netanyahu says. “I hope we can count on your full support.”

Obama’s face masks his scorn. He pauses for several moments before responding. “You know I respect Israel’s right to defend itself,” he says, “but I need to do what’s in the interests of the United States.”

Panetta orders the head of U.S. Central Command, Gen. James Mattis, to activate Operation Gulf Shield, putting America’s military forces throughout the Middle East on their highest defensive posture, bracing for Iranian retaliation.

Obama surveys the room. “What do we tell the Iranians?” he asks. “They’re going to assume we’re behind this.”

The battle lines are quickly drawn. Susan Rice — the ambassador to the United Nations and a close Obama confidante, who is in the running to replace Hillary Rodham Clinton as secretary of state — is the first to chime in, via secure video teleconference: “We need to be clear that the Israelis acted without our knowledge. We need to urge Iran to exercise restraint while we restrain Israel.”

“With respect,” CIA Director David H. Petraeus says, “if we send them that message, they’ll think they can retaliate without us responding. The Iranians need to believe that if they respond, the United States will enter this war — and swiftly and decisively end it.”

“I agree with David,” Clinton says. “The Iranians need to know there is no daylight they can exploit between us and the Israelis.”

Within hours, Twitter is alight with reports of explosions in various parts of Iran. All seemingly can be traced to one source: the Iranian opposition group Mujaheddin-e Khalq. Mainstream media outlets say they cannot corroborate the story, and Iranian state media is silent.

A few hours later, while Washington sleeps, the Saudi-owned satellite channel Al Arabiya confirms reports of massive explosions in Iran.

The Israeli newspaper Haaretz alludes to an Israeli military operation in Iran but, citing national security restrictions, does not offer details. It appears that one plane has gone missing, but Israeli officials refuse to comment.

By the time Washington awakens, oil futures are up 20 percent to $110 a barrel.

At 6:30 a.m., Obama meets in the Oval Office with senior campaign adviser David Axelrod and former chief of staff Rahm Emanuel, who have flown in from Chicago.

Axelrod suggests that the White House’s message should be that Iran brought this upon itself.

“What the hell do I say,” Obama asks them, “when the press ask me whether I knew about this operation in advance?”

“Don’t answer yet,” Emanuel says. He scribbles a few sentences on a notepad, rips the paper out and hands it to Obama.

“If we need to,” Emanuel says, “we can leak the news that we weren’t given a heads up. But we shouldn’t disown it right away if there’s potential it was a successful operation.”

Obama shakes his head. “Voters don’t care about whether the attack was successful. They care about $5 gasoline.”

By 8 a.m., the White House has issued the terse statement Emanuel drafted, saying: “The United States is monitoring events in Iran closely. Israel has a right to defend itself, and America’s commitment to Israeli security is unwavering.”

Having long rehearsed this scenario, Republican presidential candidate Mitt Romney is ready with a sharp, gaffe-free response.

While campaigning in Palm Beach, Fla., that morning, Romney pledges his “ironclad support” for Israel and attacks “Obama’s policies of appeasement that left Prime Minister Netanyahu no choice but to take exceptional measures.”

Romney adviser Dan Senor rips into the president on CNN: “Our strongest ally in the world, Israel, is facing an existential threat, and Obama is still leading from behind.”

Another Romney adviser, former U.N. ambassador John Bolton, echoes this theme on Fox News. “Instead of doing his job as commander in chief, Barack Obama outsourced our national security to Israel,” he says. “The American public owes a debt of gratitude to Prime Minister Netanyahu, and we should be prepared to finish the job.”

By late morning, more details of the attack trickle out in the media. The strike reportedly caused extensive damage to Iranian nuclear facilities in Natanz, Arak and Isfahan, as well as to the country’s radar and command-and-control centers. But it’s unclear just how much damage has been done, and there’s no word on casualties.

The American Israel Public Affairs Committee (AIPAC) begins circulating a draft resolution on Capitol Hill expressing the Senate’s “unconditional support” for Israel. By noon, 99 senators — with Rand Paul the lone dissenter — have signed on.

China and Russia condemn Israel, urging restraint and calling for an emergency meeting of the U.N. Security Council. Saudi Arabia, Qatar, Bahrain and the United Arab Emirates — which in WikiLeaked State Department cables from 2010 appeared to support a military attack on Iran’s facilities — condemn Israel’s action but stop short of expressing solidarity with Tehran.

Unable to reach Obama again, Netanyahu tells Biden that it has been a “clean, successful operation,” with minimal Iranian casualties. “Frankly, we should have done this a long time ago,” he says.

But the first batch of satellite photos suggests that the Fordow nuclear plant outside Qom, buried under 300 feet of specially designed concrete, may have survived the raid. Unless Israel or the United States mounts a follow-up attack, Iran may be able to continue enriching uranium fairly quickly.

Iranian state television shows footage of the casualties, including women and children (though an opposition Web site later reveals that these images were actually of recent earthquake victims in northwestern Iran). Iranian Supreme Leader Ayatollah Ali Khamenei vows revenge. “The blood of our women and children is on the hands of the Great Satan and its puppet master!” he says. “The Zionist entity has written its death certificate!”

When the stock market closes, oil prices are up nearly 40 percent, the largest 24-hour increase in history. CNN interviews Americans at gas stations in swing states such as Florida and Ohio; most blame Iran, not Israel or Obama, for the price jumps.

By Friday evening, leaks have emerged from within the U.S. government and military saying that the United States had no prior knowledge of Israel’s actions.

Obama manages to break away from his national security team to join his family for a quick dinner. Sasha and Malia are talking about their schoolwork.

“I don’t like physics,” Malia says. “It’s too complicated.”

“I know just how you feel, honey,” Obama says. “I’ve got a few problems like that, too.”

Of all the points of disagreement between Israel and Hamas, maybe the most profound is this one: Israel cares more about sparing innocent lives — including those of Palestinians — than does Hamas. Not only have Hamas and other militant groups this year sent more than 700 rockets crashing haphazardly into southern Israel, but also Hamas instigated yet another war where the chief loser will certainly be its own people. If hell has a beach, it’s located in Gaza.

The Gaza Strip is a congested, fetid place. It is densely populated and in the slums and housing blocks, Hamas has hidden its weapons, explosives and rocket launchers. Israel has gone out of its way to avoid civilian casualties. Its air force has used new, highly accurate ammunition aiming for rocket-launching sites and government installations. For the most part, it has succeeded.

For Hamas, civilian casualties are an asset. Palestinians love and grieve as do other people, but Hamas leadership knows that the world has gotten impatient with Israel. Increasingly, many people now see Israel as the aggressor, as Gaza’s occupying power (never mind the 2005 pullout), and they overlook such trifles as the Hamas charter, which is repellently anti-Semitic and cites the discredited forgery “The Protocols of the Elders of Zion.” In the Hamas cosmology, Jews are so evil that somehow “they also stood behind World War II, where they collected immense benefits from trading with war materials.” This, you would have to concede, is a wholly original take on the Holocaust.

Many in the West heroically ignore such nonsense. They embrace Hamas as the champions of a victimized Third World people. In recent days, some editorialists have bemoaned the war and Hamas’ role in inciting it. But then comes the inevitable “however.” “However, the government of Benjamin Netanyahu must also take much blame for stoking resentment among Palestinians in Gaza and the West Bank for so long,” opined the Financial Times. The New York Times’ caveat came lower down in its initial editorial on the war: “But it would be easier to win support for retaliatory action if Israel was engaged in serious negotiations with Hamas’ rival, the Palestinian Authority.” Apparently, 700 rockets are not enough.

Look, let us stipulate: Palestinians have suffered greatly. They have legitimate grievances. Israel has at times been a bully, and the slow and steady march of West Bank settlements is both wrong and destructive of the (nonexistent) peace process. But for all this, it is insane to apply the Officer Krupke rule (from “West Side Story”) to Hamas: “We ain’t no delinquents, we’re misunderstood. Deep down inside us there is good.” There is little good in Hamas.

Hamas is not the passive party in this struggle. It rules Gaza by force. The other day it murdered — please don’t say “executed” — an alleged collaborator without the inconvenience of a trial, shooting the man on a crowded street. It chose to make war by allowing more militant groups to use Gaza as a launching pad for rockets and firing off the occasional rocket itself. No nation is going to put up with this sort of terror. The rockets do some, not a lot of damage, but that’s not the point. The point instead is that people who have the wherewithal will not continue to live in a place where even the occasional rocket can come down on your kids’ school. This is not a mere border problem. For Israel, this is an existential threat.

What various editorial writers and others seem not to understand is that the very peace agreement they accuse Israel of forestalling is, in fact, impeded by Hamas’ use of violence. Who wants to make peace with extremists? Who wants to give up land for the promises of peace offered by zealots who read Hitler for inspiration? Israel pulled out of Gaza once already. Abandoned greenhouses were refurbished by Jewish philanthropists in America. The greenhouses were trashed and with them what now seems like naive optimism. Soon, Hamas took control and the rockets started hitting Israel.

This war between Arabs and Jews, between Israelis and Palestinians, is well over 100 years old. Both sides have a case and both sides have proved to be indomitable. But both sides are not equally right in all instances. Hamas sent rockets into Israel, not caring if they hit a chicken coop or a group of toddlers jumping in and out of a sprinkler. You want balance? Here’s balance. Hamas didn’t care if its own people died either.

The drama unfolding in Gaza seems numbingly familiar. This time, however, there’s a big and potentially tragic difference: Not even the actors — Palestinians and Israelis — can possibly know how it will turn out.

How many times must they rehash this tired plot? Resentments build, tensions rise. A disputed border incident provides a spark. Israel reacts with sudden force. Palestinians fire rockets at civilian targets. Israel launches reprisal attacks — first justified, then disproportionate. Anguished women wail at the funerals of dead children. Men swear oaths of vengeance, solemn vows that honor and self-respect will never allow them to break.

The usual ending is a cease-fire and a return to the status quo. But the whole Mideast region is undergoing a process of tumultuous change, and there is no guarantee that the stasis considered “normal” in the occupied territories will ever return.

As President Obama noted, Israel has the absolute right to defend itself against rocket attacks whose sole purpose is to terrorize and kill civilians. Israel does not have a right, in my view, to keep Gaza’s 2 million residents under permanent blockade as punishment for choosing officials of Hamas, the Islamist group, as their leadership.

Hamas, of course, has no right to launch rockets at Israel knowing they may fall on schools, hospitals and playgrounds. But Israel has no right to use this flare-up as an excuse for what some commentators have called “mowing the grass” — assassinating Palestinian leaders who have proved particularly effective, destroying infrastructure for the sake of destruction, chalking up civilian casualties in Gaza as an unfortunate side effect.

Israel has the right to exist in peace. Palestinians have the right to an independent state. Each side insists on having its rights fully acknowledged before the other side’s rights are even considered.

Enough with rights. Someone has to start dealing with new and unfamiliar realities.

Henry Kissinger’s famous observation about Israel’s security was that there could be no war without Egypt, no peace without Syria. For more than three decades, Israel has had a peace treaty with Egypt, the Arab world’s most populous state, and a strictly observed truce with Syria across the Golan Heights. But then came the Arab Spring.

Egyptian dictator Hosni Mubarak is gone, replaced by an elected government whose leaders are members of the once-banned Muslim Brotherhood — an organization that has nurtured and supported Hamas. The new government has pledged to honor the treaty, but it is likely to take the plight of the Palestinians much more seriously than did Mubarak, who saw them not as brothers and sisters but as pawns.

Syrian dictator Bashar al-Assad, meanwhile, is fighting for his regime’s survival in a civil war. It is quite possible that the country will fracture — and with it, perhaps, the once-sturdy Golan truce.

Throughout the Arab world, religious parties are demanding — and attaining — new power and influence. There are many reasons for this Islamic ascendance, most of which have nothing to do with Israel. But is the continued Israeli occupation of the West Bank and Gaza a contributing factor? Yes, without a doubt, if only because it represents Arab humiliation and provides a focal point for a host of grievances.

Another factor to take into account is the influence Iran now has in Syria and Gaza. One of Israel’s aims in the current bombing campaign may be to degrade Iran’s ability to retaliate — with rockets fired from Gaza — in case of an Israeli attack on Iranian nuclear facilities. But does anyone really think the regime in Tehran is viewing these events with anything other than smug satisfaction? Perceived Israeli excesses in Gaza — more than 90 people have been killed so far — can only weaken international support for an attack on the nuclear sites.

There are far too many variables for anyone to be confident of what happens next. Perhaps Israeli Prime Minister Benjamin Netanyahu and Hamas leader Ismail Haniyeh have an exquisite sense of how far they can push before things spin out of control. I hope so.

Both leaders say they want a cease-fire. Once the fighting stops, there must be renewed negotiations toward the obvious two-state solution. The Obama administration should use its power and influence to bring Israelis and Palestinians to the table, kicking and screaming if necessary.

Given the situation, a peace process is likely to be long, bitter and frustrating. But not undertaking one, as everyone should now realize, is much worse.

In the aftermath of an exhausting reelection campaign, the most urgent decision facing the president is how to stop Iran from pursuing a military nuclear program. Presidents of both parties have long declared that “no option is off the table” in securing this goal. In the third presidential debate, the candidates agreed that this was a matter of the American national interest, even as they described the objective alternately as preventing an Iranian “nuclear weapon” or “breakout capacity” (President Obama), or a “nuclear-capable Iran” (Mitt Romney). As Iran continues to elaborate its enrichment capacity and move it underground, Israeli Prime Minister Benjamin Netanyahu has announced a spring deadline for counteraction. In this fraught environment, what operational meaning should be given to America’s declared objectives?

The United States and Iran are apparently conducting bilateral negotiations through official or semiofficial emissaries — a departure from the previous procedure of multilateral talks. Negotiations over Iran’s nuclear program do not have an encouraging record. For more than a decade, Iran has stalled, first with the “EU-3” (France, Germany and Britain) and then with the “P5+1” (the members of the U.N. Security Council plus Germany). It has alternated hints of flexibility with periods of intransigence, all while expanding, concealing and dispersing its nuclear facilities. If no limit is placed on this process, Iran’s tech*no*logical progress will dominate events. But at what stage, and in what manner, should Iran be deprived of a military nuclear capability? This has been the essence of the argument over “red lines.”

Three stages are involved in the evolution of a military nuclear capability: a delivery system, a capacity to enrich uranium and the production of nuclear warheads. Iran has been augmenting the range and number of its missile systems since at least 2006. Its enrichment capacity — long underreported to the International Atomic Energy Agency — has been expanded to thousands of centrifuges (the instruments that enrich uranium to bomb-grade material). The level exceeds any reasonable definition of peaceful uses authorized by the Non-Proliferation Treaty. The inevitable culmination is a nuclear weapon.

To draw the line at proscribing an Iranian nuclear weapon — as some argue — would prove unmanageable. Once the requisite amount of fissile material has been produced, constructing and equipping a warhead is a relatively short and technologically straightforward process, almost certainly impossible to detect in a timely fashion.

If so ineffectual a red line were to emerge from a decade of diplomacy by the permanent members of the Security Council, the result would be an essentially uncontrollable military nuclear proliferation throughout a region roiled by revolution and sectarian blood-feuds. Iran would thereby achieve the status of North Korea, with a military nuclear program at the very edge of going operational. Each nation that has a nuclear option would compete to minimize the time to its own full military nuclear capability. Meanwhile, countries within the reach of Iran’s military but lacking a nuclear option would be driven to reorient their political alignment toward Tehran. The reformist tendencies in the Arab Spring — already under severe pressure — would be submerged by this process. The president’s vision of progress toward a global reduction of nuclear weapons would suffer a blow, perhaps a fatal one.

Some have argued that even in the worst-case scenario, a nuclear Iran could be deterred. Yet this ignores the immensely costly, complex and tension-ridden realities of Cold War-era deterrence, the apocalyptic strain in the Iranian theocracy and the near-certainty that several regional powers will go nuclear if Iran does. Once nuclear balances are forged in conditions where tensions are no longer purely bilateral, as in the Cold War, and in still-developing countries whose technology to prevent accidents is rudimentary, the likelihood of some nuclear exchange will mount dramatically.

This is why the United States has insisted on limits on Iranian enrichment — that is, curtailing access to a weapon’s precursor elements. Abandoning the original demand to ban all enrichment, the P5+1 has explored what levels of production of fissile material are compatible with the peaceful uses authorized by the Non-Proliferation Treaty. The higher the level of enrichment, the shorter the time needed to bring about militarily applicable results. Conventional wisdom holds that the highest practically enforceable limit is 5 percent The time available for a diplomatic outcome shrinks in direct proportion as the Iranian enrichment capacity grows and a military nuclear capacity approaches. The diplomatic process must therefore be brought to a point of decision. The P5+1 or the United States unilaterally must put forward a precise program to curtail Iranian enrichment with specific time limits.

This does not imply a red line authorizing any country to go to war. However respectfully the views of friends are considered, the ultimate decision over peace or war must remain in the hands of the president. Why negotiate with a country of such demonstrated hostility and evasiveness? Precisely because the situation is so fraught. Diplomacy may reach an acceptable agreed outcome. Or its failure will mobilize the American people and the world. It will clarify either the causes of an escalating crisis, up to the level of military pressure, or ultimate acquiescence in an Iranian nuclear program. Either outcome will require a willingness to see it through to its ultimate implications. We cannot afford another strategic disaster.

To the extent that Iran shows willingness to conduct itself as a nation-state, rather than a revolutionary religious cause, and accepts enforceable verification, elements of Iranian security concerns should be taken seriously, including gradual easing of sanctions as strict limits on enrichment are implemented and enforced. But time will be urgent. Tehran must be made to understand that the alternative to an agreement is not simply a further period of negotiation and that using negotiations to gain time will have grave consequences. A creative diplomacy, allied to a determined strategy, may still be able to prevent a crisis provided the United States plays a decisive role in defining permissible outcomes.

John Prados, a senior research fellow at the National Security Archive, is the author of the e-book “Rethinking National Security” and the book “Islands of Destiny: The Solomons Campaign and the Eclipse of the Rising Sun.”He is working on a book about the CIA “Family Jewels.”

Because of an affair that had already ended, the nation this month lost the services of a highly skilled public servant. The hysterical reaction to the news of then-CIA Director David Petraeus’s liaison with his biographer, Paula Broadwell, has done more to harm national security than the affair itself.

Since early summer, the FBI had been, appropriately, investigating the harassing e-mails that Broadwell sent to another woman about Petraeus. Though the bureau eventually uncovered the affair, it found no reason to believe that the general had compromised anything related to security. Yet after the FBI informed the director of national intelligence, James R. Clapper — mistakenly, in my opinion, because no evident crime had been committed — Petraeus resigned ahead of the inevitable wave of public controversy.

That was a judgment call.

Petraeus’s downfall should prompt the intelligence community to make its own judgment call — to end the arbitrary and outdated rules that govern U.S. intelligence employees. These rules have damaged U.S. interests in the guise of protecting our security. On many occasions, they have resulted in the loss of the services, and even the loyalty, of experienced, highly trained people.

Two of the most egregious rules have been the CIA’s insistence on investigating foreigners engaged to agency employees and its own version of “don’t ask, don’t tell,” under which intelligence officers found to be gay lost their clearances or even their jobs. The latter policy was, fortunately, revoked in 1998 by executive order — not by the agency.

The security mavens will say that such rules have protected intelligence officers from blackmail. Since the passage of the Central Intelligence Agency Act of 1949, the agencies’ security units have had the legal authority to enforce such proscriptions. But the thought that a prospective spouse would have to pass a security check must have led many valuable intelligence officers to quit. And the thought that sexual preferences could cost someone her or his job must have led to other departures — or to officers not working to the fullest extent of their capacities, keeping their heads down to avoid attracting attention.

It is impossible to determine how much talent has been lost because of such regulations. There is only anecdotal evidence.

Eric H. Biddle, a skilled operations officer who worked for eight years against the Soviets, resigned from the CIA in 1960 because he wanted to marry his Greek girlfriend. The Soviet Union was our main intelligence target at the time. In another damaging incident that year, National Security Agency officers William H. Martin and Bernon Mitchell defected to Moscow. Officials blamed it on their alleged homosexuality, although evidence was scant, and both went on to marry Soviet women. Nevertheless, the case resulted in dramatic changes in hiring practices, and other agents suspected of being gay were purged from the agency.

Fast-forward a couple of decades, and one has to wonder about the impact on Aldrich Ames, the notorious Soviet spy within the CIA, of the agency’s vetting of his Colombian wife.

Intelligence officers often characterize the late Philip Agee, a spook who resigned to rail against his former colleagues, as the man most destructive to agency operations in the 1970s and ’80s. Agee’s revelations of the names of CIA officers and operatives forced the termination of a host of agency projects, even ones not related to his direct targets. U.S. policies disillusioned Agee, but the catalyst for his crusade was the CIA’s demand to investigate his Mexican girlfriend.

Compounding the effect of such regulations is the double standard often applied to senior officials vs. junior officers. The rules forced Agee out of the agency, but Petraeus stayed on, even as an investigation of his affair was underway. Later he was able to submit a “voluntary” resignation.

In the 1960s, CIA officer Hans Tofte was fired after he was found to have taken classified documents home to work on them. In the 1990s, CIA Director John Deutch, caught with classified material on his home computer, emerged unscathed.

Mary Margaret Graham, the agency’s counterintelligence chief, was driven out of the CIA in 2005 by Director Porter Goss after she put evidence of the bad behavior of Kyle D. Foggo, Goss’s preferred candidate for executive director, before his aides. Several years later, Foggo would be convicted of fraud in a tremendous embarrassment to the agency. This was a case of failure to enforce regulations because they involved a senior officer. Foggo was protected from allegations that would have ended the career of a lower-level employee.

The factors that contribute to a strong national security are not just the power and sophistication of military forces, or the reach of U.S. intelligence operations, but the morale and skill of the people who work for the system.

The core value is the U.S. national interest. And that interest is not served by security regulations that drive away talent. Redundant protections for secret information are important, but the system also relies on rules that are artifacts of the Cold War era and the social and political mores of that time.

The ostensible concern about the Petraeus affair was the potential for blackmail. Yet it is far-fetched today to think that a foreign government would contrive an operation to ensnare a CIA employee through an affair, a foreign-spy spouse or an allegation of homosexuality. Our enemies are unlikely to bother with such complicated schemes. Instead, they buy information — the method that has remained tried and true — or attempt to hack it from the data-rich computer networks that the government is spending billions to defend.

The agencies actually invite entrapment by maintaining archaic strictures that punish behaviors that may be considered objectionable but are in no way criminal. Doing away with double standards in enforcement is also vitally necessary.

Whatever the fallout from the Petraeus affair may be, it offers us the opportunity to revisit and revise the codes of conduct that pose dilemmas for our talented and irreplaceable intelligence officers.

Whatever else that might be said about the Arab revolutions, it’s obvious that they pose a problem for Israel. But how bad, and what should the Israeli government do to hedge its risks? I heard some interesting — but not very encouraging — ideas on this subject from top government officials last week.

To sum up: Most officials think that relations with the Arabs are gradually going to get worse, perhaps for decades, before democracy really takes root and the Arab public, perhaps, will be ready to accept the Jewish state. The challenge for Israel is how to avoid inflaming Arab public opinion, a newly important factor, while protecting the country.

The trouble ahead is symbolized by the election of Mohamed Morsi, a Muslim Brotherhood leader, as president of Egypt. His inauguration prompted a wary message of congratulation from Prime Minister Benjamin Netanyahu, expressing hope that *Israeli-Egyptian relations will be cooperative and based on mutual interest. The statement masked deep Israeli anxieties.

Netanyahu fears an erosion of the relationship with Egypt over time and wants to slow that process, if possible, while preparing for potential trouble. Netanyahu is said to view these precautions as the equivalent of putting up shutters before a storm.

The most obvious test will be Gaza, where the militant Hamas leadership is closely allied with the Muslim Brotherhood. Netanyahu has tried to de-escalate crises that have arisen, but if rocket attacks increase, they may draw a harsh Israeli military reaction — which could worsen relations with Cairo.

Efraim Halevy, the former Mossad chief, says Israel should face reality and begin talking with Hamas. But others stress the growing threat in Gaza: Israel has intelligence that militants there have tried to buy shoulder-fired anti-aircraft missiles from Libya, and the Israeli air force now operates on the assumption that such missiles are present in Gaza, in addition to the array of other rockets.

The Sinai Peninsula is another flash point. This vast desert is becoming a lawless area where al-Qaeda and other terrorist groups are trying to find a haven. Intelligence officials here believe the extremists’ strategy is to provoke an Israeli retaliation and thereby encourage an unraveling of the Israel-Egypt peace treaty. I didn’t hear any clear formula for how Israel can respond to attacks without falling into this trap.

The chill in Israel’s relationship with Turkey adds to the dangers of instability in Egypt, Libya and Syria. Netanyahu has responded by seeking new allies, including:

● A “Balkan arc” anchored by newly closer relations with Greece, Cyprus, Bulgaria, Romania and Albania. Some of those countries allow the Israeli air force to train in their airspace, providing an alternative to the now-unfriendly skies over Turkey.

● An implicit, if unspoken, alliance with Saudi Arabia and other gulf states against Iran and against Muslim Brotherhood extremism. In this silent courtship, the Israelis are offering an alternative to an America that’s no longer seen as a reliable protector of the conservative gulf regimes.

● New links with governments in sub-Saharan Africa, such as Kenya, Uganda and the Ivory Coast, which are worried that the rise of militant Islam in North Africa will spread south.

Israeli leaders know these new friendships, however useful, won’t alter the basic threat posed by an Arab awakening that, in most countries, has empowered militant Islamic groups. Within the government, there’s a range of views about just how bad the future will be, but nobody uses the congenial phrase “the Arab Spring” that has been common in the West.

Among the optimists, relatively speaking, is said to be Defense Minister Ehud Barak. He thinks Egypt and other neighbors will move toward a version of the “Turkish model” of Islamic democracy, which may be cool toward Israel but will also be pragmatic. Barak thinks Israel can’t simply wait for the storm to pass. The process of change is irreversible and may eventually be benign as the Arab societies mature.

A darker view is taken by some of the officials who know the Arab world best. They think that for at least the next several years, as Morsi and other Muslim Brotherhood leaders try to consolidate power, they may appear cooperative. But at the core of the Brotherhood’s ideology is rejection of Israel, and any compromises with Israel will be tactical moves, rather than real peace.

Israel’s existence, never easy, has gotten more complicated and unpredictable. “We are still inside this huge historical shift,” says one senior official, “and we don’t know where it’s going to take us.”

US President Barack Obama’s first foreign policy trip abroad since his reelection to reassert American influence in Southeast Asia to counter China’s rising economic and military power in the region ran into strong head winds of tension churned by territorial disputes between Beijing and smaller littoral states in the South China Sea.

Tension flared up on Monday at the summit meeting of the 10-nation Association of Southeast Asian Nations in Phnom Penh. Asean leaders plunged into heated discord over how the organization would handle conflicting claims between China and four Asean members—the Philippines, Brunei, Malaysia and Vietnam. The leaders had hoped to present a solid front on the territorial disputes but found themselves hopelessly fractured on the issue of how to deal with China.

The day before, on Sunday, they decided to ask China to start formal talks to draft a legally binding code of conduct in the West Philippine Sea (the Philippines’ name for the South China Sea) to avert armed conflict over the disputed territories. The decision proved provocative to China, which had earlier warned that the summit should not be overshadowed by a dispute, “as the situation is under control and countries involved can resolve differences themselves.” This warning underscored China’s preferred approach to conflict resolution—bilateral, rather than multilateral, talks, a mode that favors China, allowing it to bully weaker neighbors. It had also warned the United States against intervening in the disputes.

The Asean move to close ranks behind the multilateral approach crumbled in the face of China’s pressure and threats. It came as Asean wound down its two-day meeting and as it prepared to start a dialogue between Obama and outgoing Chinese Premier Wen Jiabao in another and related forum, the East Asia summit. The expanded-dialogue participants included Japan, India, Russia, South Korea, Australia and New Zealand.

The move sparked a heated debate between President Aquino of the Philippines and Prime Minister Hun Sen of Cambodia, an ally of China. It also exposed the deep divisions in Asean on the issue of a unilateral or bilateral approach. The clash was provoked by a report of Cambodia, the summit host, on Sunday that Asean leaders had agreed not to “internationalize” the disputes and would continue negotiations between the bloc and China. Mr. Aquino heatedly disputed the report on Monday, insisting that no such consensus had been reached.

He took exception to Hun Sen’s remarks that the Asean countries had agreed to negotiate the West Philippine Sea dispute within an “Asean-China” framework. “The Asean route is not the only route,” Mr. Aquino said at the Asean-Japan summit, one of the side meetings. He understood the Hun Sen statement to mean the exclusion of other international forums to resolve territorial disputes, including the United Nations’ Convention on the Law of the Sea (Unclos).

At the Asean summit, Mr. Aquino also asked the United States to be involved in the discussions. He spoke at a session attended by Obama. “It is especially vital to have the world’s largest economy involved in the discussions considering the interconnectedness of our milieu,” he said. These remarks were expected to anger China. The fractures at the Asean summit opened the way to a tumultuous encounter between Obama and Wen at the East Asian summit, within the full view of Asean leaders and their dialogue partners.

Obama’s Asian swing, visiting Thailand, Burma (Myanmar), and Cambodia, is described by White House officials as demonstrating US clout in Asia. This is expressed through the foreign policy to “pivot” to Asia, a strategy shift aimed at expanding US presence in the Asia-Pacific, in the face of China’s rising economic and military power.

The East Asian summit will mark the first meeting of US and Chinese leaders after the US presidential election and the selection of Xi Jinping as secretary general of the Chinese Communist Party at its 18th national party congress last Thursday.

Obama’s trip closely followed the Chinese Communist Party’s congress, in which Hu Jintao, the outgoing president, called for China to become a “maritime power.” Hu told the opening session of the congress: “It should … resolutely safeguard China’s maritime rights and interests, and build China into a maritime power.” The Financial Times reported that Hu’s speech “will fuel concerns among its neighbors and in the US over how it deals with a host of territorial disputes.”

A recent article in Bloomberg explains Obama’s Asia pivot policy. It says Obama’s whirlwind visit to Asia takes place against a backdrop of tension and uncertainty. China and Japan are “at daggers drawn over a handful of rocky islets surrounded by potentially rich deposits of oil and gas.”

It also notes the “territorial tensions between China and a number of its Souheast Asian neighbors in the South China Sea.”

As US officials have taken pains to point out, however, America has reasons far beyond China’s military spending to seek a bigger presence in Asia. The region now accounts for 25 percent of US exports (supporting an estimated 2.4 million jobs) and 35 percent of its imports. By 2030, according to one estimate, it will account for 49 percent of the global population, 43 percent of the gross domestic product, 35 percent of trade, and 38 percent of market capitalization. “Failure to deepen US engagement with Asia would be strategic malpractice on a grand scale.”