Ambassador James F. Jeffrey, a distinguished visiting fellow at the Washington Institute for Near East Policy, retired in June after 43 years of government service, including as an Army officer in Germany and Vietnam and 35 years in the Foreign Service, including three in Iraq.

For most of America’s history, our diplomacy was based on establishing rapport with foreign leaders, negotiating military alliances, promoting trade and reporting back to Washington on key developments, all while watching out for our citizens abroad. But since World War II, and particularly under Presidents Obama and George W. Bush, our approach has expanded: Our diplomats now move beyond host government offices to work directly with populations to help mediate conflicts, press economic development and serve shoulder to shoulder with the military in the fight against terrorism.

This new type of mission, dubbed “expeditionary diplomacy,” is hands-on and often effective. But, as we saw with the Sept. 11, 2012, attack on the Benghazi outpost that killed Ambassador J. Christopher Stevens and three other Americans, it can also be very dangerous. In hearings this past week before Senate and House committees, Secretary of State Hillary Rodham Clinton reiterated her conviction that direct-to-the-population diplomatic work is essential for U.S. security. But to make sure the risks of expeditionary diplomacy are worth the rewards, we need a clear, formal framework for deciding when these missions should be undertaken, avoided or rolled back.

Clinton alluded to this when she promised the Senate Foreign Relations Committee that her department would review “where, when and whether” before deploying our diplomats. Likewise, an independent review led by Ambassador Thomas R. Pickering and Adm. Mike Mullen of what happened in Libya noted the need, at times, for “downsizing, indirect access and even withdrawal.” However, the Foreign Service’s culture of courage will routinely answer Clinton’s three W’s with “everywhere, always and of course.”

I’ve experienced these dilemmas firsthand. For example, during my time as deputy chief at the U.S. Embassy in Baghdad, I lost a civilian officer in 2004 when he ignored instructions to travel with an escort as he helped his Iraqi government colleagues deliver services to their people.

After the Vietnam War, the military faced a similar choice in deciding when and where to use force overseas. In the 1980s, Defense Secretary Caspar Weinberger and then-Lt. Gen. Colin Powell drafted an informal but influential guide, which became known as the Powell Doctrine, that informed our decisions in Kuwait, Bosnia and Kosovo. It calls for military action only when key U.S. interests are at stake; says we must state clear, achievable objectives for every mission and devote the necessary resources to them; cites the need for congressional and popular support; and cautions that war should be a last resort.

Of course, deploying State Department officials in expeditionary missions is not the same as sending troops into combat, but the 1979 hostage-taking at the U.S. Embassy in Tehran and the Benghazi attack last year show the risks of getting diplomatic operations wrong. Thus, a modified version of the Powell Doctrine could be a good guideline for deciding where, when and whether to deploy our brave diplomats. It would ensure that their risks and potential sacrifices are in the service of important — and achievable — foreign policy goals.

What would such a doctrine look like? How would it be applied?

First, recognize that even with the best security and abundant resources, expeditionary diplomacy is risky. Stevens had requested more security for his Benghazi office, but lower-level workers at the State Department blocked the request, which did not make it to Clinton or other senior officials. Such bureaucratic screw-ups need to be fixed — fast — building on the proposals made by the independent review and Clinton’s commitments to Congress.

Even with good security, we will sometimes lose people. During the successful campaign to wrest much of Baghdad’s Sadr City from Iranian surrogate control in 2008, a State Department provincial team lost five personnel, despite U.S. Army security. But they were making a crucial contribution to the U.S. surge in Iraq, and taking risks under those circumstances is necessary.

Second, given the risks, get involved only when key U.S. interests are at stake. This is easy to say but harder to implement, as we usually consider any territory critical, especially if our enemies contest it. But, as with Somalia, some places are not worth the risks of permanent diplomatic deployment. Iraq, once U.S. troops were committed there, became a key national interest, justifying our considerable State Department losses in Sadr City and elsewhere.

Third, require that any expedition — be it keeping a post open under fire or putting people in the field — be effective enough to be worthwhile. That is, can we make a difference by showing the flag, helping dig a well or working toward conflict resolution — and will local partners work with us? The record of international development and conflict resolution in poor nations is spotty, thus our engagement in a given place is not automatically worth it. And not all people want to engage us, particularly in the Islamic world. In Iraqi Kurdistan and among the Northern Alliance in Afghanistan, we found people eager to cooperate with us on security and accept our help. But in places such as Mali and Yemen, we show the flag in defended embassies but are careful about roaming outside.

Secretary of State Hillary Rodham Clinton testified before the Senate Foreign Relations Committee on the September 11th attacks on the U.S. consulate in Benghazi on Wednesday. Clinton’s voice broke when she spoke of the safety of U.S. diplomats abroad. (The Washington Post)

Fourth, where expeditionary missions make sense, be sure to get enough resources. Many an expeditionary meeting I attended ended with the local partner saying something like: “Great chat, but what will you do for us?” In Iraq, our civilians were backed by billions of dollars in aid money, giving Ambassador Ryan Crocker, for example, the leverage to press Iraq to bring in international oil companies. Today, Iraq is the second-largest OPEC oil exporter and should provide 45 percent of the world’s new crude supplies this decade — helping calm global oil markets and gas prices, and facilitating our oil embargo of Iran.

Fifth, as stressed in Clinton’s 2010 Quadrennial Diplomacy and Development Review, leverage other institutions and capabilities — such as local governments, the U.S. military, other countries’ missions, international agencies and nongovernmental organizations — to ensure that a mission is as effective as possible and has adequate resources. “Made in America” doesn’t always work best. In Iraq, after U.S. forces left in 2011, we ratcheted back our security but still had to work with Iraqis on their ground. For the first time in Iraq, the embassy relied on local government forces to secure landing zones.

Finally, review the situation constantly, not just within the organizations directly involved but at the White House and the Pentagon, to account for ever-changing realities. For example, in Iraq in 2011, with the situation stabilized somewhat and the U.S. military gone, our interests were not as vital as when we faced a raging insurgency and had 170,000 troops deployed. Accordingly, Clinton directed us to reconfigure our mission, working only in crucial areas such as Basra and Irbil.

Our civilians overseas will bravely do whatever we ask of them. But we must make sure we task them only with what is necessary so their sacrifices are worth it. I believe that standard was met in Benghazi, given the stakes in Libya and our relationship with the population. But if we are not careful, that might not be the case next time.

Read more from Outlook, friend us on Facebook, and follow us on Twitter.