Government health officials issued new guidelines yesterday to help curb the spread of AIDS, including a far-reaching recommendation that individuals in high-risk groups have blood tests to see if they may be infected with the virus responsible for acquired immune deficiency syndrome.

The new guidelines also supported "on public health grounds" controversial state and local actions to regulate or close down establishments that "facilitate" high-risk behavior, such as "anonymous" sex, multiple sexual partners or intravenous drug abuse. "Bathhouses, houses of prostitution, or 'shooting galleries' " were included in this category.

The testing recommendation is the strongest statement to date by the Public Health Service that the test for AIDS antibodies that was approved last year for use in screening the nation's blood supply may also have major public health value in preventing the spread of the disease.

"We have great confidence in this test," said Dr. Donald R. Hopkins, deputy director of the Centers for Disease Control.

He said there is "reliable evidence" that most persons who repeatedly test positively on the blood test may carry the AIDS virus and potentially be infectious to others with whom they have sexual or other intimate contact, even though they have no signs of disease.

"Our objective is to encourage testing of persons in high-risk groups," he said, and to counsel them to take steps to reduce transmission of the AIDS virus.

The recommendation potentially could affect millions of people in this country and perhaps as many as 20 million, Hopkins estimated. The largest groups considered at increased risk of infection with the AIDS-causing virus are homosexual and bisexual men, as well as past or present intravenous drug abusers.

Also considered at high risk are persons born in countries where heterosexual tranmission is thought to play a major role in the disease, such as Haiti and central African nations, male or female prostitutes, sex partners of infected persons or of high-risk individuals, hemophiliacs, and the newborn children of infected mothers.

As of March 10, 18,070 cases of AIDS had been reported in the United States, including 9,591 deaths. But estimates suggest that possibly a million or more apparently healthy individuals also may be infected with the virus.

Positive results on the AIDS antibody blood test, as well as confirmatory tests, suggest only that a person has been infected, but do not predict who subsequently will come down with AIDS. Studies suggest that anywhere from 6 percent to40 percent of those infected may later get AIDS.

The new guidelines said that the blood test and counseling services should be "routinely offered to all persons at increased risk" when they come to health care facilities.

Government officials believe that the information obtained from such test results could reduce the spread of the disease by influencing behavior. Those found to be positive would be urged to take numerous precautions, including avoiding sexual activity or informing prospective partners and protecting them from contact with bodily fluids, while those who test negative could act to protect themselves.

The guidelines urged "careful attention" to maintaining confidentiality of records and said anonymous testing should be considered.

Critics expressed concerns about widespread testing, particularly its civil liberties implications.

Gary MacDonald of the AIDS Action Council, which represents 110 local AIDS assistance groups, said that he still would "counsel not to get the test unless a person feels the result is essential . . . . You don't need to be tested to change your behavior."

Jeffrey Levi of the National Gay Task Force said that all individuals in high-risk groups "should be following risk-reduction guidelines . . . . There doesn't need to be mass testing."