What’s the worst thing you’ve ever done on the Internet? Obsessively Googled an old high school crush? Deleted a critical comment on something you wrote?  Purchased porn? Most of us have typed, searched, or watched something that we regret; the anonymous nature of the medium facilitates such surreptitious actions. 

The new HBO documentary “Thought Crimes,” which airs Monday, explores that grey area in which the messages you send out can come back to haunt you.The film centers around the case of Gilberto “Gil” Valle, an ex-NYPD cop who was accused and arrested by the FBI in 2012 for plotting to abduct, butcher, and eat women. 

Valle researched many of his targets using a police database, and posted about his fantasies on online fetish forums. The New York media christened him the “Cannibal Cop,” prompting a litany of stomach-turning headlines and a highly publicized legal process. In 2013, a jury convicted Valle of conspiracy to kidnap, and he was shuttled off to New York state prison.

It was in prison when Valle’s relationship with director Erin Lee Carr began. She reached out, and they began to connect regularly on the phone, keeping in touch even after the press frenzy surrounding his case died down. Last year, Carr’s patience paid off—in a highly unexpected decision, a judge overturned Valle’s original sentence and set him free, after 21 months in jail. Upon his release Valle granted Carr exclusive access to his story; most of the interviews in the film take place in the months following his release, while he was under temporary house arrest at his mother’s home.

It’s not particularly hard to make a compelling movie about a would-be cannibal. Lots of people will watch “Thought Crimes” just to hear the gory details of the case—the way Valle fantasized about hanging women from spits, or offered up bodies for sale on a site called the Dark Fetish Network. The film seems slyly self-aware of its stomach-turning capabilities: In one scene, Valle fries up thick slices of bacon and stirs tomato-laden pasta while talking about his case. “Nobody’s alarmed I have a fork in my hand with people around?” he awkwardly jokes to an off-screen Carr.

What’s harder to accomplish—and what Carr deftly achieves—is the transformation of a tabloid story such as this one into an effective means of confronting a more universal experience. The anonymity of the web provides many us with an outlet to expose the most suppressed parts of our minds. Does that mean our darkest or most evil selves? “For some people, that might be the case,” Carr said to me in an interview.

For others, “darkest selves” might just mean a proclivity for Facebook stalking ex-boyfriends, or rudely commenting on news articles. Regardless, the experience of watching another person’s Google searches spill across the screen elicits some measure of sympathy, for those of us who have done at least one thing on the Web that we’re not proud of. “I shouldn’t be reading these,” I thought to myself more than once during the film, while at the same time being unable to turn away.

Carr accomplishes this feat in a few ways—initially, by showing the slightly darker sides of seemingly innocent onlookers. Valle isn’t the only character in the film that flips your stomach. Take the court illustrator, who actually seems to enjoy drawing pictures of the fetish website screenshots that were used as evidence in court. “I got to do people on spits,” she says at one point, smiling. Then there’s Valle’s own mother, who seems to refuse to see her son’s case in anything but a reductive black-and-white. “He’s not a cannibal,” she says bluntly, during an interview with Carr. “He never ate anyone.”

More generally, though, the film shows that the “crime,” gruesome as it is, took place only in Valle’s imagination. Much has been written about the two sides of the debate central to Valle’s case: whether Internet posts and searches are enough to send a person to jail. But “Thought Crimes” actually makes a rather unmistakable case for his innocence: He comes off as a chauvinistic and frustratingly un-self-aware creep, but not a criminal. The law, at least currently, agrees. “I was really happy when I heard [of his release],” said Carr. “We can all have our own personal opinions about Gil Valle, but there’s legal consensus, and that’s that he did not act enough to put him in prison for life.”

Valle was 28 when he was arrested; he’s in his early thirties now. He has pale skin, sad-cow eyes, and a face rounded out by the stubborn traces of baby fat. He’s not a sympathetic character by any stretch, but neither does he come across as a coldhearted killer. Rather, he is something in between—a person who opened up his personal Pandora’s box of dark fixations on the Internet, and had the misfortune of having someone trace them back to him.

It’s that complicated depiction, and Valle’s relatability, that makes this story so compelling. No, not everyone who watches this film has repressed cannibalistic fantasies—far from it.  But in an age where nearly anything you can imagine is available online, where special-interest communities have space to flourish, and where online commenters gain easy attention for vitriol, it doesn’t feel right to condemn a person to jail based solely off of their Internet self, however twisted that persona might be. While Valle’s actions were disgusting, he had no real-world victims.

Carr has learned from this project herself. She’s only 26, but already a cautious interviewee, often checking herself to make sure she’s not speaking for Valle, or oversharing any personal details from her life. “Every time I tweet anything, I think, ‘would I feel comfortable if somebody brings this up in court, or in person?’” she said to me.

Her concerns about legal accountability are not merely theoretical. Gilberto Valle’s case is being appealed in court on May 12—one day after “Thought Crimes” premieres on TV.