Every U.S. president faces some of the toughest challenges in the world. And while Donald Trump manufactures a number of these crises for himself, the issue that may define his foreign policy is one that he inherited—and has exacerbated—with irresponsible rhetoric and a cavalier attitude toward nuclear weapons: a nuclear armed North Korea.

Thus far we have had little reason for optimism that the current administration could address this threat peacefully. President Trump has had a dismissive attitude toward diplomacy in general, as shown in his unmitigated hostility to the Iran nuclear deal—an historic nonproliferation agreement achieved under his predecessor. He has provoked the North Korean government in macho tweets and cringeworthy statements. Meanwhile, North Korea has refined its payload and delivery capabilities, bringing the first new nuclear threat to the U.S. mainland since the Cold War.

There were baby steps toward diplomacy during the Pyeongchang Olympics, particularly between the two Koreas, and then this past week representatives of the Republic of Korea announced that President Trump had agreed to meet with Leader Kim.

This development gives us a reason for hope that diplomacy can prevail, even in the Trump era.

But there is a lot that goes into diplomacy that I worry will be overlooked in the excitement over an historic summit meeting. As a veteran of nuclear diplomacy, I want to share some lessons from the negotiations of the Iran nuclear agreement that will be important to keep in mind.

First, achieving a deal with Iran that met all of our core requirements took many years and required the full spectrum of talent of the government’s dedicated public servants. State Department diplomats, top leaders in the Departments of Energy and Treasury, analysts in our intelligence agencies, and scientists at our national laboratories all worked together to make sure negotiators were armed with the detailed information needed to ensure the key to the agreement’s effectiveness—the verification and monitoring provisions—would be sufficient for success.

Today there are fewer such public servants and those who are there face unprecedented challenges. The State Department in particular is hemorrhaging talent. Those with experience in negotiations with Iran and North Korea have been particularly targeted by the White House. Key positions—including an ambassador to South Korea—remain unfilled.

The White House is unable to hide its contempt for experienced public servants. But the base of knowledge of these servants—not just of technical details, but of the political and psychological interests of Kim Jong Un—is the foundation necessary for successful negotiations, no matter how good a deal-maker the president believes himself to be. This isn’t a reality show: The president will need to be prepared with all the facts and understand the history between our nations if he is to make progress toward brokering an agreement with North Korea.

Second, we know that we could not have gotten Iran to the negotiating table without working closely with our allies to present a united front on sanctions and expectations. The situation with North Korea is different, but it will be critically important to be in lockstep with our regional allies, especially South Korea and Japan. The DPRK has many primary and secondary goals for this meeting, one of which is to drive a wedge, weaken and dissolve the alliance between the U.S. and the Republic of Korea. The president must be clear in his own mind that an “America First” mindset for this meeting runs the risk of weakening our alliance and making war more—not less—likely.

Finally, realistic expectations were important for the success of the Iran nuclear agreement, and will be for any future agreement with North Korea. In negotiating with Iran, the six partners made a conscious decision to limit the scope of the JCPOA to the nuclear issue. President Trump has made it clear that he considers that a shortcoming and wants to change the agreement with Iran to also allay our concerns about ballistic missiles and other questions. But the reality is that no agreement would have been possible without setting these limits.

With North Korea, having realistic expectations means understanding that a comprehensive agreement on denuclearization will not be achieved in a single meeting. It is almost unimaginable that the DPRK will give up its nuclear weapons before we are closer to an agreement that addresses some of its demands (a peace treaty, security guarantees, formal recognition); each of those will require long give-and-take negotiations below the leaders’ level.

My level of optimism about this meeting will depend entirely upon the readiness of the president to draw upon the expertise of his advisors, both political appointees and career public servants. In nuclear diplomacy, there is no room for unprepared, impromptu, seat-of-the-pants dealmaking.

If he does his homework, we could hope to see not a permanent solution, but an agreement in principle to continue working toward the goal of a denuclearized and secure Korean Peninsula. We should wish for the president both good luck and patience, because reaching a peaceful outcome will be a protracted and difficult path. But that long and winding road will always be preferable to a short and bloody war.

Thomas Countryman is a career diplomat and served as United States assistant secretary of state for international security and nonproliferation from 2011-2017, and an adviser to Diplomacy Works.