Gilberto Valle was 25 years old and still living with his father in Queens when, in 2009, he met Kathleen Mangan on OKCupid. He was a cheerful, moon-faced cop at a precinct in West Harlem; she was new in town, a young Teach for America recruit at an elementary school in East Harlem. Their romance got serious quickly. They moved to their first apartment, a one-bedroom on 88th Street and Third Avenue. They got a pet, a bulldog they trained together and took turnswalking. Mangan remembers those early years fondly. “It was fun,” she said in court last year, the only time she’s commented publicly about her husband or marriage. “We laughed together. It was nice. He opened doors, pulled out chairs.”

Things changed when she got pregnant. When he first heard the news, Valle said, “I can’t do this,” before salvaging the moment, calling her parents to assure them that he would do the right thing. But he never seemed to fully adjust. Instead, Valle drifted away. “He never seemed very interested at all,” Mangan said. “He was sighing and just seemed miserable that I was wasting his time.”

They moved to a bigger apartment, a two-bedroom in Forest Hills, and were married on June 19, 2012, nine months after the birth of their daughter, Josephine. “The wedding was nice,” Mangan said. “The marriage was not.” She said that Valle rarely helped with the baby. When he came home after midnight from the precinct, she usually wouldn’t wait up. Sex, when it was happening at all, never ended well. “He couldn’t finish,” she said. “He would run to the bathroom.” After a while, he avoided her almost completely, and instead would play video games, watch TV, and go on the Internet “until three, four, five in the morning, or just not come to sleep in our bed.”

When they were up together, she’d see her husband surfing the websites of ESPN, Major League Baseball, and the Rant, a message board for NYPD cops. One day in the summer of 2012, shortly after their wedding, she noticed that he was erasing his search history. Not long after that, she learned what he really was looking at. She opened their Mac and saw that he hadn’t logged out of his account. “I noticed that there were two little files on the bottom,” she said, “so I clicked on them.” They were image files, and while the pictures themselves didn’t load, she was able to see the URL where they’d come from.

She clicked again and saw the home page of a website called Dark Fetish Network. “It was porn,” she said, “and it was disturbing. I mean, I know S&M is kind of popular, like Fifty Shades of Grey, you know, but this seemed different … The girl on the front page was dead.”

Until that moment, Mangan had thought that if she were prettier, or if she just cleaned and cooked more, he would want her. Now she wasn’t so sure. She told Valle they needed to talk. Was this what he wanted? Should they go shopping for some sex toys? Valle seemed frightened at first, but then relieved and enthusiastic. For the first time since before she was pregnant, she was hopeful. “I thought maybe we had had, like, a breakthrough,” she said, “that we were communicating, that he was going to be honest and talk to me.”

But they both were changed by the ­discovery. She couldn’t stop thinking about what she saw, and he seemed ­suspicious of everything she was doing. On September 9, 2012, she installed spyware on their computer. “I had no choice,” she said. “I was scared.”

The next day, she saw all the websites Valle was visiting: darkfetishnet.com, girlsinabind.com, fetlife.com. She saw her name in his instant-message chats. “And I started clicking on them and all of a sudden I was staring at pictures of me, pictures of my friends, pictures of people we knew.” She entered her name in a search of Valle’s e-mail, and what she saw overwhelmed her. “I was going to be tied up by my feet and my throat slit and they would have fun watching the blood gush out of me because I was young, and ‘If she cries, don’t listen to her, don’t give her mercy.’ And Gil just said, ‘It’s okay, we will just gag her.’ ”

She booked a flight to her parents’ in Nevada, taking the baby with her. Days later, she logged into the spyware program again. She found a trove of S&M images of women being tortured and sexually assaulted. She saw records of Google searches for phrases like “how to kidnap a woman” and “human meat recipes.” She opened files with pictures of more than 80 women he’d downloaded from Facebook and other sources. And she read e-mail conversations Valle had had with three different people in which he discussed the various ways he might kidnap, rape, kill, and cook these women. Mangan was one of them, but there were others: an old friend of hers from work; Valle’s supervisor at the 26th Precinct; a teenage girl who had just graduated from Valle’s old high school; and quite a few of Valle’s college friends—about one of whom he once wrote, “I’ll be eyeing her from head to toe and licking my lips, longing for the day I cram a ­chloroform-soaked rag in her face.”

