Attorneys from four of the nation's most prestigious law firms are preparing a defense for the American hostages if Tehran decides to put some of them on trial for crimes against Iran.

The law firms were recruited about a month ago by the Lawyers Committee for Civil Rights Under Law, which is co-chaired by John B. Jones Jr., a partner in Washington's Covington & Burling, and Norm Redlich, dean of New York University Law School.

"The Lawyers Committee has been doing background legal research and contingency planning in the event the hostages are tried," Jones said yesterday. "Our researches to date confirm the position of the U.S. government that there is no basis under any law for the trial of any of the hostages."

In addition to Covington & Burling, the law firms are Hogan & Hartson, in Washington and, in New York City, Cravath, Swaine & Moore, and Paul, Weiss, Rifkind, Wharton & Garrison.

The law firms' involvement assures the hostages -- if they are tried and are allowed counsel -- of free representation by skilled American lawyers. At the same time, the U.S. government would be able to preserve its steadfast refusal to acquiesce in the idea that there is any basis in law for a trial.

It could not be learned whether the Carter administration originated the idea for the project even though there has been quiet cooperation between high-ranking officials and the committee from the start.

White House counsel Lloyd N. Cutler, a former co-chairman of the committee, said that he and legal advisers at the State and Justice departments "have had discussions with the Lawyers Committee." He declined to comment further.

State Department press officer Hodding Carter told a news briefing yesterday that neither the department nor Secretary Cyrus R. Vance had "approached anyone" to prepare a defense for the hostages. State's position is that trials would be "illegal and unacceptable," Carter said.

Privately, department officials said that they are providing the committee with such unclassified materials as it may request, and that they considered preparation of a defense case by non-government lawyers a good idea.

Justice Department spokesman Robert J. Havel, after talking with Attorney General Benjamin R. Civiletti and the department's Office of Legal Counsel, termed the committee effort "purely private," adding, "We haven't done anything to discourage it."

The position of President Carter, Vance and Civiletti "is that any trial by the captors will be a gross violation of international law, and we haven't devoted any time to really dealing with who might provide counsel," Havel said.

The committee co-chairmen declined to provide details about the project. "Any further comment by the committee would not be in the best interests of the hostages," said Jones.

CBS reported Fred Graham said Tuesday night that, of nine of the hostages' families who had been reached, none had heard of the project.

At the law firms, spokesmen fended off questions, although it was learned that the number of lawyers assigned at Hogan & Hartson is "several" and at Covington & Burling "more than one."

Because of conflicting and confusing reports from Iran, it is uncertain whether any of the hostages actually will be tried -- on "spying" or other charges; whether a trial (or trials) would be held by Iran's revolutionary court system; whether the accused, if allowed counsel, would be represented only by Islamic counsel; whether the hostages would appear before some sort of international body, or, finally, whether volunteer American lawyers would be allowed to go to Iran to advise the hostages, if only about the legitimacy of a proceeding.

At the American Embassy in Tehran, the student militants who have been holding the Americans captive since Nov. 4 have spoken repeatedly of trying them as spies. But Iranian foreign minister Sadegh Ghotbzadeh has raised the possibility of an international "grand jury" to investigate American ties to the regime of the deposed shah, Mohammad Reza Pahalvi.

On Nov. 18, Ayatollah Ruhollah Khomeini warned that many of the hostages might be tried for espionage if the shah were not returned by the United States to Iran.

Four days later, however, the captors at the embassy said that hostages will be tried regardless of the fate of the shah.

On Dec. 3, the students said the trials would be conducted by "competent Islamic judges," even though Ghotbzadeh had said that the accused would be judged personally by the captors.

In mid-December, after the shah left the United States for Panama, the students said again that, because he hadn't been returned to Iran, the hostages would be tried "as soon as possible." Khomeini's son Ahmad said that the "spies" will stand trial.

Islamic tradition protects diplomats and foreign envoys. Moreover, according to the Congressional Research Service, it does not include "spying" or "espionage" among the crimes for which there are specific punishments. The CRS adds:

"A contemporary Islamic court might apply 12th century precedents (the period when Islamic criminal law stopped evolving) to declare that 'spies' were similar to captives taken in war who were tried for criminal acts. '

"It is more likely that a secular court, perhaps calling itself an Islamic court, would try 'spies' on an ad hoc basis, as accessories to other criminal acts . . . ."