House and Senate negotiators, in a clear repudiation of Reagan administration policy, agreed yesterday on a package of economic sanctions against South Africa, including a ban on the importation of South African krugerrand gold coins and a halt to new U.S. bank loans in that violence-wracked country.

The measure, which could go before the House and Senate for final consideration today, initially would have slight if any economic impact on the Pretoria government.

But it would put Congress on record for the first time in opposition to South Africa's official apartheid policy and could lead to stiffer actions in a year if the South African government does not take specified steps to end apartheid.

The legislation represents congressional dissatisfaction with President Reagan's policy of "constructive engagement" with South Africa, which has entailed low-key diplomatic pressure for change while opposing economic measures as more harmful to black workers than to the government.

The agreement came when Senate negotiators approved the krugerrand ban approved in the House version of the bill. In return, House negotiators accepted language that says all sanctions could be waived if the president finds, and Congress agrees, that South Africa has taken one of several particular steps toward ending apartheid.

If South Africa does not make progress toward ending apartheid within the next year, the president would be required to recommend stiffer sanctions for congressional approval, including a ban on new private U.S. investment in South Africa, a denial of most-favored-nation tariff status or a prohibition on coal and/or uranium imports.

Although administration sources have said Reagan is unlikely to veto a sanctions measure along the lines of the House-Senate compromise, official spokesmen continued to stress the president's opposition to economic sanctions and refused to comment on his plans before seeing the final measure.

Senate conservatives, led by Jesse Helms (R-N.C.), similarly refused to rule out the possibility of a filibuster against the conference report, which would delay final consideration until after Congress returns from its August recess.

Several conferees said rising violence in South Africa in the wake of the declaration of a state of emergency there had made it more urgent that sanctions be approved. In addition, U.S. sales of krugerrands have dropped by about 80 percent over the past year, although they are still thought to be running at more than $22 million a month.

Agreement came without a formal vote of the conferees. Under the legislation, the sale of nuclear technology would be banned and computer technology would be curbed. U.S. firms with more than 25 employes in South Africa would be required to abide by the "Sullivan principles" mandating promotions and preferential hiring for blacks.

"We are saying kaddish for the policy of constructive engagement," said Rep. Stephen J. Solarz (D-N.Y.), referring to the Jewish prayer for the dead. The compromise "has the sticks of immediate sanctions in it," he said later, "but it has the carrot of a potential waiver if South Africa is making progress down the line."

The steps that would be considered progress under the measure include an end to forced relocations, negotiations for a new political system with full rights for nonwhites, a settlement of the status of South African-controlled Namibia, freedom for all political prisoners, access to jobs and joint family housing for nonwhites, and an end to "denationalization" practices of segregation.

The measure provides for the minting of new U.S. gold coins in the same sizes as the banned krugerrand, in order "to let Americans vote with their purchases," said Senate Foreign Relations Committee Chairman Richard G. Lugar (R-Ind.).

It also provides $34 million of Agency for International Development funds for scholarships through fiscal 1987 for black South Africans to attend South African colleges and secondary schools.

Sen. Charles McC. Mathias Jr. (R-Md.) said, "The situation has deteriorated" in South Africa since the Senate voted July 11 on its approach. "I think we have to do more than we originally contemplated."

The new state of emergency and the ensuing violence has killed scores of blacks and sent more than 1,250 people to jail since the Senate vote. In addition, France has imposed strong sanctions and the U.N. Security Council voted 13 to 1, with the United States and Britain abstaining, to urge all nations to impose sanctions against the Pretoria government.

Rep. Howard E. Wolpe (D-Mich.), chairman of the subcommittee on Africa and a leading advocate of strong sanctions, said those events left the United States "way behind" in responding.

"Economic sanctions are the only alternative to an absolute bloodbath," he said, because the white minority government will engage in serious negotiations with the black majority population "only at the point when they are convinced they have more to lose than to gain" by preserving apartheid.

The conference was briefly interrupted by an outburst from a spectator, Daki Napata of Baltimore, who has said he will fast on the Capitol steps until Congress acts against apartheid. "I take exception to your talking about gold coins when black people are dying in South Africa," he shouted. Police hustled him from the room.