Shortly after 2 p.m. on October 24, a group of FBI agents descended on the apartment in Forest Hills. To avoid a possible shoot-out with an NYPD officer, they used a ruse to lure Valle into the hallway—calling his house phone and saying the car he had parked outside had been hit. Valle wandered out in a sweatshirt and jeans. The second he saw them, he understood. An agent placed a hand on his shoulder. “Everything’s going to be okay,” he said.

Valle looked at him and said, “I don’t think so.”

In no time, Valle had a tabloid moniker: the Cannibal Cop. As he sat in jail for five months awaiting trial on a charge of conspiracy to kidnap, details from his bail hearings told the story of a husband secretly plotting to abduct several women at once, including his own wife. The FBI singled out e-mails in which he strategized how he’d do it and negotiated fees for kidnappings, and they scanned his work-related computer searches, claiming he shadowed his targets using resources available to him as a law-enforcement officer. “This case is all the more disturbing,” U.S. Attorney Preet Bharara said after the arrest, “when you consider Valle’s position as a New York City police officer and his sworn duty to serve and protect.”

Once the trial started, there seemed to be two different cases being argued. There was the actual charge against Valle—­conspiracy to kidnap—and then there was the subtext that he was technically not on trial for, the specter of what Valle might do in the future if he were allowed to go free. Plenty of aspects of criminal cases involve at least some discussion of how much of a danger the accused poses to society: Judges issue warrants and set bail and sentences all based on some element of prognostication. But what made the case against Valle unique, according to his lawyers, was that absolutely everything the government was using as evidence that he was dangerous was based on his thoughts.

The gory details of the case against Valle were disturbing enough, at first, even to alarm his court-appointed lawyer. “Never in my career have I ever hesitated to tell the marshals to take the handcuffs off the client when I’m interviewing them one-on-one,” says Julia Gatto, the federal public defender assigned to the case. “And this was the first time in my career I’d ever, for just a second, thought about keeping the handcuffs on.” She would think a lot about that moment later on, when considering what the jury would have to get past to decide if Valle’s thoughts alone were criminal.

The line between criminal thoughts and action is something the courts have pondered for decades. While thoughts haven’t always been protected from prosecution (as the witch hunts and red scares and political detentions of many eras demonstrate), there was a time, more than a century ago, when even attempted crimes like theft and murder and kidnapping weren’t considered criminal activity: If you tried to pick someone’s pocket and there was no money in the pocket, then you couldn’t be prosecuted. When attempted crimes first became criminalized in the early 1900s, Supreme Court Justice Oliver Wendell Holmes urged caution, asserting that for the defendant to be convicted, “[t]here must be dangerous proximity to success.”

That standard weakened in the sixties, when a new set of guidelines called the Model Penal Code—a successful effort by the legal community to standardize the criminal code across the nation after a century of inconsistent case law—­replaced the idea of proximity with that of a “substantial step.” For law enforcement, this was a happy coincidence: As violent crime became a more common reality, the police could use a suspect’s state of mind to justify an arrest, as long as that suspect also took at least some real action.

What’s changed in recent years are the tools used to detect intent—namely, a person’s online activity. “We’ve always said you can’t punish for thoughts alone, but now we really know what the thoughts are,” says Audrey Rogers, a law professor at Pace University who has taught the Valle case in class. Since 9/11, the government has used the monitoring of ­electronic communication to bring more than 200 prosecutions against people suspected of providing material support to terrorist organizations. “You expand the definition of a crime by extending it to this sense of what might happen in the ­future,” says Georgetown law professor David Cole.

