In the first indication that West Germany's expanding spy scandal may have involved the federal chancellery, the government announced today that a longtime secretary in Chancellor Helmut Kohl's office has defected to East Germany and is suspected of being a communist agent.

Herta-Astrid Willner defected with her husband, Herbert Adolf Willner, a senior official at a research institute linked to the Free Democratic Party, a coalition partner in Kohl's government.

Both sent letters from East Germany announcing their defection, authorities said. Herbert Willner's letter said he had decided to defect because he feared imminent arrest for "a criminal offense against the security of the [West German] federal republic." His wife's letter said she was quitting her job and taking refuge in East Germany, but it did not mention any possible spying activities, authorities said.

The revelations marked the first time that Kohl's office has been directly implicated in the wave of defections, disappearances and arrests that have shaken West Germany since early August. Friedhelm Ost, Kohl's spokesman, said the federal prosecutor's office had opened an urgent investigation of the couple on suspicion of espionage.

The Willners had come under suspicion some time ago, security sources said, and investigators involved in their case included Hans Joachim Tiedge, the high-ranking West German counterspy who defected to East Germany on Aug. 19.

Ost acknowledged that Willner, who had worked in the chancellery since 1973, could have seen sensitive reports on West Germany's nuclear program and the European high-technology program, Eureka. But he denied that she had access to classified material regarding President Reagan's Strategic Defense Initiative antimissile project.

Willner, who was an assistant to Klaus Koenig, a chancellery department head for domestic affairs, is the fifth West German in a sensitive position to defect or be arrested as a suspected spy in the past six weeks in the continuing espionage case, judged by many here to be the worst in the country's history.

Besides Tiedge, three secretaries have been exposed as communist agents. Two of them vanished and are believed to be in East Germany -- Sonja Lueneburg, the longtime personal aide of Economics Minister Martin Bangemann, who disappeared Aug. 6, and Ursula Richter, who worked with an Eastern European exile group and disappeared Aug. 17.

A third secretary, Margaret Hoeke, was arrested Aug. 24 and confessed to passing top-secret information to East Germany for the past 18 years. She worked for the foreign and security affairs adviser to President Richard von Weizsaecker and had high-level security clearance.

Government security experts had predicted further disappearances since the defection of Tiedge, a senior counterintelligence officer who was in charge of tracking East German spies. The spy hunter visited the institute where Willner worked at least once to learn more about his background, the sources said, adding that Tiedge would have been able to give East German authorities the identities of those agents in danger of being captured.

When Tiedge disappeared, Bonn intelligence authorities stepped up surveillance of those spies under investigation to ensure they would not flee. But the Willners had left on vacation a week before Tiedge's defection, the sources said.

The federal prosecutor's office said the Willners were vacationing in Spain and apparently disappeared 10 days ago after telling the manager of their hotel that they were going on a one-day trip to Andorra.

Security sources said it appeared Herbert Willner, 59, may have been a long-term mole planted by East German intelligence within the Free Democratic Party. He left East Germany in 1961 to settle in the West and worked most recently as a senior official at a research institute linked to the party, which has participated in all coalition governments since 1969.

The sources said Willner's wife may have become an accomplice after their marriage in 1974.

The opposition Social Democrats renewed their demands for the resignation of Interior Minister Friedrich Zimmermann, who refused to heed earlier opposition calls to step down over the Tiedge affair.

Herbert Willner, who was taken prisoner by the Soviets during the war, settled in East Germany in 1949 and became a member of the communist party. After coming to the West, he worked as an editor at the newsweekly Der Spiegel and in 1965 moved to Bonn where became active in the Free Democratic Party, rising to a post as a senior official in its political department dealing with foreign and security affairs. He transferred in 1979 to the Naumann Institute. Officials there said he did not have access to any secret materials.