The morning of June 9, 2013, was surreal for the writers of “Person of Interest,” the science-fictional CBS drama about government surveillance. Sixteen months earlier, they had written an episode about an N.S.A. whistle-blower—a fresh-faced, thirty-three-year-old analyst named Henry Peck. When Peck discovers that his agency is conducting “illegal surveillance on a massive scale,” he sets up a meeting with a journalist, and soon finds himself evading a squad of government assassins. (“Our own government has been spying on us,” he says, “and they’re trying to kill me to cover it up!”) The episode, called “No Good Deed,” had aired in May, 2012.

Now, more than a year later, it turned out that there was a real N.S.A. whistle-blower: Edward Snowden. Like the fictional Peck, Snowden had a youthful face, a swoop of brown hair, and an idealistic streak that seemed at odds with his job at a spy agency. “We all came into work having read the Guardian article,” Amanda Segel, a writer and co-executive producer, recalled, “and we realized we had actually done an episode that mirrored this very real story in Season 1.” The writers spent the morning adjusting to the idea that their “grounded sci-fi” show had somehow become, as Segel put it, “more real.”

In the Guardian article, Snowden said that he couldn’t, in good conscience, “allow the U.S. government to destroy privacy, internet freedom, and basic liberties for people around the world with this massive surveillance machine they’re secretly building.” Since its première, in 2011, “Person of Interest” (which airs on Tuesdays at 10 P.M.) has taken the idea of a surveillance machine literally: in the world of the show, the government has built a vast, artificially intelligent computer system called the Machine, which reads every e-mail, listens to every phone call, and watches every CCTV camera. Flawlessly, and without human intervention, the Machine provides the N.S.A. and the C.I.A. with the identities of terrorist plotters around the world. But because it sees everything—it reads the e-mails not only of terrorists but also of regular citizens—the Machine can predict when ordinary people are planning violent crimes. The government ignores these predictions, and it falls to Harold Finch (Michael Emerson), the reclusive computer genius who invented the Machine, to respond. In partnership with a former Special Operations soldier named John Reese (Jim Caviezel), Finch leads a vigilante team of hackers, cops, and former Special Ops personnel to stop the crimes before they happen.

The show’s cleverest twist is the Machine’s off-kilter respect for civil liberties. Programmed never to divulge personal information about its surveillance targets, the Machine dispenses only their Social Security numbers. (The show’s creators got the idea from the book “The Watchers,” a history of N.S.A. surveillance by the journalist Shane Harris, which describes how John Poindexter, the head of the Total Information Awareness program, envisioned a Machine-like system equipped with a module that would hide the identities of surveillees from intelligence analysts, representing them only with numerical codes.) Thanks to the Machine’s probity, it’s unclear at the beginning of most episodes whether the person of the week is “the victim” or “the perpetrator”; all we know is that he or she is about to be involved in something bad. As a result, everyone must be equally surveilled. Much of the show’s energy derives from this ambiguous setup. Even as you root for the heroes, you’re unsettled by the surveillance society that they represent. (They’re unsettled, too. “We probably shouldn’t have built it,” Finch admits, allowing that the Machine might be a “beautiful” but “terrible” invention.) In many ways, “Person of Interest” is a show about atonement.

Ten years ago, “Person of Interest” would have seemed fanciful, an atmospheric, imaginative mashup of “Minority Report,” “Sneakers,” and “Batman.” Today, it feels like a glimpse of the future—or, worse, the present. Because the show luxuriates in the minutiae of high-tech surveillance, many of its actors have a heightened awareness of the ways in which we can be tracked, hacked, watched, profiled, investigated, and bugged. “ ‘Paranoid’ is probably the word I’d use,” the actress Amy Acker, who plays a hyperintelligent hacker named Root, said. (On a UNIX computer system, the “root” account is the most powerful.) “As soon as I get to New York,” she said, “I start looking around to see which cameras are watching.” On a break between scenes at the Williamsburg Bank Building, in Brooklyn, Michael Emerson pointed out a surveillance camera—a real one—mounted in a corner of the vaulted interior. “I doubt there’s a single point in this building that’s unobservable,” he said. (Most episodes of “Person of Interest” cut back and forth between regular footage and surveillance video, and some of the action is seen from what the script calls “MPOV”—the Machine’s point of view.) “I think about everything through the lens of ‘Person of Interest,’ ” Emerson continued. “I’ll notice if somebody leaves their cell phone on the bar when they go to the rest room, and I’ll think, You shouldn’t do that. You can be Bluejacked.” (The technical term is Bluesnarfed.) “Then I’ll think, Stop being so paranoid about that—that only happens on ‘Person of Interest.’ And then I’ll think, But maybe not!”

The Snowden disclosures, Emerson said, changed the way that he approached the show. “I don’t have to be in charge of selling this concept—this ‘fictional’ concept—to anyone anymore…. It ain’t fiction, never was, and everyone knows it now.” Finch’s “choices and sensibilities,” he said, had been “confirmed” by real life. At the same time, working on the show had changed his sense of what’s alarming about the N.S.A.: his focus had shifted from privacy to prediction. “In an abstract, data-driven way,” he said, “Finch knows the likelihood of certain behaviors. The chances that events will happen. What characteristics can be attributed to certain kinds of people.”

In some of the best MPOV sequences in “Person of Interest,” we see images of characters overlaid with predictions about what they will do. The Machine weighs factors like “motivation” and “predisposition”; when it watches surveillance footage, it superimposes a red-and-white targeting reticule over the faces of people whom it deems threatening. (The legal scholar Jeffrey Rosen, in his book “The Naked Crowd,” warns about the dangers of surveillance-generated “risk profiles,” which “ensure that different groups of individuals are treated differently in the future based on their behavior in the past.”)