What’s also changed, perhaps, is the scale of certain crimes—not just 9/11 but Columbine, Aurora, and Sandy Hook—and the way technology has emboldened many to think that anyone with ill intent might be stopped before snapping into action. In 2009, the FBI was reading Najibullah Zazi’s e-mails to Al Qaeda and picked him up before he ever built a fully workable bomb. Just last month, in Arizona, police traced threatening e-mails to a 15-year-old who turned out to own 100 rounds of ammunition; he didn’t own a gun, but after his arrest, police said they’d learned he had researched how to make an explosive device but was unable to procure the parts. And then there are the scores of To Catch a Predator–style stings.

In all these cases, the police said they had physical evidence aside from e-mails to back up arrests. With the Cannibal Cop case, however, the evidence is more diffuse, difficult to interpret, and it might represent the fullest realization yet of our justice system’s march toward something out of Minority Report—the investigation and prosecution of pre-crime.

The Dark Fetish Network, or DFN, is a social network with nearly 50,000 purported users. Members use aliases and share photos and tell stories to one another as a sort of group fantasy exercise. The home page displays a disclaimer stating that everything discussed on DFN is not real (“This place is about fantasies only, so play safe!”). But, of course, the anonymity of the members makes it impossible to know the true intentions of any given person on the site.

Based on what they discovered on ­Valle’s computer, prosecutors said he had only started visiting DFN in late 2011 or early 2012. Valle had signed on as Girlmeat Hunter and won praise from some other members after contributing to the group chats. He started IM-ing directly with those members and exchanging e-mails for offline volleys. By the time his wife had set up spyware in September, Valle had quit DFN, but records of e-mail chats that took place outside DFN with three alleged co-­conspirators remained on his computer: a 22-year-old car mechanic from southern New Jersey named Michael Vanhise; a British man Valle knew as Moody Blues, whom the FBI identified as Dale Bolinger; and someone using the username Ali Khan who apparently was logging on from Pakistan.

In January, Valle had e-mailed Vanhise photos of Alicia Frisca, the friend of ­Kathleen’s who teaches at the school where she once worked, and offered to kidnap her for him for $5,000. Vanhise replied, “Could we do four?” To which Valle responded: “I am putting my neck on the line here. If something goes wrong somehow, I am in deep shit. $5,000 and you need to make sure that she is not found. She will definitely make the news.” In chats happening about the same time with Ali Khan, Valle suggested taking Kathleen on a trip to India, where the two of them would kill her and prepare her for dinner. “We will take turns with her,” he wrote, after sending him a photo of Kathleen in a bikini. They also discussed killing Andria Noble, one of his college friends. “It’s personal with Andria,” Valle wrote. “She will absolutely suffer.” Later, he added that he’d found a recipe for chloroform online. “I’m in the middle of constructing a pulley apparatus in my basement to string her up by her feet.”

By summer, Valle had spent more time chatting with Moody Blues, bragging that his oven was big enough to fit a victim in it if he folded her legs and mentioning that he had a place up in the mountains (“No one around for three-quarters of a mile”) where he could bring one woman of their choice. They settled on Kimberly Sauer, a college friend of Valle’s, and Valle started planning the details: “Once she is dead, I will take her out and properly butcher her body and cook the meat right away. And that could be out on a rotisserie too.” Valle later e-mailed Moody Blues a short Word document titled “Abducting and Cooking Kimberly, a Blueprint.” He listed materials he’d need to do the job: a car, chloroform (“refer to website for directions”), rope, a gag (“duct tape?”), a tarp or plastic bags to protect the trunk from any DNA remains, more bags for Sauer’s clothes, and “cheap sneakers.”

