UN Ambassador Nikki Haley said something particularly telling on Tuesday, in a speech on the Iran deal that seemed designed to discredit it. Broadly speaking, under the agreement the United States and other world powers struck with Iran, Tehran agreed to suspend its nuclear program in exchange for sanctions relief; it’s an arrangement President Trump seems anxious to reconsider, and Haley’s speech detailed some of the thinking. “Judging any international agreement begins and ends with the nature of the government that signed it,” she said. “Can it be trusted to abide by its commitments?”

She was, of course, talking about the nature of the Iranian government, but the question of commitment could apply equally well to the administration in which she serves. If, as Obama’s critics argued in the context of the Syrian red-line crisis, American credibility depends in part on its willingness to follow through on military threats, surely it also depends on whether it abides by its diplomatic commitments. And as the Trump administration attempts to find a solution to the growing North Korean nuclear threat while openly hinting it will withdraw from the nuclear deal with Iran—despite independent monitors repeatedly verifying that Iran is holding up its end—it’s this kind of credibility that may determine whether the crisis on the Korean peninsula is resolved peacefully.

The North Koreans will be watching what happens to the Iran deal, and it will be every bit the test of American credibility that Obama’s famous “red line” crisis over Syria was. Obama’s failure to punish the Assad regime’s use of chemical weapons—after having declared their use a “red line” that would entail “enormous consequences” for Syria if crossed—was widely criticized, including in these pages. In his own defense, Obama dismissed the question of credibility in this context as “dropping bombs on someone to prove that you’re willing to drop bombs on someone.” That view does enjoy some support in foreign policy circles, with some positing that theorists and policymakers have fetishized credibility to such an extent that it can pull the United States into wars that aren’t in its national interest.   

Yet credibility does not pertain only to military power. States’ military threats may be taken more seriously when it’s clear that they have followed through on them in the past. The same must be true diplomatically: States can better advance their agenda through diplomatic channels if they have a track record of following through on commitments made through those conduits. Just as a nation needs to show the ability and willingness to use force to present a viable threat to its adversaries, a state that enters international agreements needs to demonstrate the ability and willingness to uphold its end of the bargain. Otherwise there’s no point inviting them to the negotiating table in the first place.

This isn’t to say that credibility is the only thing that matters. After all, diplomatic failures and breaches don’t always translate into the complete collapse of diplomatic efforts or lead into military alternatives. Despite their history of tension, and their respective violations of previous diplomatic settlements, the United States and North Korea may still return to the table once again, as America and Iran did in the past. This is for a very simple reason that can trump even deep mistrust: It’s in countries’ interests to negotiate when the alternatives look much worse, and the costs of even failed negotiations are lower than the potential costs of no negotiations.

Still, Haley is right in her assessment: Countries’ track records matter. Without some level of predictability, all international agreements would fall apart. Moreover, the failure to see diplomatic solutions through can put countries in a worse position than they were in before negotiations started. And in focusing on Tehran’s track record, she fails to consider what her administration’s own actions are telling the world about the United States.

In just a few months, President Trump has started to chip away at a credibility his predecessors, both Republicans and Democrats, built over decades. In the first few weeks, his administration put Iran “on notice” for its work on its missile program (without saying what the notice entailed), before stating that it was pulling the United States out of the Paris Agreement on climate change. The administration has sent mixed signals to a range of countries, including adversaries, such as Iran and North Korea, but also allies, particularly the NATO countries, as well as the most significant economic power in the world, China. Indeed, the president declared NATO “obsolete” before revisiting this a few months later and calling it “no longer obsolete.” And, in one of his major campaign promises on foreign and economic policy, he vowed to label the “grand champion” of currency manipulation, China, as such before reversing himself and declining to do so. This has left friends and foes equally confused and has proven that neither the pledges of “fire and fury,” targeting North Korea, nor international agreements, are to be taken too seriously under this administration.  

