The two black men walked without hestitation through the "whites only" entrance to the Interior Ministry building here. The guard started to halt them, then recognized Andrew Hatcher, who quickly assured the guard that the other man "is with me."

Hatcher's status as an American, a former associate presidential press secretary in the Kennedy administration, and now a public relations expert on contracts with the South African government, provides him with an invisible shield of honorary whiteness against most apartheid regulations on his frequent visits here.

"Traveling with Andy in South Africa is like traveling in a cocoon," a black newsman who accompanied Hatcher to the Transkei independence celebrations said later. "When I went to the Interior Ministry alone, the guard chased me away from that entrance and made me go in the back."

Helping merchandise the independence celebration of the African homeland in October was only one of the tasks Hatcher has undertaken for the South African government, which invited and picked up the first-class travel and lodging tab for more than 100 American and European journalist, low-level political figures and a few retired Latin American junta generals.

Working for New York's Sydney S. Barron & Co., Hatcher has also been trying to build stronger links between South Africa and another Barron client, Taiwan. He gets favorable publicity about South Africa into black-owned newspapers, especially in the districts of black congressmen tough on South Africa. He also said in Transkei that he spends a lot of time countering anti-apartheid church groups, which have been trying to cajole, embarrass and coerce American firms out of investing in South Africa for a decade.

Their campign to get American companies to "disinvest" has traditionally, and easily, been brushed off by U.S. businessmen. It received little support inside South Africa itself. At the beginning of the decade, militant opponents of apartheid would tell visiting American firms should stay, and give blacks more and better-paying jobs.

The $365,000 contract the government has awarded Barron's public relations firm is only one sign that a new climate is taking shape around South Africa's sagging economy.

"I can still get headquarters to put new money in," said the general manager of one of the largest American manufacturers here. "But they have become sensitized to investing in South Africa because of the church campaign. They will hesitate a lot longer now, and if it it is not really solid and a good money spinner, they won't do it."

The change in the black and mixed race community is even more dramatic after the urban unrest and killings of the past seven months. In private, non-white leaders who six years ago called for unrestricted increases in American investment are beginning to call on Americans to go slow in putting news funds here.

Most of them ask not to be quoted on this point South Africa's wide-ranging Terrorism Act makes it a serious crime discourage investment in South Africa, and charges that they had conspired to do so helped net nine black activists jail terms of five to ten years in December.

"You will understand that I may not be to answer such a question fully," the Rev. Manas Buthelezi said when asked if Americans should continue to invest in South Africa. "Politically, the U.S. has played a negative role in SOuth Africa in recent times."

"Americans should invest here now only if they give black South Africans a stake, a partnership," says Zululand Chief Gatsha Buthelezi.

A similarily self-serving but startlingly new autlook was expressed by Lebowa homeland Chief Minister Cedric Phatudi last month when he told a group of Americans that current investment patterns were only "creating new jobs for migrants, new prisons for pass offenders and benefits and home comforts for whites." He appealed for that investment to be shifted to the homelands.

Student activists and other Black Consciousness advocates now take an uncompromising view. "Americans must stop the investment that is feeding the policemen who shoot our children," one said in a representative comment.

Hatcher, not surprisingly differs. He says outsiders, including black Americans like himself, can by being deeply involved.

"I've always been able to outflank the system in getting changes for the better," he said. "America has the experience in civil rights to contribute a great deal in a country where the sharing of political power by blacks is inevitable. Everything is negotiable in this life.

Outside "the cocoon" however, the small American community and those associated with it appear to be just as vulnerable to the sting of apartheid and its security laws as anyone else.

At least four blacks South Africans chosen for State Department study grants in the United States last year were arrested during the unrest and held for lengthy periods without charges being brought against them. A black employee of IRM was arrested in November hours before he and others were due to meet Sen. Dick Clark (D-Iowa).

He was released within three weeks. But Jean Tyacke, an American citizen married to a white South African adviser to trade unions, will have five years to experience a distinctive South African "custom".

She and her husband were served orders in November banning them from addressing public gatherings, giving interviews to reporters, or publishing or disseminating any information or views. Normally, banned persons are also prohibited from speaking to each other, but it is not clear if the government is attempting to apply that restriction to the couple.

"A mixture of lunacy and cruelty," the South Africa business magazine, The Financial Mail, called the bannings. The American Embassy, aware of Mrs. Tyacke's unpublicized American citizenship, said nothing about the case. Mrs. Tyacke herself can say nothing about it, unless she wants to risk jail.