On various occasions in the past year, Valle had used the NYPD database to search for information about Maureen Hartigan (a high-school friend of Valle’s), Andria Noble, and Kimberly Sauer. The searches typically offer basic pedigree information, such as home address, date of birth, height, weight, eye color, and criminal records. Prosecutors saw this as further evidence that Valle’s plans were serious. On July 22, Valle reported having seen Sauer in person at a brunch during a weekend trip to visit old friends from the University of Maryland. “She looked absolutely mouthwatering. I could hardly contain myself.” On August 24, they discussed ways that Valle might kidnap another woman, Kristen Ponticelli, a recent graduate of Valle’s old high school whom he never met personally (Valle’s lawyers assume he just noticed her photo on Facebook). The next day, they moved on to Andria Noble. “If Andria lived near me, she would be gone by now,” Valle wrote. “Even if I get caught, she would be worth it.”

But there was no physical evidence from Valle’s home suggesting he was getting ready to kidnap or cook anyone—no oven large enough for a human, no cleaver, no homemade chloroform. Prosecutors had no proof he had a place in the mountains. They had no proof that Valle knew the identities of the three people he was chatting with. Valle never divulged the last names of any of the people whose photos he passed along (not even his wife’s) and never gave out any of their addresses, even after Moody Blues ­specifically requested one, and he haphazardly switched up details about their life stories and college educations.

And perhaps most important, Valle’s DFN user profile announces that he is just fantasizing—that he doesn’t mean what he says. The kidnapping plans in the chats and web searches of women who interested him all come and go without follow-through, like fantasies one resumes with different names and details. “Three different women were going to be kidnapped on Presidents’ Day,” says Edward Zas, another of Valle’s defense lawyers. “That day comes and goes, nothing happens. Then it was going to be Labor Day. Nothing.”

Even so, the defense understood the task ahead of them—how to make a jury get past the image of the Cannibal Cop. “The only way you can defend this case practically was to take on the burden of convincing this jury somehow, really to a certainty, that he could never do this,” says Zas. “And how do you do that in a case where the guy is admittedly interested in this stuff?”

On the afternoon of ­December 31, 2012, a forensic psychiatrist named Park Dietz traveled downtown to the Manhattan Detention Center to conduct a psychiatric examination of the Cannibal Cop.

No one on either side of this case had ever claimed that Valle was insane. But since the case against him revolved almost entirely around his chats, Valle’s lawyers felt they needed a forensic ­psychiatrist to weigh in on the central question of how real his web persona was—and how real it might become. And very few marquee-name criminals of the last three decades have made it through the justice system without being ­examined by Dietz. In his 30-year career, he’s interviewed John Hinckley Jr., Betty Broderick, Arthur Shawcross, Andrea Yates, and Joel Rifkin.

Pre-crime and psychiatry often go hand in hand. Legal instruments like institutionalization and sex-offender registration all share the goal of preventing crime from taking place, and for better or worse, they’re based on a psychiatric rationale. Those opinions, however, have a fairly poor track record when it comes to forecasting future behavior. For pedophiles and other potential sex offenders, every diagnostic tool has a spotty success rate in predicting when a person might go operational with his fantasies. (With ­Valle, Dietz employed elements of the Static-99, one straightforward assessment geared toward predicting recidivism for rapists and child molesters, and saw no red flags.)

Still, being able to anticipate behavior remains the holy grail to some in law enforcement. “We need to understand more about the signs that show somebody is either becoming deranged or becoming a terrorist,” former Homeland Security boss Michael Chertoff said after the 2012 shootings in Aurora, Colorado. The military is at work on a way of predicting suicidal behavior, tracking soldiers through stressful situations like divorces and beefing up screening in basic training and before and after deployments. Last October, Attorney General Eric Holder recommended “new strategies” to prevent mass shootings, citing how the FBI helped to disrupt or prevent nearly 150 shootings and violent attacks in 2013, in part by steering potential attackers toward ­mental-health professionals.

What Dietz potentially had to offer the Valle defense was something similar to all these systematic attempts at pre-crime analysis. The doctor already knew from Valle’s NYPD psychology file that the officer had been administered the Minnesota Multiphasic Personality Inventory, a standard test meant to identify personality structure and detect signs of ­psychopathology. “The MMPI showed no clinical psychopathology,” ­Dietz says. “And that’s not something I run into very much.”

