As it has contemplated military action against Iran, the Trump administration has opened the door to virtually every legal authority it might use to justify an attack, from tying Iran to al-Qaeda, to President Trump’s assertion that it would not involve American ground troops and “wouldn’t last very long.”

Democrats and some Republicans have tried repeatedly to pin the administration down, including last week’s unsuccessful attempt to muster 60 Senate votes for an amendment requiring Trump to ask Congress before launching any military engagement.

When asked directly about legal justification, senior administration officials have offered undetailed assurances that any action would “consistent with our Constitution,” as Secretary of State Mike Pompeo said last month, or they deferred to lawyers.

“I’m not a scholar in this area,” Brian Hook, Pompeo’s special representative for Iran, recently told the House Armed Services Committee under persistent questioning.

Concern about the possibility of U.S. military action against Iran has grown since the administration cited new intelligence that Iran or its proxies were planning to attack U.S. troops or American interests in the Middle East. The United States has also blamed Iran for attacks on oil tankers near the Strait of Hormuz. Most recently, Iran shot down a U.S. drone it said — and the U.S. denied — had crossed into its airspace.

Trump and Iranian leaders have traded insults following the U.S. withdrawal from the 2015 Iran nuclear agreement and subsequent reimposition and escalation of sanctions, and Iran’s announcement that it was stepping up its uranium enrichment. Following President Hassan Rouhani’s assertion on Wednesday that Iran could enrich to “any amount we want” in the absence of a nuclear deal, Trump warned him to “be careful with the threats . . . They can come back to bite you like nobody has been bitten before.”

Although Trump canceled a U.S. strike against Iran following the drone shoot-down, the administration has continued to lay the legal groundwork for a strike.

Pompeo, in public and classified testimony, according to lawmakers, has said there are ties between Iran and al-Qaeda. Such a relationship would seem to provide the foundation for military action against Iran under the 2001 congressional Authorization for Use of Military Force (AUMF) against the perpetrators of the al-Qaeda attacks that year.

Such a determination has doubters even within the administration. Defense officials have taken unusual steps in recent weeks to distance themselves from Pompeo’s assertion amid fears that the administration may be driving toward a conflict that most Pentagon officials expect would be long, costly and detrimental to American interests in the region.

In a statement, Cmdr. Rebecca Rebarich, a Pentagon spokeswoman, said the department “does not believe 2001 AUMF can be used against Iran.” That position has been affirmed by the Pentagon’s top lawyer, Paul Ney Jr., according to officials who spoke on the condition of anonymity to address internal deliberations.

While Pentagon officials do not deny that al-Qaeda has had ties to Tehran, those links are generally seen as limited and nonoperational.

Defense officials say they have not put forward such links as a basis for connecting military action against Iran to the 9/11 attacks and the AUMF that resulted from them.

Mick Mulroy, the Pentagon’s top policy official for the Middle East, said in a statement last week that neither he nor Katie Wheelbarger, another senior Pentagon policy official, raised al-Qaeda’s links to Iran — or the AUMF — during a classified congressional briefing on Iran last month, as the New York Times reported.

“The historical and ongoing ties between Iran and the Taliban, not al-Qaeda, were raised at the briefing,” Mulroy said.

Taking up Hook’s suggestion to ask government lawyers about both the 2001 AUMF and a subsequent 2002 congressional resolution authorizing the U.S. invasion of Iraq, Foreign Affairs Committee Chairman Eliot L. Engel (D-N.Y.) wrote last week to Marik String, who became acting State Department legal adviser six weeks ago.

Engel asked for “any and all legal analysis” relating to whether either measure was “applicable to any actions that could be undertaken by the Executive Branch in or against the Islamic Republic of Iran.”

A brief reply from the State Department’s legislative affairs bureau came three days later. “The administration has not, to date, interpreted either AUMF as authorizing military force against Iran,” it said, “except as may be necessary to defend U.S. or partner forces engaged in counterterrorism operations or operations to establish a stable, democratic Iraq.”

Democrats have interpreted that response as leaving the door open to administration assertions that such authorization is justified in the future.

“We’re very concerned the administration hasn’t categorically said Congress hasn’t authorized war with Iran,” a Democratic congressional aide said, speaking on the condition of anonymity to discuss the concerns of lawmakers. “The AUMF has already been stretched.”

Three successive administrations have cited the 2001 AUMF as a basis for fighting an array of militant groups across the Middle East, South and Central Asia, and Africa, as Congress has failed in repeated efforts to pass a new authorization that would apply to military actions that seem far afield from those originally authorized.

Moreover, the legal caveat referring to Iraq, the subject of the 2002 authorization, appears to cast a wide net over interference in U.S. or partner forces’ operations in that country.

The State Department did not respond to questions about the scope of its statement.

The other legal authority available to the president, short of Congress’s approval under its constitutional authority to declare war, is the president’s own constitutional power as commander in chief of the armed forces, in charge of keeping the nation secure. Here, previous presidents and the current Justice Department have laid a broad foundation for action that Congress has done little to constrain.

The only public statement the administration has made interpreting those powers was a May 31, 2018, opinion by the Justice Department’s Office of Legal Counsel on authority for the April 2018 U.S. airstrikes against Syrian chemical weapons facilities.

The strikes were legal, the OLC concluded, because “the President reasonably determined that this operation would further important national interests” and that “the anticipated nature, scope and duration of the operations were sufficiently limited that they did not amount to war in the constitutional sense and therefore did not require prior congressional approval.”

The Justice Department OLC did not respond to requests for comment.

The 2018 opinion, which drew substantially from an Obama-era justification for the 2011 air operations in Libya, put an attack against Iran squarely in the context of decades of U.S. military operations, including Haiti, Bosnia, Kosovo, Libya and many others, conducted without authorization from Congress.

Citing previous definitions of the “national interest,” the Trump OLC opinion cited protection of U.S. people and property, assistance to allies, and the promotion of regional stability — all of which have been mentioned by the administration as U.S. goals regarding Iran.

The second test examined whether U.S. troops would be directly involved in hostilities, noting that the Clinton administration OLC, in judging the Bosnia deployment, concluded that the size and duration of operations, and the deployment of ground troops, were key tests.

In an interview last week with Fox Business host Maria Bartiromo, Trump said that “If something should happen, we’re in a very strong position. It wouldn’t last very long, I can tell you that. It would not last very long.”

“And I’m not talking about boots on the ground, I’m not talking we’re going to send a million soldiers. I’m just saying if something would happen, wouldn’t last very long.”

Correction: An earlier version of this story incorrectly referred to Rep. Eliot L. Engel as the chairman of the House Armed Services Committee. He is chairman of the Foreign Affairs Committee. Also, this story was updated on July 4 to provide additional information.