Invoking national security as a rationale for restricting trade can be a tricky business. In general, there are two ways to get it wrong: You can invoke national security when it does not really apply. Or you can remove economic strictures on countries or corporations that actually do threaten U.S. security.

We’ve seen both recently from President Donald Trump. His threat to impose tariffs on steel and aluminum from allies such as Canada and Japan spuriously invoked national security as a pretext. More recently, he overlooked genuine national security concerns with his sudden announcement that he’s reconsidering newly imposed sanctions on ZTE, the partially state-owned Chinese telecommunications company guilty of a systematic, yearslong effort to sell its services and equipment to Iran, using U.S.-made inputs, and to North Korea.

The president’s about-face came in the form of an improvised tweet just a month after the Commerce Department barred U.S. firms from selling components to ZTE for seven years, tantamount to a death sentence for this pillar of Chinese state capitalism. Given the Commerce Department security bureau’s findings, based on an extensive U.S. investigation going back to the Obama administration, the punishment fit the crime; indeed, the Trump administration had let ZTE off with a fine and probation in March 2017, only to discover that it continued to lie and cover up its lack of compliance. The company is, a top Commerce official found, “incapable of being, or unwilling to be, a reliable and trustworthy recipient of U.S.-origin goods, software, and technology.”

Trump, however, said he was moved by the loss of jobs at ZTE plants in China and ordered his secretary of commerce, Wilbur Ross, to come up with an alternative, undoubtedly lighter, punishment for the firm. China reciprocated by relaxing its previous opposition to U.S.-based Qualcomm’s proposed acquisition of semiconductor maker NXP, and by offering to lift its threat of tariffs on U.S. agricultural goods (which were provoked by Trump’s tariff threats against China to begin with).

This seems rather paltry compensation for a huge U.S. concession, which Trump made before his trade talks with President Xi Jinping’s government pick up steam. Maybe it was motivated by a higher diplomatic purpose: Trump’s need to keep Beijing mollified in the run-up to his summit meeting with Beijing ally Kim Jong Un of North Korea — but that’s not what the president said. “This is also reflective of the larger trade deal we are negotiating with China and my personal relationship with President Xi,” he tweeted Monday. That contradicted Ross’ statement, just three hours earlier, that the U.S. “position has been that the ZTE ban is an enforcement action separate from trade.”

This confusion has to end, and not only because it’s sowing uncertainty for business. If the words “national security” mean anything, they define a policy concern that takes precedence over everything else, even jobs or farm exports. U.S. efforts to secure trade objectives or security objectives suffer when policymakers invoke, or disavow, national security goals in an unprincipled or inconsistent manner, cherry-picking provisions of U.S. law to suit their agenda of the moment.