A majority of the justices seemed ready to side with a fired air marshal on Tuesday in over whether he was covered by a federal law protecting whistle-blowers.

In 2003, the air marshal, Robert J. MacLean, received a secret briefing about a terrorist threat affecting long-distance flights. Two days later, he was told by text message from the Transportation Security Administration that to save money, the agency was canceling assignments requiring an overnight stay.

He complained to his superiors, saying the move would imperil public safety. When they failed to act, he contacted a reporter for MSNBC. The resulting news coverage promptly led to a reversal of the travel policy.

When the government later identified Mr. MacLean as the source of the report, it fired him for disclosing sensitive information without authorization. Mr. MacLean challenged his dismissal under the Whistleblower Protection Act, which insulates federal workers from retaliation if they disclose “a substantial and specific danger to public health or safety.”

The whistle-blower law has an exception for disclosures “specifically prohibited by law.” The main question for the justices was whether a Department of Homeland Security regulation was the sort of exception that Congress was referring to in the whistle-blower law.

Ian H. Gershengorn, a deputy solicitor general, received hostile questions from most of the justices. Justice Antonin Scalia, for instance, was unconvinced by Mr. Gershengorn’s attempt to argue that the word “law” in isolation encompassed some but not all regulations.

“Boy, that is subtle,” Justice Scalia said.

Some justices wondered how transportation workers could tell what information was too sensitive to be disclosed. Chief Justice John G. Roberts Jr. noted that the government’s own brief had conceded that Mr. MacLean had been free to tell reporters “that federal air marshals will be absent from important flights” but also decline “to specify which flights.”

In what appeared to be an important concession, Mr. Gershengorn acknowledged that the president remained free to forbid the dissemination of sensitive information no matter how the court ruled.

Justice Stephen G. Breyer said this assuaged a concern of his. “I am worried about the decision of the court against you leading to somebody blowing up an airplane,” he told Mr. Gershengorn. “And I suddenly thought, as a practical matter, that is not a serious worry because the president can always use” his authority “to keep people from disclosing the information that you don’t want disclosed.”

Justice Scalia said that leaving things to the president was also the better practice. “It would make sure,” he said, “that the matter is important enough to occupy the president’s attention and is not so insignificant that an agency that just doesn’t want any whistle-blower, doesn’t want any criticism of what it’s doing, can pump out these regulations.”

Neal K. Katyal, a lawyer for Mr. MacLean, said his client was precisely the sort of worker the whistle-blower law was meant to protect. Mr. MacLean had acted quickly and responsibly, Mr. Katyal said, “in order to save something that otherwise would have been detrimental to national security.”

Justice Scalia added, “And he was successful.”

Justice Sonia Sotomayor told Mr. Katyal that the case, Department of Homeland Security v. MacLean, seemed to involve a compelling example of a valuable disclosure. “The facts are very much in your favor,” she said.

In one of the few questions skeptical of Mr. MacLean’s position, Justice Samuel A. Alito Jr. wondered whether he would be protected by the whistle-blower law for disclosing information to a “a reporter working for a foreign state-controlled news agency.” Justice Scalia said that would not qualify as whistle-blowing. “Don’t you think it’s implicit in that he’s disclosing it to somebody who could remedy the problem as opposed to an enemy?” he asked.

Mr. Katyal suggested that the real issue was how hard it was to gain protection under the whistle-blower law. “The problem is not too many whistle-blowers,” he said. “It’s too few.”