As with other foreign policy issues, the Trump administration’s approach to Iran has been full of mixed messages. Yet amid the confusion, there has been an ominous tendency to demonize Iran and misrepresent the threat it presents. This could lead to an unnecessary and risky confrontation.

The administration’s various and conflicting responses to the 2015 Iran nuclear deal are a case in point. The deal, one of the Obama administration’s major triumphs, requires Iran to curb its nuclear activities in return for a lifting of economic sanctions. During the campaign, President Trump called it “one of the worst deals I’ve ever seen” and promised to tear it up or renegotiate it if he won the election. Last week, however, a letter from Secretary of State Rex Tillerson to the House speaker, Paul Ryan, signaled Mr. Trump’s intention to stick to the deal.

The letter certified that Iran was complying with the agreement, negotiated by five world powers in addition to the United States and Iran. The International Atomic Energy Agency, which monitors the agreement with on-site inspectors and advanced technology, reached the same conclusion in its most recent report.

However, in the letter, Mr. Tillerson also stressed that “Iran remains a leading state sponsor of terror” and said the administration was reviewing whether suspending sanctions continues to advance American interests. Further jumbling the administration’s views, Mr. Tillerson told reporters on Wednesday that the deal “fails to achieve the objective of a non-nuclear Iran” and “only delays their goal of becoming a nuclear state.” On Thursday, Mr. Trump accused Iran of not fulfilling “the spirit” of the deal. Yet on Friday, Defense Secretary Jim Mattis insisted during a visit to Israel that the deal “stills stands” and that Iran “appears to be living up to their part.” That same day, Mr Trump told The Associated Press that “it’s possible that we won’t” stay in the nuclear deal, The A.P. reported on Sunday.