The United States and North Korea need to talk.

Despite continuing provocations and saber-rattling, the United States must continue to work with allies to strengthen deterrence and ramp up the pressure on North Korea – but it must also push for diplomacy. Negotiations are the only hope for easing tensions.

The United States and North Korea are locked in a dangerous cycle of escalation, but one that’s not new: North Korea tests a nuclear weapon; the United States responds with sanctions and military exercises. Eventually, tensions ease, and diplomacy appears possible, only to be scuttled by another North Korean provocative act. Rinse and repeat.

The newest variable is the reckless rhetoric coming from the Trump administration – such as a threat of “fire and fury” and a claim that North Korea is “begging for war” – which damages alliances and raises the risk of conflict.

While the threat from North Korea is clearly growing, the United States knows how to keep its citizens safe and to ensure peace and stability in the region. For decades, the United States, South Korea, and Japan have deterred North Korea from starting a new war, and contained the North Korean threat.

Deterrence has worked for 64 years, since the end of the Korean war, and can continue to work. Kim Jong-un knows that the only guaranteed way to end his regime is to attack the United States or its allies. North Korea is unlikely to give up its nuclear or missile programs in the foreseeable future because the regime sees them as its survival strategy.

Talk of the need for preventive war with North Korea is irresponsible and dangerous. Any strike against North Korea would guarantee an attack on South Korea that could kill millions, and potentially escalate into a wider war.

The priority for the Trump administration must be shoring up deterrence, which means keeping US alliances with South Korea and Japan as strong as possible.

And yet Trump is doing the opposite. After the test, instead of coordinating with his South Korean counterpart, Trump used Twitter to criticize South Korea for what he called “talk of appeasement”. This critique required the South Korean government to immediately rebuke the United States – its closest ally – at the height of tensions. Kim Jong-un could not have asked for a more helpful response from Washington.

Assuming that the Trump administration can get coordination with South Korea and Japan back on track (which will be difficult), deterrence and containment continue to be the best bet for keeping the peace in north-east Asia. But it clearly won’t rid the world of the danger from North Korea, nor the occasional scares when tensions flare.

The only way to address the North Korean threat is through diplomacy. The United States gives up nothing by talking. Talks should happen regardless of actions by North Korea, while the United States continues to apply sanctions and pressure. North Korea will want lots of topics on the agenda; the United States should insist that the nuclear and missile programs are at the top.

The bigger question is not whether diplomacy should happen – in fact, there may already have been quiet talks in recent months – but rather what should happen when talks start. The immediate goal of diplomacy is to lower tensions, cutting through the chest-thumping public statements by talking face to face. Only after repeated rounds will both sides get a sense of whether there is room for progress. Any progress would probably come in small increments, such as a temporary halt in missile tests, or renewed family reunions and talks with South Korea.

If initial steps proved productive, more consequential topics – such as limits on North Korea missiles and nuclear weapons, inspections, and economic issues – could eventually be considered. But these topics can only be broached if the United States and South Korea, along with Japan, are in complete agreement on the goals. Can the allies, for now, live with a nuclear North Korea? What concessions – military exercises, economic assistance, and sanctions relief – are the United States and its allies willing to consider? What would a peace treaty look like?

If the United States does not know what it wants – and is not on the same page as its allies – an inexperienced Trump administration could easily walk into a very bad deal.

Trump needs to stop threatening war with North Korea and start working seriously with America’s allies to maintain a credible deterrent, to figure out how to get to the negotiating table, and to determine what they want when they get there.

Michael Fuchs is a senior fellow at the Center for American Progress, and most recently was a deputy assistant secretary of state for east Asian and pacific affairs