THERE IS A widespread consensus in Congress now that it should be a crime for a former government official to divulge the names of secret intelligence agents that he learned on the job. That would address the problem of the Philip Agees, the occasional spy who goes sour.

The tougher question is what to do about revelations made not by former officials using secret files, but by private citizens working from information in the public domain. This is the situation of Louis Wolfe, who has made a career of combing public records with an eye to disclosing agents' names and forcing the CIA to close down its covert activities. Congress wants to get at the Louis Wolfs, but how can it do so without at the same time restricting other private citizens, including journalists, who write up intelligence affairs?

The House has one answer. To punish a private citizen who published an agent's name, it would have to be shown that his intent in publishing was to impair or impede the country's foreign intelligence activities. We are aware that in devising this formula the House means to respect the rights of journalists and others whose good faith is not suspect. But that's not enough.A test of intent compels an inquiry into belief and opens a gaping hole in the protections guaranteed by the First Amendment. Such legislation would be unconstitutional.

The House bill is bad, the and the Senate bill, which is to be marked up in the Judiciary Committee Tuesday, is no less well-meaning but no more satisfactory. The Senate bill, which the administration prefers, would make criminal a private citizen's disclosure if he had "reason to believe" disclosure would hurt intelligence activities. The chief protection offered journalists -- and too flimsy it is -- is that they would not be liable unless they were engaged in a "pattern of activities" to expose agents.

We are not saying that the Louis Wolfs are harmless. They are contemptible, and they can do harm. But whay they would surely consider their greatest victory would be to induce a free society to abridge some of its most important liberties in their name. The Louis Wolfs do not want merely to embarrass the CIA. Though they work with a pen rather true purpose is to destroy democracy. Congress should not become an unwitting accomplice in helping them move toward that end.