MOSCOW, JAN. 4 -- The Soviet Union announced today that it has adopted a new law to curb psychiatric abuses by protecting patients against arbitrary commitment to mental hospitals and providing them with legal recourse against malpractice.

Under new "legal guarantees against possible mistakes . . . in the rendering of psychiatric help to the people," relatives of committed patients are assured the right to appeal in court against doctors' decisions, said the official news agency Tass.

Tass also reported that the main criminal code has been amended to make the "illegal commitment of a patently healthy person to a mental hospital a criminal offense." The amendments specify procedures for committing mental patients who have committed "socially dangerous offenses."

The changes, if enforced, would represent a step toward abolishing practices that have long been condemned by human rights activists and professional psychiatrists in the West. Political dissidents in the Soviet Union frequently have been placed in psychiatric wards in order to stifle their protests.

Despite a Kremlin pardon last year that released an estimated 180 political prisoners from jails and labor camps, human rights activists here contend that a number of prisoners remain under detention in psychiatric clinics.

A prominent Soviet dissident psychiatrist who had charged abuses of mental-health facilities, Anatoly Koryagin, served six years in a labor camp after being convicted of anti-Soviet behavior. He was released last February, stripped of his citizenship and sent abroad.

In 1977, the International Congress of Psychiatrists passed a resolution condemning Soviet psychiatric practices. Six years later, the Soviet Union withdrew from the World Psychiatric Association.

After denying the problem for years, Soviet officials and publications recently have begun to admit that psychiatric treatment here is heavily weighted against the rights of the individual. The youth newspaper, Komsomolskaya Pravda, in November described a 20-year-old factory worker in Leningrad who was committed to a mental hospital against her will for criticizing her boss and working conditions.

"Psychiatry has long been counted among the forbidden subjects," began another article last July in the government newspaper Izvestia, which called for better monitoring of psychiatric treatment.

Tass reported today that the Presidium of the Supreme Soviet, or legislature, adopted a law that provides legal guarantees for mental patients, prescribes admission procedures and defines emergency treatment.

Under the law, mental patients who have committed dangerous offenses should be treated in mental hospitals of the health services, thus clearly defining their care as the responsibility of doctors, rather than policemen.

The law also states that those who appeal commitment decisions, which are made by chief psychiatrists, will be guaranteed legal aid. The state prosecutor is charged with monitoring compliance with the new statute, Tass said.

As with other changes to the Soviet criminal code now under consideration, the impact of these changes will depend on how they are enforced. Human rights activists in the past have cautioned against overly optimistic reactions to legal changes, noting that Soviet law enforcement agencies often ignore the law.

Recent press articles point out that existing procedures for the commitment of psychiatric patients are frequently violated with impunity. "Psychiatrists wince at harsh words, but no matter what philological substitutions you make -- constraint, isolation, temporary restriction -- lack of freedom is still lack of freedom. And every physician has a different understanding of the circumstances that give him the right to employ it," wrote Izvestia in July.

According to Izvestia, a draft law on protection of mental health patients was prepared in 1977 but was withdrawn by public health executives. The newspaper said that this time, the law was opposed mainly by psychiatrists who saw it as meddling in their profession.