Yes, it is illegal to expose an undercover cop when you do it knowing an investigation is underway or knowing the officer could be harmed. No single statute uses that language, but federal obstruction and witness tampering laws carry up to 20 years in prison, a separate federal law covering intelligence agents carries up to 15, and a growing list of state anti-doxing statutes criminalize publishing an officer’s personal information. The charge that applies depends on who the officer is, what you intended, and what happened after the disclosure.
Intent Is What Separates a Crime From a Comment
Almost every charge below requires prosecutors to prove you acted knowingly and deliberately. Mentioning to a friend that someone you know works undercover, without any plan to disrupt anything, is not a crime. Posting that same officer’s name on a forum used by the targets of their investigation can be.
Courts look at what you knew, who you told, and what followed. A neighbor gossiping about seeing a “cop car” sits on one end. Someone broadcasting an officer’s identity to a criminal organization to sabotage an arrest sits on the other. Many real cases fall somewhere in between, and that is where the specific statute, the specific audience, and the specific consequences decide whether charges stick.
Federal Obstruction and Witness Tampering
The most direct federal charge comes from the obstruction of justice provisions in Title 18 of the U.S. Code.
Section 1503 makes it a crime to influence, obstruct, or impede the administration of justice. Penalties run up to 10 years for general obstruction, and up to 20 years when the conduct involves an attempted killing or targets a juror in a serious felony case.1Office of the Law Revision Counsel. 18 USC 1503 – Influencing or Injuring Officer or Juror Generally
Section 1512 covers witness tampering. It applies when someone uses intimidation, threats, or corrupt persuasion to prevent another person from giving information to law enforcement about a federal crime. An undercover officer gathering evidence is exactly the person this statute protects. Revealing that officer’s identity to stop them from reporting what they have learned carries up to 20 years in prison.2Office of the Law Revision Counsel. 18 USC 1512 – Tampering With a Witness, Victim, or an Informant The same provision reaches disclosures meant to keep the officer from testifying later.
To convict under either section, prosecutors have to show three things: an investigation or official proceeding was underway, you knew about it, and you acted with specific intent to interfere. Publicly identifying an officer during an active drug sting, causing the operation to collapse and suspects to flee, meets all three.
When the Officer Works for an Intelligence Agency
If the undercover officer is a federal intelligence operative rather than a local or federal cop, a separate statute applies. The Intelligence Identities Protection Act, codified at 50 U.S.C. ยง 3121, specifically criminalizes revealing a covert agent’s identity. It reaches CIA officers, intelligence operatives, and similar personnel whose relationship to the government is classified.
Penalties depend on how you learned the identity:
- If you had authorized access to classified information identifying a covert agent and intentionally disclosed that identity, up to 15 years in prison.3Office of the Law Revision Counsel. 50 USC 3121 – Protection of Identities of Certain United States Undercover Intelligence Officers, Agents, Informants, and Sources
- If you learned the identity as a byproduct of access to classified information and then intentionally revealed it, up to 10 years.3Office of the Law Revision Counsel. 50 USC 3121 – Protection of Identities of Certain United States Undercover Intelligence Officers, Agents, Informants, and Sources
- If you engaged in a pattern of activities to identify and expose covert agents, with reason to believe your actions would damage U.S. intelligence operations, up to 3 years.3Office of the Law Revision Counsel. 50 USC 3121 – Protection of Identities of Certain United States Undercover Intelligence Officers, Agents, Informants, and Sources
Sentences under this statute run consecutively with any other sentence rather than concurrently. Prosecutors must prove you knew the government was actively concealing the agent’s intelligence role and disclosed the identity anyway. Accidental disclosures and speculation do not qualify.
Reckless Endangerment
Even when no active investigation is disrupted, exposing an undercover officer can bring endangerment charges if the disclosure creates a serious risk of physical harm. This charge focuses on the officer’s safety rather than on obstruction of the justice system. Prosecutors have to show the conduct created a substantial risk of serious injury or death.
The clearest case is exposing an officer who has infiltrated a violent criminal organization. If gang members discover the officer’s real identity because someone posted it online or spread the word, the officer may face retaliation, and the person responsible can face felony charges carrying several years in prison depending on the jurisdiction. Most states use a sliding scale: misdemeanor charges for lower-risk conduct, felony charges when the risk of harm is grave.
Aiding, Abetting, and Conspiracy
Exposing an undercover officer rarely stands alone. If the disclosure helps someone else escape arrest, destroy evidence, or commit another crime, you can be charged as an accomplice. Under federal law, anyone who aids, abets, or induces the commission of a federal offense is punishable as if they committed the crime themselves.4Office of the Law Revision Counsel. 18 USC 2 – Principals Tipping off a drug dealer that the person they are meeting is a federal agent, and the dealer flees or destroys drugs, exposes you to the same charges the dealer would have faced.
Conspiracy adds another layer. If two or more people coordinate to expose an undercover operation, each can be charged with conspiracy to commit an offense against the United States, carrying up to five years on its own, in addition to any penalty for the underlying offense they helped obstruct.5Office of the Law Revision Counsel. 18 USC 371 – Conspiracy to Commit Offense or to Defraud United States
State Anti-Doxing Laws
A growing number of states have passed laws that specifically criminalize publishing the personal information of law enforcement officers online. These statutes, often modeled on New Jersey’s Daniel’s Law, prohibit disclosing home addresses, phone numbers, and other identifying details of active or retired officers when done with intent to harass, intimidate, or endanger. As of mid-2025, at least 19 states had enacted some form of anti-doxing legislation covering public officials, and several of those laws explicitly name law enforcement officers as a protected category.6The Council of State Governments. Doxing: State Protections Against Digital Threats
Approaches vary. Some states have created standalone criminal offenses with penalties ranging from misdemeanors to felonies. Others have amended existing harassment or stalking statutes to cover online publication of personal information. A handful provide only civil remedies, letting the officer sue rather than pursue criminal charges. Someone who posts an undercover officer’s personal details on social media may now face charges that did not exist a few years ago.
What the First Amendment Does and Does Not Cover
The First Amendment protects a wide range of speech, but it has never protected speech that is itself part of committing a crime. Telling a drug ring that their new supplier is actually a federal agent is not protected speech any more than falsely yelling fire in a crowded theater. The Supreme Court has long held that speech directed at inciting imminent lawless action, and likely to produce it, falls outside constitutional protection.7Justia Law. Brandenburg v Ohio, 395 US 444 (1969)
True threats of violence also receive no protection. The Supreme Court has recognized that threats cause harm even when never carried out, because they create fear, disrupt the victim’s life, and carry the possibility that violence will follow.8Congress.gov. Amdt1.7.5.6 True Threats Exposing an undercover officer’s identity to people who might harm them can cross that line, particularly when the person making the disclosure knows the officer will be in danger.
A reporter investigating police misconduct who learns of an undercover operation occupies different legal territory than a gang member who outs an infiltrator. Courts weigh intent, audience, immediacy of danger, and whether the speech served a legitimate public interest. The core principle holds: when speech is the mechanism of a crime, the First Amendment does not shield the speaker from prosecution.
Civil Lawsuits Come on Top of Criminal Charges
Beyond prosecution, the exposed officer may sue for damages. Criminal conviction requires proof beyond a reasonable doubt; a civil case only requires a preponderance of the evidence, making it easier for the officer to win. Causes of action include negligence, intentional infliction of emotional distress, and invasion of privacy. If the exposure forces the officer to relocate, abandon an assignment, or take on protective measures, those costs become quantifiable damages in a lawsuit.
So the short answer is that exposing an undercover cop can be charged in several different ways, and which law applies turns on who the officer is, what you knew, and what the exposure caused. If you have already made a disclosure you are worried about, or you are being questioned about one, talk to a criminal defense attorney before saying anything further.