WASHINGTON (AP) _ The Drug Enforcement Administration says ''cautious optimism'' is appropriate in the war against cocaine as traffickers face shortages nationwide, sometimes even asking undercover agents to supply the drug.

Cocaine prices are high, purity is down and trafficking organizations seem to be in such disarray that coca growers in South America can't get enough for their crops to make a living, Ron Caffrey, the DEA's deputy assistant administrator for operations, said Tuesday.

However, Caffrey added to the Senate Judiciary Committee: ''We have not deluded ourselves into thinking that the cocaine threat has subsided. ... This could well be a temporary situation.''

Committee Chairman Sen. Joseph R. Biden Jr., who shared with Caffrey the belief that the news was worthy of ''cautious optimism,'' also stressed the need to remain vigilant.

''In my view, we are entering the most critical phase of the war on drugs, a phase in which some policymakers may suggest that we declare victory and go home,'' Biden, D-Del., said. ''That would be a tragic mistake in my opinion.''

Caffrey reported some victories in the war on drugs.

Cocaine prices have reached their highest level since mid-1985, he said, even though they remain far below the $55,000-$65,000 price per kilogram (2.2 pounds) of 1982. In addition, purity levels have dropped. The combination of high price and low purity generally indicates a shortage.

Outside the hearing room, Caffrey said, ''There's plenty of that (cocaine) down in the source nations such as Colombia, but it's not getting here for whatever reasons - stockpiling, the seizures that have been made.''

Law enforcement efforts here and abroad have disrupted the major cocaine cartels. The havoc wreaked on those organizations has left many coca growers in Peru and Bolivia without buyers willing to pay the $30 per 100 pounds of leaf that is their break-even point, Caffrey said.

Dramatic increases in wholesale prices were found in Los Angeles, New York City and Houston. In the Texas city, the price rose from a range of $11,000 to $21,000 per kilo last December to $20,000 to $30,000 in June.

Increases were less notable in Chicago - where the low price remained $19,000 and the high price increased from $25,000 to $32,000 - and Miami, where the price only inched up from $16,000 to $22,000 in December to $17,500 to $23,000 in June, Caffrey said.

Meanwhile, the purity of kilos decreased from 90 percent two years ago to 74 percent in June, and the purity of street-buy grams dropped from 70 percent in 1988 to 55 percent last month, the DEA reported.

An unreleased survey of all 19 domestic DEA field offices found the trend toward increased prices and decreased purity was ''almost nationwide,'' Caffrey said outside the hearing room.

''Florida is a little bit different in the sense that, yeah, prices have gone up since last year at this time, but I would say that it is still fairly stable,'' Caffrey said. That, he said, ''would indicate to us that at least in Florida, there is a fair amount of wholesale cocaine available.''

The DEA had been unwilling to say there was a shortage or any nationwide trend until Tuesday, even though some of the numbers were reported publicly last month and national drug policy director William J. Bennett hailed them as indicative of a shortage.

Caffrey said the DEA had been unwilling to say more in June because it had only ''anecdotal reporting.'' On checking further with the field offices, he said, the agency found some drug traffickers were so in need of cocaine that they were asking undercover agents to provide the drug.

''Normally, when we do our undercover work, we go out and we buy drugs at certain prices that are quoted to us,'' Caffrey said. ''When the market starts to dry up a little bit, suddenly people are asking us to sell them drugs, and then sting operations occur.''