After almost three decades of discussion, the formation of a multilateral agency to guarantee private investment in the developing world against "non-commercial" risks such as expropriation and war seems virtually assured.

Stemming the sharp decline in the flow of private investment from the industrialized countries abroadin recent years is seen by many governments as an important step toward easing debt service difficulties in heavily indebted countries of the Third World.

Last week, the board of governors of the World Bank, at its annual meeting here with the board of the International Monetary Fund, adopted a resolution to establish a multilateral investment guarantee agency, already known as MIGA, if certain conditions are met.

According to World Bank General Counsel Ibrahi Zhihata, directforeign investment in the third world peaked in 1981 at about $17 billion, slipped to $12 billion in 1982 and to $8 billion in 1983. Last year's level was up slightly over 1983's, he said.

The world's general economic slow-down of the early 1980s and the collapse of commodity prices accounts for much of this decline, but political uncertainties in these countries make many foreign investors reluctant to put down their money, even though the returns tend to be higher than in the developed world.

This trend comes at a time when more and more countries, ranging from China to Sri Lanka, are abandoning old ideology of strict self-reliance in industry and viewing foreign private capital as a positive force. The idea is for MIGA to guarantee investments against four scenarios that go beyond ordinary business failure: government expropriation; inconvertability of funds into foreign currencies for repatriation; breach of contract without effective recourse, and war or civil unrest.

Currently, national agencies such as the United States Overseas Private Investment Corporation provide such guarantees on a bilateral basis. In addition, about 200 bilateral treaties covering investment protection have been concluded, but the coverage is spotty.

MIGA would cover plants and plant loans, but not portfolio investments. Projects would be eligible for guarantees only if the investor's country and host country had joined the agency and contributed capital. Projects would be evaluated individually.

The thinking goes that this would give the host a special interest in sticking to the rules, so that MIGA's funds -- to which the country had contributed -- would not be drained.

For years, the idea of such a fund has been opposed by some developing countries, Mexico and Brazil among them. In general, objectors say it would give an unfair advantage to foreigners over their local competition. There also are complaints that it would work too closely with the bank.

Under the current plan, local investors who use funds brought in from abroad would also be eligible for coverage. The idea here is both to attract capital that has fled overseas in recent years and to defuse charges of discrimination. MIGA will also be an independent agency.

Discussion of the idea began as long ago as 1957. It now has been approved by the bank's executive directors, although with several abstentions. A convention to establish MIGA was approved by the World Bank's board of governors on Friday. However, the agency will not come into being until five developed and 15 developing countries sign up and kick in $360 million.