The legal justification is the story about the border. From an explainer article:
> Part of the reason Trump could impose the tariffs so quickly is because the White House is invoking a sweeping national security law to justify the new levies.
> Until now, the International Emergency Economic Powers Act, IEEPA, had been used mainly to impose emergency sanctions on foreign dictators or suspected terrorist groups.
> But the Trump administration argues that the illicit global fentanyl trade and immigrants at the Mexican border both qualify as "unusual and extraordinary" foreign threats to American national security, justifying Trump's use of emergency powers under IEEPA.