If America isn’t viewed as credible in the diplomatic realm, how much incentive do other states have to come to the table and agree to change their behavior?

Today, America is facing a mischievous Iran, whose nuclear program was curtailed by the nuclear deal. This summer, the UN nuclear watchdog verified the country’s compliance with the agreement for the eighth time since its implementation started less than two years ago. The Islamic Republic remains a challenge in a number of arenas, including its human-rights track record, support for terrorist groups, and general regional activities, as Haley correctly noted in her speech. But as America’s allies and negotiating partners—France, Germany, and the United Kingdom, along with China and Russia—have stated repeatedly, the deal is working in its narrow aim of limiting Iran’s nuclear program. Haley said as much when she stated that “the deal was constructed in a way that makes leaving it less attractive.” In other words, while the deal isn’t perfect, alternatives to it are far worse.

What’s more, the agreement has provided an opening for the international community to build on it to explore diplomatic solutions on other security challenges Tehran’s behavior creates. Importantly, as the European Union’s High Representative for Foreign Affairs and Security Policy Federica Mogherini frequently reminds Trump, it is also is a multilateral agreement. That means it’s a commitment not just to Iran, but to the other parties to the agreement, whose interests are also implicated. None of them want to withdraw.

Despite all this, the Trump administration appears hell-bent on rocking the boat. All the while, America is facing down North Korea, a country whose brutal regime has acquired a small, but growing, arsenal of nuclear weapons—something Iran never achieved and that the Iran deal was designed, so far successfully, to prevent. North Korea has now tested two intercontinental ballistic missiles, before detonating what it claims is a thermonuclear weapon. And as Pyongyang’s nuclear capabilities have expanded, America’s foreign-policy toolkit for addressing it has shrunk. As Mark Bowden wrote in a recent issue of The Atlantic, “any effort to crush North Korea flirts not just with heavy losses, but with one of the greatest catastrophes in human history.” A military campaign on the Korean peninsula could cost hundreds of thousands of lives, just in its initial phase, and could very well drag on to become even more devastating.

This makes diplomacy, with both North Korea and China, an indispensable part of any solution. And it means that the best-case scenario for a peaceful resolution is a deal that looks a bit like the Iran deal—meaning a far-from-perfect arrangement involving economic inducements in exchange for a freeze on aspects of Pyongyang’s nuclear development—except that North Korea already has nuclear weapons.

But with regard to Iran, U.S. officials have not only shown a lack of strategy and consistency, but also overt efforts to torpedo the deal and blame Tehran for it. As part of these efforts, some White House officials have stated that they’d be looking to reimpose the sanctions lifted by the nuclear deal under different pretexts, such as Iran’s missile activities, which weren’t covered by the deal. Others, including Haley, have tried to find evidence of what they decry as Iranian noncompliance, despite the UN atomic watchdog, the Joint Commission overseeing the deal’s implementation, and U.S. partners arguing otherwise. Moreover, these international bodies, along with U.S. allies and partners, are joined by senior members President Trump’s own cabinet, including well-known Iran hawks like Defense Secretary James Mattis and National Security Advisor H.R. McMaster.

There have been small bumps on the road: For example, Tehran briefly went above its heavy-water cap. But such bumps are an inherent part of the implementation of any technically complex and politically charged agreement. And the nuclear deal has proven its resilience and effectiveness as all these technical challenges have been addressed thanks to the mechanisms built into the nuclear deal.  

The administration’s efforts to undermine the deal are hurting U.S. credibility. And they will constrain U.S. attempts to rein in North Korea’s nuclear ambitions, as well as future potential cases of nuclear misbehavior—including Iran, should the country return to non-compliance.

The United States shouldn’t make military or diplomatic decisions based solely on what will maintain its credibility. After all, credibility should be a means, not an end in itself. But the United States can’t continue to lead international processes designed to sanction countries and bring them to the table—and thereby avoid using force—without it.