They hide in plain sight on the streets, in neighborhood grocery stores, and at public gatherings. More and more federal agents from nearly every government agency are going undercover in the U.S. to sleuth potential lawbreakers, an extensive investigation by the New York Times has revealed. The troubling trend raises concerns that undercover work violates civil liberties.

Among the findings uncovered by the investigation was that federal agents dressed to look like civilians frequently attend large protests and demonstrations aiming to spot suspicious activity. Legal experts say such activity is an affront to the tenets of a free society. “There is a danger to democracy in having police infiltrate protests when there isn’t a reasonable basis to suspect criminality,” Michael German, a former undercover agent with the FBI who is a fellow at New York University’s Brennan Center for Justice, told the Times. German added that undercover work “carries serious risks and should only be undertaken with proper training, supervision and oversight.”

At least 40 agencies within the U.S. federal government use covert operations, the Times found. Agents impersonate business people, students, doctors, ministers and welfare recipients to glean information from people the agents believe might be breaking the law. The Internal Revenue Service has sent dozens of agents disguised as accountants, drug dealers and even yacht buyers after tax evaders abroad.

Agents have also used minors as decoys to uncover illegal alcohol and cigarette sales at convenience stores, according to the Times. Federal officials say sting operations such as this allow authorities to better gather evidence against criminals.

Undercover operations rarely come to light, but when they are exposed, they often spark controversy. One of the most egregious instances came in 2007 when an FBI agent impersonated an Associated Press journalist to get information about the source of a bomb threat at a high school in Lacey, Washington. News outlets were quick to criticize the FBI’s actions as "endanger[ing] the media’s credibility and creat[ing] the appearance that it is not independent of the government,” Common Dreams reported.

Another disputed incident involved an undercover agent from the Drug Enforcement Administration creating a fake Facebook page using photos from a real woman in New York, unbeknownst to her. The Facebook profile was used to bait drug suspects.

The federal government's increasing use of secret agents in operations once largely reserved for the FBI has to do with policy changes that give the agencies more freedom from oversight. For example, a new policy in 2004 allowed the Bureau of Alcohol, Tobacco, Firearms and Explosives to use money seized in undercover operations to fund future investigations.