FILE - FBI Director James B. Comey speaks during a news conference in Portland, Oregon. (Don Ryan/AP)

THE FBI was pursuing an important case in 2007 when it attempted to find out who was making anonymous terrorist threats against a Seattle high school. The bureau had a suspect who was a teenager, and it sent the suspect a link to a bogus news story that appeared to come from the Associated Press, an article that appeared to be about the threats. Then an FBI agent impersonated an AP reporter and contacted the suspect online to encourage review of the bogus article. When the teenager clicked on the link, hidden software sent his location to the FBI. The teenager was arrested and later convicted.

What’s wrong with this story? The FBI certainly was right to investigate the threat. The bureau obtained from a court a warrant to carry out the operation, although it apparently did not tell the judge it would use a fake news report from the AP. The ruse was the work of a special agent in Seattle working with FBI behavioral scientists. “We do use deception at times to catch crooks, but we are acting responsibly and legally,” FBI Director James B. Comey said Thursday in a letter to the New York Times defending the operation. He said the techniques were “proper and appropriate” under guidelines existing then: They fooled only the suspect, led to an arrest and ended the threats. Today, he said, such a deception would require a higher level of approval but would still be lawful and appropriate.

Mr. Comey is missing something important. What was wrong about the Seattle operation was the potential damage to the credibility of the Associated Press by the creation of a false news account by the government and by the impersonation of a reporter. The technique threatens to undermine all reporters — not just those from the AP — who seek information from sources and represent themselves truthfully as independent journalists. The Post has joined other news media in a protest to Mr. Comey.

Just imagine the next time a reporter from the AP or The Post or any other news organization asks difficult questions about a terrorist threat, questions that might come up in Boston or Beirut. The slightest suspicion that the reporter could be a government official would change the nature of the answers given and may well endanger the journalist. The business of gathering the news has been risky enough in recent years. The U.S. government should not make it more so by impersonating reporters or creating bogus news articles.

To avoid undermining the credibility of all journalists, the FBI ought to announce that, as a matter of policy, it will not impersonate reporters nor create fake news articles in carrying out its duties. Certainly, the FBI can catch crooks without damaging the credibility of all news organizations or endangering their reporters.