President-elect Barack Obama has affirmed his commitment to bring the war in Iraq to a close and to refocus our attention on Afghanistan. To do both, Obama must do more than fix ambitious timelines or offer hazy plans with muddy particulars. He must stick to his campaign pledge that would fundamentally shift the ideological orientation of America’s foreign policy establishment: ending the Iraq mission will require engaging Iran, solving Afghanistan will mean dialogue with terrorists.

Obama will certainly bring “change” if he commits to engage directly with Iran. In his judgment, the stability we seek in Iraq is impossible unless we make a concerted effort to induce the actors surrounding Iraq to be responsible stakeholders. To Obama, that can come about only if we engage Iran openly, maturely, and without preconditions.

Since 1979, when a group of Iranian students seized the U.S. embassy in Tehran, the United States has attempted to isolate Iran internationally. Occasionally, the interests of Tehran and Washington overlapped, most recently, when Iran quietly supported America’s effort to oust the Taliban regime in Afghanistan. But today, Iran has a budding nuclear program, the region’s largest population, an expansive ballistic missile arsenal, and it extends its reach through sponsorship of an effective proxy, the Lebanese Shi’ite group Hizbullah. America’s thirty year strategy of isolating Tehran’s clerical regime clearly hasn’t worked. If diplomatic avenues remain closed, stability in Iraq will remain impossible.

Under an Obama administration, pulling ourselves out of Iraq means injecting ourselves deeper into Afghanistan, which the President-elect says should be America’s “biggest national security priority.” His plan is to withdraw U.S. combat forces from Iraq within 16 months and possibly leave 60,000 behind for support. Obama is in luck. This week, the Iraqi parliament approved the Status of Forces Agreement with the United States, which outlines the conditions under which U.S. troops will be permitted to remain in Iraq. Under the deal, U.S. troops will withdraw from Iraq by the end of 2011. A pullout by 2011, endorsed by the Iraqi parliament, is chronologically compatible with Obama’s call for a 16-month withdrawal (only 7 months shy). Not only would this plan provide Obama with some wiggle-room on his campaign pledge, but the troop cut from Iraq would free up more troops for Afghanistan.

On the Afghan front in America’s so-called “war on terror,” the White House and U.S. Central Command (CENTCOM) are currently reviewing new approaches to stabilize the war-ravaged country. One plan is to peel Pashtun tribes away from hardcore elements of the Taliban, a nuanced policy that will require dialogue with rank and file pro-Taliban insurgents. The incoming Obama administration has indicated it will consider adopting this approach. If it does, Obama would fulfill yet another campaign pledge: actually paying attention to what army generals on the ground have to say. Only weeks ago, CENTCOM chief General David Petreaus said a new U.S. strategy in Afghanistan may include reconciliation with Taliban insurgents. One potential problem with U.S. and NATO efforts in Afghanistan are the militants pouring over the border from western Pakistan. Obama’s endorsement of continued unilateral missile strikes and commando raids on Pakistani soil–a continuation of Bush policies–will have ripple effects throughout tribal society, encouraging insurgents to lash out against the government of Pakistan and undermining the authority of sitting Pakistani leaders. Luckily, Barack Obama was broadly welcomed inside Pakistan. If Obama proves capable of improving America’s reputation abroad, maybe his policies would be more readily accepted than his predecessor.

But engagement on both fronts may prove discouraging. For Iran, and its consequences on Iraq, certainly Tehran’s clerical leaders could refuse to negotiate, or demand too much in the way of concessions. In Afghanistan, talks with day-to-day fighters may have no impact on the senior leadership’s decision to renounce violence or stop recruiting. But to deal with worsening security conditions in both countries, Obama must succeed where Bush clearly failed. In Iraq, Bush’s half-hearted attempts and sometimes outright refusal to talk with our adversaries in the region unjustly burdened our armed forces, saddling them with the responsibility of achieving unrealistic objectives. In Afghanistan, the Bush administration ignored the country’s social and ethnic history, and only until recently considered the prospect of reaching out to Afghanistan’s tribal elders, whose help is proven critical for NATO’s fight against the Taliban.

Laying the ground work for dialogue requires an understanding of our adversaries and adapting our policy accordingly. Saving America from defeat on both fronts will take more than wishful thinking, blind ideology, and a feckless refusal to consider the utility of mutual dialogue. It will take a bold visionary willing to initiate sound, pragmatic statecraft.