The Carter administration yesterday proposed legislation to protect reporters and other writers from surprise searches by federal and state law enforcement authorities.

The announcement was the administration's response to a recent Supreme Court decision upholding a 1971 police search of the Stanford University student newspaper office.

The Justice Department supported the police in that case. But yesterday the White House said the president "has concluded that the decision poses a serious threat to the ability of the press to gather information and to protect confidential sources."

Attorney General Griffin B. Bell and Philip B. Heymann, a top assistant, said the proposal would prohibit searches for the "work product"-notes, photographs, tapes-of journalists and scholars with narrow exceptions.

Searches would be allowed if a person's life was in danger or if the reporter was a suspect in a crime. The proposal also calls for a "subpoena first" rule when authorities are seeking other material-evidence such as an extortion note-again with few exceptions.

Unlike surprise searches conducted with a warrant, subpoenas can be challenged in court by the person holding the material authorities are seeking.

Interested parties from several news organizations, the American Civil Liberties Union, and several members of Congress, issued statements praising the proposal. But some said the administration effort did not go far enough.

Sen. Birch Bayh (D-Ind.), whose Senate Judiciary subcommittee has held hearings on the issue, said these protections are needed by others who hold confidential information, such as doctors and lawyers.

Heymann, head of the Justice Department's criminal division, said extending the protections to "third parties" raises difficult constitutional questions and might create sanctuaries where crminals could hide evidence by giving it to friends or relatives.

State and local prosecutors are expected to be opponents to the proposal, which has not yet been drafted as bill, because it would apply to them as well as federal authorities. Bell said it was important to apply the principle "across the board so everybody gets the same treatment."

Heymann is scheduled to testify next week before Bay's subcommittee and the timing of yesterday's announcement was viewed by some as a way "to win some political points," and publicity for a Carter initiative.

Bell told reporters that he believed the proposal was important because "it enhances the First Amendment right of freedom of the press and the public's right to know." He added he was not making the statement to be "pandering to the press."

The Sanford Daily decision has produced an outcry from news organizations that fear the possibility that such searches might scare off confidential sources. In the Stanford case, police rummaged through papers in an unsuccessful search for photographs taken during a demonstration inside the university hospital.

Bell said that the federal government has never authorized a surprise seach of a newspaper office. The administration proposal would have precluded all but two or three of a dozen state searches of news organization offices conducted since 1970, Heymann said.

The bill also will be designed to protect whistleblowers who intend to make their information public. Heymann said. But, he added, the plan would not bar prosecution of a reporter who possessed unathorized national defense secrets, such as occurred in the Pentagon Apers case.

There has never been such a prosecution. When asked about the possibility of such an action Heymann said, "realistically we're talking about a tiny dot on a mile-long line."

Civil damages could be sought for violations of the proposed law. But Bell said, "I doubt it'll ever be used. It's protection. . . Everybody will say 'We'd better not do that [seek a search warrant]."