The tax-free Pyrenean principality of Andorra could be about to pay a price for the boom that took it from mules to fast cars in 40 years.

The 8,000 Andorrans, outnumbered five to one by foreign residents, are coming under pressure to grant wider citizenship rights and loosen a protective corset of medieval institutions and puritanical laws.And concern is growing in the valley's 4,000 shops that European Community liberalization in 1992 will hurt their wealthy shoppers'-paradise economy.

The 190-square mile principality, nestling high on the border between France and Spain, owes its survival to a 700-year-old power-sharing pact between two co-princes - the current ruler of France and the Bishop of the Spanish town of Seo de Urgel.

The agreement has protected Andorra from takeover and spared it centuries of European wars and turmoil.

But in the past 40 years what was a sleepy cheese-making community has changed dramatically. Its tax-free status and a tourism boom have attracted a stream of shoppers, eager to stock up cheaply on cigarettes, whisky, clothing and electronic goods.

Andorrans, who switch effortlessly from the official Catalan language to French and Spanish, became skilled traders overnight. Shops and hotels mushroomed. Fast cars choked narrow streets and satellite television dishes sprouted on farms.

"Like Arab emirates went from camels to Cadillacs, Andorra shot from mules to BMWs," said Louis Deble, the representative of French President and Co-prince Francois Mitterrand.

Ten million visitors descended on the principality's long shopping street last year, taking the Andorrans' annual per capita income to $12,000.

But the boom is leveling off as Spain's entry into the EC brings prices down over the border. It could end when the EC drops its internal trade barriers in 1992.

The EC, unhappy with this tax-free enclave, has asked France and Spain to review their trade accords with Andorra and is to start negotiating soon with the principality.