The Supreme Court yesterday gave the government broad discretion to deny travel abroad to citizens it believes threaten national security or American foreign policy.

By a 7-to-2 vote, the court upheld revocation of the passport of former CIA agent Philip Agee for traveling around the world exposing purported CIA agents. Agee's open campaign to destroy the CIA threatened the lives of government officials abroad and "seriously damaged" national security, the court said.

Agee's words crossed the line separating constitutionally protected free speech from action, which is not protected, the court ruled.

The authority to draw that line for passport purposes -- to decide when speech becomes action harmful to U.S. policy -- rests exclusively with the secretary of state, Chief Justice Warren E. Burger wrote for the court. The citizen has no right to a hearing beforehand, the court said.

"The freedom" to travel abroad afforded by a passport "is subordinate to national security and foreign policy considerations," Burger said. "No governmental interest is more compelling than the security of the nation."

"History eloquently attests that grave problems of national security and foreign policy are by no means limited to times of formally declared war," he wrote.

It was the third time in a year and a half that the court has subordinated claims of individual liberty to national security or defense considerations. Last week, the justices said Congress' national defense powers overrode men's objections to the exclusion of women from the draft. In February, 1980, the court said free speech guarantees did not apply to government employes entrusted with sensitive or classified information. That case involved former CIA agent Frank Snepp, who, like Agee, broke a secrecy oath.

Dissenters William J. Brennan Jr. and Thurgood Marshall said the "reach" of the discretion allowed in the Agee case by the court was "potentially staggering."

"It is important to remember," Brennan and Marshall said in dissent, "that this decision applies not only to Philip Agee . . . but also to other citizens who may merely disagree with government foreign policy and express their views."

In West Germany, Agee said he would continue to expose clandestine U.S. activities abroad despite the Supreme Court's action.

Agee, 47, told Reuter in a telephone interview from his Hamburg home: "I have had no passport for the last year and a half and the revocation will have no effect on my work or residence in the Federal Republic of Germany."

The former CIA agent has just published a book attacking the agency's role in El Salvador and questioning U.S. government assertions of Soviet and Cuban involvement in the Salvadoran civil war.

"If the Supreme Court justices think that kind of scholarly analysis can be stopped by taking away my passport, they're just fools," he said.

A CIA agent from 1957 to 1968, Agee has been openly publishing the names of people he describes as undercover operatives overseas as part of an effort to drive them out and have the CIA abolished. The government argued that such activity endangers the lives of American representatives abroad.

The court yesterday cited in its opinion assassination attempts on "exposed" American diplomats in Jamaica in 1974, the 1975 murder of diplomat Richard Welch in Greece, and the murders of two American labor officials last January in El Salvador. Agee had not named any of the murdered individuals, although he claimed in a book that the labor project in El Salvador was run by the CIA. He has not been formally accused in connection with any of the incidents.

Secretary of State Cyrus R. Vance stripped Agee of his passport in December, 1979, when Agee was reportedly invited to Iran to help student militants interpret CIA documents seized during the U.S. Embassy takeover there. Vance said Agee's activities damaged or might damage national security.

U.S. District Court Judge Gerhard A. Gesell ruled in January, 1980, in a case now titled Haig v. Agee that the secretary had exceeded his authority. The right to travel abroad, he said, cannot be revoked without express congressional authorization. A divided Court of Appeals panel affirmed Gesell.

Reversing the lower courts yesterday, Burger said it was true that Congress had not "in so many words" empowered the secretary to revoke a passport. But Congress didn't specifically prevent revocation either, he said.

Congress, in a 1926 passport law, did confer broad rule-making authority on the secretary of state. Unless there are strong reasons to interfere with that authority, Burger said, the courts should stay out of it. "Matters intimately related to foreign policy and national security are rarely proper subjects for judicial intervention."

Agee had charged that the revocation violated his constitutional right to due process because there was no hearing; his constitutional right to travel, and his First Amendment right to critize the government.

Burger said that when "there is a substantial likelihood of 'serious damage' to national security or foreign policy" no prior hearing is required. "A statement of reasons [for the revocation] and an opportunity for a prompt" hearing after revocation, he said, will do.

As for the right to travel, Burger said the "freedom to travel outside the United States" did not deserve the protection given to travel within the country. He said the government's need to protect foreign policy outweights any right of foreign travel.

Burger conceded that the government's decision to deny the passport "rests in part on the content of his speech."

Brennan, with Marshall, said the court was effectively overruling precedents, including a 1958 case striking down denials of passports to American communists.

Burger said the earlier cases did not deal with someone's "conduct," just with "beliefs and speech." He said Agee compared with someone who discloses troop movements during wartime. That type of activity, like the threat posed by Agee's words, is "clearly not protected by the Constitution."

In other action yesterday, the court said that police need not stick to a rigid "incantation" when informing criminal suspects of the right to counsel.

The case, California v. Prysock, stemmed from police "Miranda warnings" to a juvenile arrested for murder. The police told the youth he had a right to a court-appointed lawyer. But they did not say he could have one paid for during the questioning. The California courts held that that omission nullified the youth's conviction.

Din an unsigned 6-to-3 ruling, the court said that "no talismanic incantation" is required from police.

Justices John Paul Stevens, Brennan and Marshall dissented. The court ruled without hearing formal arguments in the case.