In a move to the right by one of the country's best-known liberals, Sen. Edward M. Kennedy (D-Mass.) has endorsed a tougher approach to deter crimes by defendants released on bail.

Kennedy said in remarks prepared for delivery yesterday to the National Governors Conference meeting on crime control that he thinks Nixon administration era "preventive detention" laws are both unconstitutional and ineffective.

But he also said current bail procedures "pose an unnecessary risk to the safety of the community." He cited a recent study in the District that showed that 15 percent of the persons arrested were out on bail at the times.

Kennedy proposed that judges be allowed to consider whether a defendant poses a risk to the public safety when setting conditions on bail. Currently, most federal and state bail laws let a judge consider only whether a defendant might flee if allowed out on bail.

He said that "in rare cases involving offenders perceived to be especially dangerous, release might be severely restricted by placing the defendant under severe custody restrictions."

Though the speech does not go on to outline the extent of such restrictions, it seems to raise the possibility that a defendant could be held under house arrest or placed in the custody of a law enforcement officer.

While noting that his proposal raises constitutional questions, Kennedy said they were much less substantial than those involved in preventive detention because the estrictions come after release.

Kennedy also proposed that defendants arrested while out on bail be jailed for contempt of court, a power he said judges now rarely use. And such offenders should serve consecutive, rather than concurrent, sentences, Kennedy said.

The American Bar Association has proposed some of the same solutions to the bail problem. Thus their suggestions are considered by some to be middle-of-the-road. But Kennedy's endorsement of the ideas is considered a shift in his thinking on the subject.

As chairman of the Senate Judicial Committee, Kennedy will have a chance to attach his newly espoused notions to the long-awaited reform of the nation's criminal code. He said in the speech that he plans to hear testimony on the bail subject during hearings on the code.

Sen. Birch Bayh (D-Ind.), another liberal member of the Senate Judicial Committee, expressed similar concerns in a speech Thursday to a group of prosecutors.

He noted that the constitutional right of bail would always be important. But he also said, "We must find a constitutionally acceptable and fair method to protect the rights of the community at large - rights that are being assaulted on a daily basis by habitual offenders while on bail."

Bayh called for a "national debate" on the issue and said he would hold hearings of his constitution subcommittee this summer to search for solutions.