AS a group of Chinese was leaving the apartment of a foreign journalist, one young man had an afterthought. ``Is your apartment bugged?'' he asked as he glanced at the ceiling.
But the concern about the risks of meeting with foreigners, especially Western journalists and diplomats, was real.
A few hours of sharing a meal and talking freely in a foreigner's home, inside one of the well-guarded residential compounds for diplomats and journalists, presents risks that many Chinese prefer not to take under present circumstances.
Since the first of the year, Chinese sources say, the Ministry of State Security has tightened its surveillance of foreigners, especially journalists. The ministry is a four-year-old agency charged, among other things, with countering internal espionage by foreign agents. It is aided in its work by the massive Ministry of Public Security, whose job it is to maintain domestic law and order.
One source says the stricter policy was decided before student protests last year, but it has coincided with official criticism of Western reporting of those protests. It has also coincided with a propaganda drive to counter the influence of foreign ideas deemed threatening to the Communist Party's leadership and has appeared to stir up an underlying suspicion of foreigners, which has a long history in China.
In recent months, a number of Western and Japanese journalists have reported being followed, sometimes in ways that have appeared deliberately obvious. Many foreigners believe that telephone monitoring has been increased and that mail is being opened more often than before.
Last week, a wire service reporter was followed home by a man on a motorcycle who pulled up close to the car and loudly read the journalist's license plate number into a radio inside his jacket. Other journalists suspect, though they have no proof, that security agents have entered their offices and tried to interfere in their work by removing an address book or tampering with a computer.
One reporter quickly canceled a large party for Chinese friends when she discovered two carloads of what she believed were plainclothes security men parked outside her building.
Security officials have also visited the work units of acquaintances of Western journalists to inquire about the identity of these Chinese individuals and the nature of their work.
In one instance, the officials passed along the message that the individual involved should use more discretion in whom he meets.
The enforcement of new security regulations appears to vary among work units. One news organization posted a notice requiring staff members to obtain permission before meeting with foreigners and requiring another person to accompany them.
According to Asiaweek, a Hong Kong newsmagazine, the party has issued a general directive to its members asking them not to meet with foreign or Hong Kong reporters without authorization.
One reason for this heightened vigilance, says a Chinese source, was the hapless adventure last year of John Burns, the New York Times correspondent in Peking.
Mr. Burns was detained while traveling through rural areas in Shaanxi Province, having stumbled onto a restricted military zone. Although he was never formally accused of spying, Chinese officials did not spell out their suspicions clearly, and expelled him after almost a week's detention.
This was an especially embarrassing case since the Burns party was six days into its trip when it was caught. Their apprehension was due to their own indiscretion rather than to police vigilance. Observers say the state security apparatus was shaken by the incident, which added to its already poor reputation for lack of professionalism.
Other observers say that the security bureaucracy had already been shaken up by the defection in late 1985 of Yu Qiangsheng (also known as Yu Zengsan). A state security official who was reportedly knowledgeable about China's intelligence-gathering operations overseas, Mr. Yu is now living in the United States, according to press reports.
According to one source, the state security ministry has modeled its heightened surveillance operations on the tactics of the Soviet secret police, the KGB.
This may account for telephone calls to a number of journalists in which callers offered sensitive information. Some bachelor journalists have received telephone calls from Chinese women asking for a rendezvous.
The expulsion in February of Lawrence MacDonald, an American reporter with the French news agency Agence France-Press, was one result of the stricter policies.
Mr. MacDonald was accused of colluding with a university student and paying him money for state secrets. He denied the charges, and no evidence was presented. Authorities have avoided comment on rumors that the student concerned was severely punished.
US Secretary of State George Shultz raised the issue of treatment of Western journalists with senior Chinese officials during a visit to China in March. Observers say he was trying to prevent the recurrence of another expulsion.
One Western diplomat who first served in China during the tail end of the Cultural Revolution (1966-76) insists that the new surveillance is relatively light in view of China's past treatment of foreigners and the police-state practices of some other communist countries, and even some capitalist ones.
``Even at its worst, it has been mild compared with the great neighbor to the north,'' he said, referring to the Soviet Union.