The war in Ukraine is getting more dangerous, in part because it is going better than Ukraine’s supporters could have imagined. President Joe Biden has sought to reconcile two conflicting objectives: avoiding U.S. military intervention while also helping Ukraine and making Moscow pay a high price for aggression.

Yet as Russian President Vladimir Putin grows more desperate, that balance will become harder to strike. Potentially, the worse Russia does, the greater risks the U.S. and its European allies may face.

Putin — and most observers — expected that Russian forces would quickly break Ukrainian resistance. Yet a combination of Russian incompetence and inspired Ukrainian defense has produced a rough stalemate. Moscow holds swaths of Ukrainian territory; its early gains in the south were impressive. There is a danger that it could cut off Ukrainian forces in the east, encircle and besiege Kyiv, or seize Mariupol and Odesa on the southern coast. Russia still has preponderant combat power.

But Western money and arms are enhancing Ukrainian endurance, while Ukrainian forces ambush Russian units and attack their vulnerable supply lines. Moscow’s losses are mounting and Putin now confronts the possibility that the war may destroy his army before it destroys Ukraine.

That would be a remarkable outcome — and one that could, ironically, create sharper dilemmas for the U.S.

Biden’s approach to Ukraine has been straightforward: He has punished Russia while scrupulously refusing to get involved in the fighting. Washington and its allies have hit Moscow with far-reaching, hard-biting sanctions; they have given Ukraine antitank rockets, ammunition and other means of bleeding the invaders.

On Wednesday, Biden said the U.S. will send an additional $800 million in military aid, including cutting-edge explosive drones, and will help the Ukrainians acquire more lethal air-defense systems.

Yet Biden has ruled out a no-fly zone over Ukraine (a step most defense experts believe would be ineffectual, because it would not affect the Russian ground forces and artillery doing most of the damage), let alone more significant forms of direct U.S. military intervention. He halted the transfer of Polish jets to Kyiv for fear of provoking Moscow.

“We will defend every inch of NATO territory,” he tweeted, but “we will not fight a war against Russia in Ukraine,” because that would be “World War III.” Biden’s instincts are reasonable, but there are major perils ahead that could force a rethink of U.S. policy.

As Putin worries what stalemate or defeat might mean for his political survival, he could resort to dramatic, brutal tactics in hopes of breaking Ukraine’s will. Russian doctrine emphasizes an “escalate to de-escalate” strategy of limited nuclear strikes to avoid conventional military defeat. Yet even short of that, Putin has some scary options.

Russia could employ chemical weapons in Ukraine, or it could escalate the conventional bombardment of major cities with appalling humanitarian consequences. The latter is already happening in cities such as Mariupol and Kharkiv, while chemical attacks are reportedly under consideration in Moscow.

Russia could also intensify attacks near the North Atlantic Treaty Organization’s borders with western Ukraine or threaten nearby NATO countries militarily to sever the lifeline keeping Ukraine alive. Putin previewed this tactic when he used cruise missiles to pummel a base near the Polish border formerly used by U.S. troops — and now used by foreign fighters flocking to aid Ukraine.

Any of these options could appeal to a dictator looking to win a fight that, as U.S. Director of National Intelligence Avril Haines has said, he “cannot afford to lose.” And any of them could provoke louder calls for intervention in the West.

The U.S. could conceivably have to reconsider its position even short of deliberate Russian escalation. Suppose a stalemated war drags on for months or years, producing terrible bloodshed within Ukraine and instability and insecurity beyond it. Suppose scared, frustrated Russian forces respond to dogged resistance by murdering civilians.

In the 1990s, Western democracies ultimately intervened in the former Yugoslavia to end a conflict that was having similar consequences. Today, writes recently retired Australian general Mick Ryan, “there may be a requirement for a military intervention” in Ukraine, “if the west doesn’t want a forever war on the doorstep of Europe.”

To be perfectly clear: No sane person wants a U.S. war with Russia. Any clash between the world’s two greatest nuclear powers would carry unprecedented risks. Yet the danger that the Ukraine war may not follow America’s desired script has two implications for U.S. policy.

First, the Biden administration must consider whether there are forms of Russian escalation within Ukraine that might trigger a Western military response. This isn’t a crazy question: If Putin successfully used tactical nuclear escalation in Ukraine to escape conventional defeat, he would send a truly terrible message to would-be aggressors and would-be proliferators around the world. So the U.S. government should be considering whether, and how, it might respond if Putin takes the conflict to an extreme.

Second, Biden should stop signaling that there are no circumstances in which Washington would intervene militarily. If the U.S. makes Putin think that he can act with impunity inside Ukraine, it may encourage the Russian dictator to run just the risks that would push America into a more agonizing debate about whether to get involved.

Biden is correct that a conflict with Moscow would be horrible. But not the least of the paradoxes of this war is that taking U.S. intervention off the table entirely may tempt just the sort of Russian escalation that the president is, quite rightly, hoping to avoid.