The Obama administration is reportedly considering airstrikes against the Islamic State after several days of advances by the putative caliphate. Also under consideration is the delivery of humanitarian aid to minority groups that fled as ISIS approached, with thousands reportedly trapped without food or water in rough terrain and scorching heat. France and Turkey may be joining in an American intervention—apparently, the Turks have already been delivering aid.

“Going back into Iraq” will be a tough sell for Obama at any scale. But a confrontation between America and the Islamic State is probably inevitable—if not now, then at some point in the future. ISIS’s gains profoundly destabilized the region, with diplomatic alignments put under pressure, vital infrastructure captured and large refugee flows. Kurdish independence and the broader breakdown of the region’s old colonial borders have both become more likely. The magnetic pull of jihad is growing. Iraq’s internal politics have grown even rougher; externally, Iran and Russia have increased their influence in Baghdad. An effort to contain or push back ISIS, in this light, is certainly worth considering. What factors should shape America’s approach?

Local leadership: Ideally, regional powers would bear most of the burden of an intervention. They have more at stake in the outcome and thus will be better at sustaining involvement. There are other benefits, too. As others have noted, it might not be smart for the United States to take the lead in crushing a proclaimed caliphate: among other things, it fits the narrative pushed by Osama bin Laden and others that attacking and defeating America must be the first step of an Islamist restoration. That narrative has lost its allure, with the Islamic State now the most prominent example of a trend back toward the more typical form of violent jihad: attacking local authorities first. A war initiated by France—rather like the war against Gaddafi—would address the first consideration. A war initiated by Turkey would address both.

The downside of using local actors is that they often have goals that are quite different from our own—that is why, for example, calls for Washington to work with Tehran against ISIS have not been met with much interest on either side. Local actors also lack many of America’s capabilities, limiting their ability to achieve results. Yet there are balances to these drawbacks: Turkey and Iran, for example, have long competed for influence in Northern Iraq, which should be a sign to us that there will be natural obstacles to either gaining dominance. And while Turkey’s military isn’t as adept as America’s, the odds are slim that America would bring the full range of its capabilities to bear on the ISIS problem—or that we’d do so for very long.

The Turks are also more familiar with local politics and local culture—a skill set we lack, and one that is going to be useful in establishing a sustainable, local solution. And while Turkey seems to be growing more autocratic and more unfriendly to America and its allies, it’s not the same kind of danger as ISIS, it’s still a NATO member, and the fact that it’s taking steps in Iraq that parallel our own shows that we still share interests there.

Local actors are, in short, the best hope of a long-term solution, one that not only turns back the fanatics but builds something approximating a stable political system—the lack of that system is, after all, a central factor in ISIS’s success. America does have a role here, though. Iraq, the Kurds, Turkey and Iran all have an ability to shape outcomes—and to thwart them. We’d be a decent mediator. One key limit, though: We’ve been very hesitant to bring Tehran into similar regional security dialogues, such as attempts to find a diplomatic solution in Syria. Iran has enough pull in Baghdad and parts of Kurdistan to make excluding them expensive, but we might try to do that anyway.

Iraqi Sunni grievances: ISIS’s rise cannot be understood without reference to Iraqi prime minister Nuri al-Maliki’s utter failure to build a government that crosses sectarian lines. In Sunni areas, Baghdad had come to be seen by many as absent at best, oppressive at worst. Accordingly, the Islamic State benefited from the support of a number of militias whose goals for Iraq differ from its own. But in places where the caliphate’s rule is more secure, it appears to be turning on its allies .

A smart intervention would recognize these dynamics and use them to our advantage. Excising ISIS is preferable to blowing up everyone between Anbar and Diyala who’s holding a black flag. Careful targeting, and perhaps a focus on areas where the Islamic State is fighting with the rest of the Sunni opposition, would be smart. And that needs to be closely followed by an attempt to restore local authority and reduce tensions with Baghdad.

A foolish intervention would ignore the Sunni problem. Our intervention in Libya drifted from a limited effort to keep Gaddafi out of Benghazi to effectively serving as air support for a rebel victory. We don’t want to do the same for an Iraqi army that looks more and more like a Shia militia and an Iranian proxy.

Harassment: One plausible approach to a more limited American intervention would be to focus on interdicting ISIS movements around its territories rather than driving it out of the cities (with a high risk of civilian casualties) or turning it back at the front lines. We’re well-equipped for this. Long-loitering drones can take their time in identifying smaller targets and waiting for the right moment to strike. Our advanced signals intelligence and battle-management systems like the JSTARS can help us spot larger movements and direct attack aircraft to them. ISIS forces look more like a conventional state military than the folks we’ve been fighting for most of the war on terror, and it’s conventional militaries that we’re good at fighting. Of course, they’d quickly become less brazen when the bombs started falling, and we might have fewer easy targets. But they’d be forced to change their habits and move more cautiously, and they’d have more trouble transferring forces between Iraq and Syria. This would make them more vulnerable to forces on the ground.

Needless to say, we’d want to remember that harassing ISIS is a means, not an end, and recognize the risk of being slowly drawn into an indefinite air war. But the mere threat of American airstrikes would force ISIS to change tactics.

End state: The point of intervening is to achieve a resolution. If and when President Obama announces we’ll be acting, he should lay out achievable goals and clear boundaries in order to arrest our nation’s recent tendency to drift into bigger, longer, more expensive wars, wars that develop newer, less attainable goals as they progress. A firm, bold effort to achieve a diplomatic solution among the region’s powers must be the centerpiece of American involvement. It is not clear that such a solution is possible, or that we are capable of facilitating it. We should also be very wary of a defeated ISIS. Surviving fighters, of which there will hopefully be few but probably be many, may make their way home and carry out terrorist attacks. Containing the caliphate, the first step, is thus the only certain step.