Determining which countries are making chemical and biological weapons will be one of the most difficult challenges facing the CIA in the next decade, the agency's director says.

William Webster, who became head of the spy agency in May 1987, said this week that Libya is "developing the largest chemical plant that I know of for chemical warfare."In a speech to the World Affairs Council, Webster said the intelligence community must pay close attention to developments in the Soviet Union, Afghanistan and the Persian Gulf in the 1990s.

He also said morale at the agency was high, rejected the notion that covert activities should be carried out by the military and said congressional review plays an important role in guiding the spy agency.

He stressed his concern about chemical weapons, which he said were used both by Iran and Iraq in their eight-year war that was halted by a cease-fire in August.

"Intelligence support will be vital to the success of U.S. efforts to prevent the use of chemical weapons," he said, noting that President Reagan has called for an international conference to revive a ban on chemical weapons. The United States will try to block the export of chemical weapons and ballistic missile technology, he said.

Webster said chemical weapons, often referred to as the poor man's nuclear arms, are being developed by more than 20 countries. As many as 10 countries are working on production of biological weapons.

These weapons could affect stability in southeast Asia and in the Middle East where the balance of power may be altered by the production of chemical weapons by at least three Arab states: Syria, Libya and Iraq.

Of particular concern to the CIA is the possibility that countries might arm ballistic weapons with chemical warheads, he said.

"Virtually every city in the Middle East is now subject to such an attack if these two types of weapons are combined," he said.

Among the weapons that are being made are mustard gas, nerve agents and some that use industrial chemicals such as cyanide and phosgene.

"Most of these plants look like nothing more than fertilizer plants and are difficult to detect," he said.

"Assessing the proliferation of chemical and biological weapons is one of the most difficult challenges we face in the intelligence community, now and into the next decade. It is also one of our most important tasks for these weapons may well represent one of the most serious threats to world peace in the coming years," he said.

Discussing U.S.-Soviet relations, Webster said Soviet leader Mikhail Gorbachev's reforms present intelligence agents "with a very formidable challenge." The CIA must assess the impact of the reforms.

Regardless of the arms control agreements signed between the United States and the Soviet Union, Webster said, "our relationship is likely to remain adversarial."

The CIA head said he expects the Soviets will adhere to their plan to withdraw troops from Afghanistan by next February, but Moscow will continue to maintain ties to the Kabul regime.

"We believe Afghanistan will remain unstable for a period of time," he said. The Afghan rebels will likely continue fighting among themselves, and 5 million refugees, the majority of whom are in Pakistan, must be resettled.

Although Moslems predominate in Afghanistan, Webster does not believe a fundamentalist regime such as that of Iran's Ayatollah Ruhollah Khomeini will dominate.