By the end of 2008, according to one document, the British spy agency, known as GCHQ, had set up its "first operational deployment into Second Life" and had helped the police in London in cracking down on a crime ring that had moved into virtual worlds to sell stolen credit card information. The British spies running the effort, which was code-named Operation Galician, were aided by an informer using a digital avatar "who helpfully volunteered information on the target group's latest activities."
Though the games might appear to be unregulated digital bazaars, the companies running them reserve the right to police the communications of players and store the chat dialogues in servers that can be searched later. The transactions conducted with the virtual money common in the games, used in World of Warcraft to buy weapons and potions to slay monsters, are also monitored by the companies to prevent illicit financial dealings.
In the 2008 N.S.A. document, titled "Exploiting Terrorist Use of Games & Virtual Environments," the agency said that "terrorist target selectors" — which could be a computer's Internet Protocol address or an email account — "have been found associated with Xbox Live, Second Life, World of Warcraft" and other games. But that document does not present evidence that terrorists were participating in the games.
(Read more: NSA leaker Snowden lands job at Russian website)
Still, the intelligence agencies found other benefits in infiltrating these online worlds. According to the minutes of a January 2009 meeting, GCHQ's "network gaming exploitation team" had identified engineers, embassy drivers, scientists and other foreign intelligence operatives to be World of Warcraft players — potential targets for recruitment as agents.
At Menwith Hill, a Royal Air Force base in the Yorkshire countryside that the N.S.A. has long used as an outpost to intercept global communications, American and British intelligence operatives started an effort in 2008 to begin collecting data from World of Warcraft.
One N.S.A. document said that the World of Warcraft monitoring "continues to uncover potential Sigint value by identifying accounts, characters and guilds related to Islamic extremist groups, nuclear proliferation and arms dealing." In other words, targets of interest appeared to be playing the fantasy game, though the document does not indicate that they were doing so for any nefarious purposes. A British document from later that year said that GCHQ had "successfully been able to get the discussions between different game players on Xbox Live."
By 2009, the collection was extensive. One document says that while GCHQ was testing its ability to spy on Second Life in real time, British intelligence officers vacuumed up three days' worth of Second Life chat, instant message and financial transaction data, totaling 176,677 lines of data, which included the content of the communications.
(Read more: Is a Snowden effect stalking US telecom sales?)
For their part, players have openly worried that the N.S.A. might be watching them.
In one World of Warcraft discussion thread, begun just days after the first Snowden revelations appeared in the news media in June, a human death knight with the user name "Crrassus" asked whether the N.S.A. might be reading game chat logs.
"If they ever read these forums," wrote a goblin priest with the user name "Diaya," "they would realize they were wasting" their time.
Even before the American government began spying in virtual worlds, the Pentagon had identified the potential intelligence value of video games. The Pentagon's Special Operations Command in 2006 and 2007 worked with several foreign companies — including an obscure digital media business based in Prague — to build games that could be downloaded to mobile phones, according to people involved in the effort. They said the games, which were not identified as creations of the Pentagon, were then used as vehicles for intelligence agencies to collect information about the users.
Eager to cash in on the government's growing interest in virtual worlds, several large private contractors have spent years pitching their services to American intelligence agencies. In one 66-page document from 2007, part of the cache released by Mr. Snowden, the contracting giant SAIC promoted its ability to support "intelligence collection in the game space," and warned that online games could be used by militant groups to recruit followers and could provide "terrorist organizations with a powerful platform to reach core target audiences."
(Read more: Google calls NSA surveillance outrageous)
It is unclear whether SAIC received a contract based on this proposal, but one former SAIC employee said that the company at one point had a lucrative contract with the C.I.A. for work that included monitoring the Internet for militant activity. An SAIC spokeswoman declined to comment.
In spring 2009, academics and defense contractors gathered at the Marriott at Washington Dulles International Airport to present proposals for a government study about how players' behavior in a game like World of Warcraft might be linked to their real-world identities. "We were told it was highly likely that persons of interest were using virtual spaces to communicate or coordinate," said Dmitri Williams, a professor at the University of Southern California who received grant money as part of the program.
After the conference, both SAIC and Lockheed Martin won contracts worth several million dollars, administered by an office within the intelligence community that finances research projects.
It is not clear how useful such research might be. A group at the Palo Alto Research Center, for example, produced a government-funded study of World of Warcraft that found "younger players and male players preferring competitive, hack-and-slash activities, and older and female players preferring noncombat activities," such as exploring the virtual world. A group from the nonprofit SRI International, meanwhile, found that players under age 18 often used all capital letters both in chat messages and in their avatar names.
Those involved in the project were told little by their government patrons. According to Nick Yee, a Palo Alto researcher who worked on the effort, "We were specifically asked not to speculate on the government's motivations and goals."