President Anwar Sadat's ruling party is preparing a bitterly disputed "Law of Shame" that would set up special "value tribunals" with sweeping powers to punish anti-government agitation or violations of Egypt's Islamic tradition.

The draft proposal prompted a warning from the head of the Egyptian Lawyers' Syndicate, Mustapha Marei, that the Nasser era of "concentration camps" could return to Egypt despite Sadat's often repeated promise to govern Egypt according to the rule of law.

Although it could be modified before passage by parliament, the tough legislation reflects Sadat's determination to prevent opposition to his policies of peace with Israel and pro-Western orientation from growing into an open problem for his government. It also appears to be, at least in part, a response to Islamic fundamentalism here, which is limited but shows increasing signs of nervousness over Sadat's turn to the West, particularly toward the United States.

Neither the rightist Islamic groups nor the anti-Israeli left in Egypt has enough support now to mount a serious challenge to Sadat Egyptian and foreign observers believe. The president enjoys enormous personal prestige and his National Democratic Party commands such as overwhelming majority in the 390-seat parliament that the opposition rarely musters more than 50 votes.

Sadat's resolve to pass the "Law of Shame" -- he has been talking about it for months -- thus was interpreted by most Egyptians as a demonstration of his desire to present his Arab foes with an Egypt entirely united behind his decision to make peace with Israel. At the same time, Egyptian analysts said today, basing the proposal on Egypt's Islamic values make it difficult for the United States or any other Western nation to accuse Sadat of abandoning democratic standards such as free speech and right of dissent.

Egyptian intellectuals said a particular target of Sadat is a group of Egyptian journalists living abroad and working for foreign publications who attack the Egyptian leader regularly as a traitor to the Arab cause and Egypt's Arab ties.

The president seemed to be referring to these opposition writers abroad when he told a group of broadcast and press executives who asked him about the law: "The Law of Shame is not for everybody. It is for a few people, those who are working against Egypt abroad and those few agitators within who are attacking Egypt's values and sowing envy and discord."

What troubled the Lawyers' Syndicate and other intellectuals most was the loose language of the draft legislation, which seems to leave broad scope to a "socialist public prosecutor" who would bring offenders before "value tribunals" operating parallel to the regular judicial system.

Among those punishable, according to a draft prepared by a committee of Sadat's National Democratic Party and published in the Cairo press, is any Egyptian who:

Advocates doctrines "that imply a negation of divine teachings or that do not conform to the tenets thereof."

Advocates "opposition to, hatred of, or contempt for the state's political, social or economic system, calling for the domination by any one social class over others or for the liquidation of a social class."

Allows young people "to go stray by advocating the repudiation of popular religious, moral of national values or by setting a bad example in public places."

Broadcasts or publishes "false or misleading news or information that could inflame public opinion, generate envy and hatred or threaten national unity or social peace."

Broadcasts or publishes abroad "false or misleading news or information that could disparage the state's political system or its economic position or affect its relations with other states."

Penalties could include house arrest up to five years, confiscation of property, ban on foreign travel and prohibition of membership in political parties or private organizations or unions. For treason committed by the president or Cabinet ministers, the law calls for execution or prison.

Sensing the outrage generated by publication of the draft, Vice President Hosni Mubarak said last week that the proposal was far from final and represented only the suggestions of National Democratic Pary members. According to the constitution, any such proposal must be reviewed by government lawyers before presentation to parliament.