But then there were those e-mails. When he’d first read them, Dietz honestly didn’t know what to think. “From the chats and e-mails, there was no way to tell. Chats and e-mails allow for multiple inferences. Taken at their worst, they would be very alarming.”

In eighteen hours of interviews with Dietz spanning three days, Valle discussed openly, for the first time with another human being, everything about his sex life, starting with a traditional ­Catholic-school childhood. He was not inhibited or ashamed about masturbation, but he was repressed and inhibited around others. “He was quite shy about approaching girls,” Dietz says, “in a way I haven’t seen since the fifties.” His fantasy life took a turn when in high school he saw the film The Mask and locked in on an image of Cameron Diaz, abducted and tied up. By the end of high school, he discovered bondage websites, and in college he found fetish websites, including Muki’s Kitchen, a campy site that specializes in staged cannibalism pornography—women tied up on spits, with apples in their mouths. Valle was turned on while, in real life, he treated women respectfully, never threatened anyone, and did not have sex at all, until he met Kathleen Mangan. And then he discovered DFN.

The very thing that might have offered Valle some release—speaking openly about his fetish—was too explosive for him to contemplate. So he kept it all a secret for as long as he could. Once he was sharing his secret with strangers on the Internet (the basis of the government’s conspiracy argument), is it possible that that danger, that risk, only made it more exciting to Valle, harder for him to stop, and easier for him to escalate into action?

“I understand how the evidence could be construed in that way,” says Dietz. “I see him as many, many steps removed from the kind of person that might start to take action.” Dietz is convinced that “to become a sex criminal acting on your paraphilia, you need more than your paraphilia.” He searched for evidence of something in Valle’s personality—“all the past actions and aggressive actions and character flaws that show us that he’s that one-in-1,000 monster. And I couldn’t find them.” By Dietz’s reckoning, the circumstances surrounding the chats speak volumes about how ludicrous they were. If Valle ever had a fleeting thought of actually harming a woman, Dietz says, “he certainly did everything in his power to ensure that he would be immediately identified as the offender if he did so,” using a traceable IP address and a shared computer. Even Valle’s repeated web searches for chloroform recipes or the addresses of the women he fantasized about failed to concern Dietz. “This is just like a man who has a fetish who will repeatedly go back and look at the same picture of a woman wearing a particular kind of undergarment.”

This opinion, of course, might be as suspect as any other in a pre-crime case, so Valle’s lawyers would have to employ it carefully. But even if psychiatry still offers no crystal ball for human behavior, Dietz was telling them that Valle’s thoughts, while unpleasant, were less than ominous.

“He’s the nicest guy you’d ever meet,” Dietz says.

The image of Valle as a nice guy never really emerged during last year’s trial. His wife’s tearful testimony set a darker tone early on. When she was asked in cross-examination why she refused to be interviewed by Valle’s lawyers before the trial, Mangan snapped: “You ­represent the man who wanted to kill me. No. I do not want to talk to you.”

So much of the prosecution’s case ended up being about the e-mails that Valle’s lawyers decided not to put Dietz or Valle on the stand, believing more detailed questions about Valle’s fetish would only distract from the conspiracy charges, which they saw as flimsy. During summations on March 7, Valle wept as he listened to his lawyer describe how his wife had left him because of the way he broadcast his fetish. “His foolishness on the Internet, his insensitive, ugly thoughts, have cost him everything,” Gatto said. She allowed that we all should be disturbed by Valle’s thoughts but drove home the notion that those thoughts simply weren’t the subject of the trial. “The conversations are ­preposterous. They are disturbing. They are disgusting. We should be upset that people are thinking these thoughts, but they are not criminal.”

The prosecutor, meanwhile, depicted Valle as reckless and out of control. In his summation, Randall Jackson referred back to Valle’s web searches for Kristen Ponticelli’s address. “There is something incredibly wrong just on that fact with a New York City police officer talking about killing a high-school student and then Googling to try to get information about her address,” Jackson said. “That is a man who is trying to move a plan into action.”

