Lech Walesa, the leader of Poland's independent trade union organization Solidarity, tonight urged workers not to pursue a policy of confrontation with the government on the emotional issue of the power of the security apparatus.

Walesa's counsel of moderation came after the government in a dramatic 11th-hour compromise, averted the immediate threat of a general strike in the Warsaw region by agreeing to the provisional release of two workers charged with leaking and publicizing secret documents.

But there were signs of opposition to Walesa's appeal from members of Solidarity's militant Warsaw branch, who were not satisfied by the authorities conciliatory gesture. At a meeting of the branch's presidium tonight, many speakers argued in favor of strike action unless the government formally agrees to negotiations aimed at restricting the power of the security service and releasing four more political detainees.

Talks with Deputy Prime Minister Mieczyslaw Jagielski ended inconclusively earlier in the day when the government refused to agree to an agenda for the future meetings. Jagielski agreed to more talks in early December following an important meeting of the Communist Party's policy-making Central Committee, but declined formal negotiations on the independent trade union organization's demands.

Despite the organization's decision to call off the strike planned for today, up to 2,000 enterprises in the Warsaw region are remaining on strike alert. With the release of the two workers, one a Solidarity activist, the union organization has switched its attention to the establishment of a government commission to investigate its more general grievances against the security apparatus.

Workers at the Warsaw steelworks, one of the major plants in the region, had said they would remain on strike until the commission is appointed, but returned to work after meeting with Walesa.

Walesa flew here from union headquarters in Gdansk and went to the steel plant in an attempt to settle the dispute. In a meeting lasting several hours he warned workers of possible disaster if they pushed the government too far.

In an emotional address, he warned workers bluntly that the authorities still possessed tremendous power: "There is a danger that they might reply to confrontation with tanks and rockets, and then we wouldn't be able to defend ourselves. These gentlemen can still destroy us. Let us stick to what we have already achieved for the time being. Otherwise we might lose everything."

Walesa, who led Poland's strike wave in August, was given a cordial reception, but a majority of speakers opposed his moderate policies. One worker called for full independence for both the judiciary and the public prosecutor's office. "What will our children's life be like in 20 years time if we back down at this point in our history? We won't be able to look them in the eyes. We should strike until full agreement is reached on our demands."

The branch also has called for a reduction in the budget of the security services and for the publication of a never-released official report about the suppression of workers' riots along the Baltic Coast in December 1970 during which at least 50 people were killed.

Perhaps the most dangerous aspect to the current crisis is that it may have raised doubts in the minds of Poland's Soviet Bloc allies about the ability of the Polish Communist Party to control events.

Czechoslovak Foreign Minister Bohuslaw Chnoupek flew to Warsaw today for talks. He is expected to express Prague's concern at the concessions already granted to Solidarity. In addition, a meeting has been announced between the prime ministers of Czechoslovakia and East Germany in the near future at which the coordination of policy on Poland is sure to be high on the agenda.

In an editorial today, the Czechoslovak Communist Party newspaper compared the present situation in Poland with the "Prague Spring" of 1968, which culminated in Soviet intervention.

Among Solidarity's advisers, there is a general awareness that the Communist Party's authority must seem to remain intact in order to avoid a repetition of the Czechoslovak experience in Poland. When the Warsaw branch called the strike planned for today, Solidarity's national committee endorsed the strike in order to preserve unity, but some delegates are understood to have criticized the Warsaw branch for lack of consultation.

The government's release of Jan Narozniak, the young Solidarity volunteer, in the early hours of today had all the drama of a political thriller. Freed with him was Piotr Sapielo, who is alleged to have been the "mole" in the prosecutor-general's office who leaked a top secret document outlining measures to be taken against dissident elements. Half asleep, the two men were bundled out of prison in the middle of the night and driven to the Rusus tractor plant outside Warsaw where workers had vowed to remain on strike until their release.

Both men, who deny the charges against them, are still under police investigation. They were freed as part of a compromise that included posting of bond for them by Stefan Bratkowski, the newly-elected reformist president of Poland's journalists' association.