THE RIGHT to travel outside the country, which the Supreme Court declared just 23 years ago to be a part of the "liberty" every American citizen enjoys, was almost written out of existence by the Supreme Court on Monday. Its 7-to-2 decision in the Philip Agee case gives the secretary of state virtually unlimited power to deny a passport to anyone (or revoke one already granted) if the secretary asserts that that person's presence abroad is likely to damage national security or foreign policy.

Few tears, to be sure, need to be shed for Mr. Agee. He may now be compelled to come home and account for his efforts to expose the identities of this nation's secret intelligence agents and sources, and worse things could happen. Instead of handling this case in a way that would have limited its application to conduct of the kind in which Mr. Agee has engaged, Chief Justice Warren Burger wrote with a sweep that is startling in its implications.

Freedom of Americans to travel abroad with a passport, he said, "is subordinate to national security and foreign policy considerations." When there is a "substantial likelihood" of serious damage to either national security or foreign policy by the activities of an American traveler, the government can deny or revoke the traveler's passport. The Constitution requires no more, he said, than a statement of reasons and a prompt post-revocation hearing. Then, in a footnote -- as if it were an afterthought -- the chief justice added the final blow: the court is not saying that either a statement of reasons or a hearing is required.

The effect of this, and the rest of the chief justice's opinion, is to give every secretary of state a weapon to hold over the head of every American abroad. Can a passport be revoked if its holder makes a speech in Israel that the secretary of state claims damages American foreign policy? Can a journalist's passport be revoked if he writes stories from, say, El Salvador, that seriously undermine the premises of American policy toward that country? There is language in this opinion that suggests the secretary could revoke both passports and not even bother to explain why. The chief justice simply refused to give serious consideration to the possibility that the government's control of foreign travel may be limited by the First Amendment.

It may be that if such cases ever arise, the court will recover from this deep bow it has made before the executive branch and its control over foreign policy. But in the meantime, the right of Americans to travel abroad without interference from the government has been seriously weakened. That right, by the way, has been made much of in the recent argument over human rights policy and over the distinction between authoritarian and totalitarian regimes. The greatly more despicable totalitarian government (it is argued by those who favor the distinction) denies its citizens that "liberty" to go abroad and come home again, which is the mark of a free nation and exists even in some authoritarian ones.

There is, fortunately, a remedy for this. Congress can take from the secretary of state the power that the court, by its trained reading of the Constitution and a law passed 50 years ago, has said is his. Congress, the court said, can set the standards under which passports are issued, denied and revoked. Congress should do that promptly even if it means setting aside some of the other work its judiciary committees now have under way. The right to travel is so much a part of the essence of America that this judicial opinion cannot be permitted to stand.