Then he argued the pre-crime case head-on. “Think about your favorite restaurant … If you were to find out that the chef at that restaurant had a deep-seated fantasy of poisoning all of the people in the restaurant, and that night after night he was engaging in conversations with other people about how he could poison the restaurant-goers at his restaurant, that he was researching online the different poisons, that he was communicating with people the names of certain other people who come to his restaurant all the time and saying, ‘I can’t wait to see this person drop dead when they taste this cyanide filling up their throat.’ If you found out about that and he said, ‘Oh, this is just my fantasy,’ would you continue to eat at that restaurant? Of course you wouldn’t.”

On March 12, the jury announced that they’d found Valle guilty. Valle shook his head and was taken away. His mother, who’d been there every day, asked, “What trial were they watching?” And Gatto told reporters, “This was a thought prosecution … The jury couldn’t get past the thoughts.”

At least one member of the jury disagreed. “We did what we did in good conscience,” Victor Pineiro told reporters. “Clearly, we believed his fantasy was going to step into reality … I think like an addict needs a larger and larger dose, he was needing things that were more and more real and he was progressing … He was bringing it into real life.”

Gatto, looking back, has come to think the defense’s big mistake may have been assuming the jury would recognize just how over-the-top implausible these messages were—and not be terrified by them. “It’s the most heartbreaking verdict I can ever imagine,” she says. “You have to buy into the idea that it’s all make-believe. Then it becomes almost comical.” She and her colleagues have petitioned the judge to throw out the verdict, arguing, in part, that the prosecution had turned it into a pre-crime case, scaring the jury with thoughts of what might happen. The judge is expected to decide on the motion imminently. If he upholds the conviction, Valle faces up to life in prison.

The FBI didn’t walk away from the Dark Fetish Network after Valle’s arrest. On January 4, 2013, they arrested Vanhise at his home in Hamilton, New Jersey. The 22-year-old admitted to the police that he had violent sexual fantasies, some even involving children. But his wife, Bolice, defended him as a “big teddy bear” and noted that she’d known about his fetish before they got married. “I was cool with it,” she told reporters. “It’s disturbing, yeah. But you have to accept your partner’s flaws in a marriage … I’m not perfect. He’s not perfect.”

In April, working from information provided by Vanhise, the FBI arrested two more men who had been chatting with one another on DFN: Richard Meltz, a 65-year-old police chief in Bedford, Massachusetts, and Robert Asch, a 61-year-old former librarian at ­Stuyvesant High School who in 2009 had been arrested and accused of inappropriately touching four male students (the charges were later dropped). Unlike Valle, these men’s actions in the physical world were unambiguous: Asch and Meltz had both met with an undercover agent; at a ­meeting, Asch brought with him a bag containing a Taser, meat hammer, skewers, and a dental retractor. Along with Vanhise, they are scheduled to go to trial later this month. “You might say they learned from Gil, and that they needed this person to commit a substantive act,” says Zas. “The only substantive act they had from Gil was a brunch.”

Last spring, Dale Bolinger (a.k.a. Moody Blues) told the Post that all his conversations with Valle were fantasy. “None of this is real,” he said. “I’m an asshole. I’m an idiot … It was my stupidity, because I went and put stupid things online, thinking that it was funny.” He was arrested last November by British authorities working with the FBI. His next court date is in February.

Dietz, for his part, has no problem with monitoring chat rooms on the DFN or elsewhere for possible offenders. “I’m not someone who looks around for wrongful convictions. I don’t want to be an advocate. And I guarantee you that on this same website they can find people you can go after.” The Valle case, in his view, demonstrates what happens when a prosecution takes place without any sense of what does and doesn’t constitute a dangerous mind.

“I find something troubling,” Dietz says, “about the whole world’s failure to recognize that just because someone has a desire doesn’t mean they do it.”