On Monday, Iran's supreme leader offered an unusually specific threat to the United States.

Responding to what he described as U.S. meddling in recent protests inside Iran, Ayatollah Ali Khamenei explained that the U.S. "damaged us during these days, they know there will be some sort of retaliation, this man who sits at the head of the White House — although, he seems to be a very unstable man — he must realize that these extreme and psychotic episodes won’t be left without a response."

There are a few moving parts here that demand the attention of President Trump and his national security team.

First off, it's important to recognize that Khamenei truly believes the U.S. has attacked his country. Even by the simple act of Trump's offering Twitter-based support for the protesters, the Iranian hardliners believe he has assaulted the heart and soul of their Islamic republic. Presuming themselves pious heirs to the Battle of Karbala, the hardliners believe they have a moral and theological responsibility to strike back against presumed attacks on their faith — even, and sometimes preferably, if doing so costs them their lives.

The threat also takes on a new significance in the context of Khamenei's ill health. The supreme leader knows he is unlikely to survive for more than two years, so has reason to shape a legacy that consolidates rather than collapses the republic. Again, pushing back against the U.S. is a way to whip up the hardliners and earn their continued fealty.

Still, the broader issue here is that regardless of what Trump has said, the president and the protesters are symbiotic in Khamenei's eyes. That's because both are seen as agents of empowerment for secular modernity over the geriatric theologians. That makes them an existential, increasingly imminent threat to the regime and one that must be deterred and defeated. The simple point is that this gives Khamenei a rationale to roll the dice and take aggressive action against America.

Fortunately, Trump has the opportunity to constrain these Iranian impulses. Taking the exact opposite approach of his predecessor — who responded to a 2011 Iranian plot to blow up a Washington, D.C., restaurant with silence — Trump should warn that any attack on the United States will lead to immediate military retaliation.

If he does so, the hardliners might just stay in their box.