The man whose state surveillance revelations rocked the world speaks exclusively to the Guardian about his new life and concerns for the future

The world’s most famous whistleblower, Edward Snowden, says he has detected a softening in public hostility towards him in the US over his disclosure of top-secret documents that revealed the extent of the global surveillance programmes run by American and British spy agencies.

In an exclusive two-hour interview in Moscow to mark the publication of his memoirs, Permanent Record, Snowden said dire warnings that his disclosures would cause harm had not come to pass, and even former critics now conceded “we live in a better, freer and safer world” because of his revelations.

In the book, Snowden describes in detail for the first time his background, and what led him to leak details of the secret programmes being run by the US National Security Agency (NSA) and the UK’s secret communication headquarters, GCHQ.

He describes the 18 years since the September 11 attacks as “a litany of American destruction by way of American self-destruction, with the promulgation of secret policies, secret laws, secret courts and secret wars”.

Snowden also said: “The greatest danger still lies ahead, with the refinement of artificial intelligence capabilities, such as facial and pattern recognition.

Watch the Guardian’s exclusive video interview with Edward Snowden.

“An AI-equipped surveillance camera would be not a mere recording device, but could be made into something closer to an automated police officer.”

He is concerned the US and other governments, aided by the big internet companies, are moving towards creating a permanent record of everyone on earth, recording the whole of their daily lives.

While Snowden feels justified in what he did six years ago, he told the Guardian he was reconciled to being in Russia for years to come and was planning for his future on that basis.

He reveals he secretly married his partner, Lindsay Mills, two years ago in a Russian courthouse.

While he would rather be in the US or somewhere like Germany, he is relaxed in Russia, now able to lead a more or less normal daily life. He is less fearful than when he first arrived in 2013, when he felt lonely, isolated and paranoid that he could be targeted in the streets by US agents seeking retribution.

“I was very much a person the most powerful government in the world wanted to go away. They did not care whether I went away to prison. They did not care whether I went away into the ground. They just wanted me gone,” he said.

He has dispensed with the scarves, hats and coats he once used as disguises and now moves freely around the city, riding the metro, visiting art galleries or the ballet, joining friends in cafes and restaurants.

The front page of the Guardian on 7 June 2013

Permanent Record, which is being published on Tuesday in more than 20 countries, charts the shift that took him from working deep inside the NSA and the CIA to Hong Kong, where he handed over a cache of classified documents to journalists from the Guardian.

The documents revealed the scale of mass surveillance by the US, UK and their allies. He is high on the US wanted list and faces decades in jail if detained.

The US government could seize royalties from the book but the substantial advance has already been banked.

Normally averse to discussing his personal life, Snowden opened up in both the interview and the memoirs to speak for the first time about his life in Moscow and even the person he describes as “the love of my life”, Mills.

Polls taken in the US in 2013 and the years immediately after showed an almost equal split between those who viewed him as a traitor and those who saw him as a hero.

“It is funny that now, six years later, the controversial image that I had has begun to soften.”

Even people who dislike him personally were now prepared to accept “we live in a better, freer and safer world because of the revelations of mass surveillance”, he said.

One of the Democratic presidential candidates, Bernie Sanders, said he would like to see a resolution that would end Snowden’s permanent exile, while another, the congresswoman Tulsi Gabbard, said in May she would pardon him.

Fears that President Vladimir Putin might hand him over as a gift to Donald Trump have receded as relations between the US and Russia have cooled.

Snowden said it helped that Russia viewed him as useful publicity.

“A country whose political troubles are legendary, whose problems with human rights we hear about every single day has finally, somehow, managed to have one bright spot on their human rights record … Why would they give that up?”

He toyed with calling his memoirs The New Forever or Welcome to Forever before settling on Permanent Record, which reflects his concerns about the way state-run and private companies are hoarding data.

We have moved to a society in which we are forced to live our lives naked before power.

To counter this, he argues for both legislative reform and increased use of end-to-end encryption to protect emails, chat and other communications. But these are not enough, he says, to counter accelerating technological changes allowing greater intrusions of privacy and he calls for a worldwide protest movement, similar to those on climate change.

“You have to be ready to stand for something if you want it to change,” he said. “That is what I hope this book will help people come to decide for themselves.”

Snowden, 36, lives in a two-bedroom flat on the outskirts of Moscow and makes a living mainly from fees for speaking to students, civil rights activists and others abroad via video link-ups.

He was given temporary asylum when he first arrived and now has permanent residency, the equivalent of a US green card, renewable every three years, though he said this was just a formality.

He had been on his way from Hong Kong via Russia and Cuba to what he hoped would be sanctuary in Ecuador when the US cancelled his passport, leaving him stranded in Russia.

He likes to travel, in spite of being restricted to within Russia’s borders, and has visited cities such as St Petersburg and the Black Sea resort of Sochi.

“One of the things that is lost in all the problematic politics of the Russian government is the fact this is one of the most beautiful countries in the world. The people are friendly. The people are warm,” he said. “And when I came here I did not understand any of this. I was terrified of this place because, of course, they were the great fortress of the enemy, which is the way a CIA agent looks at Russia.”

In the past, he would not have openly spoken so warmly about Russia, worried about how it might be perceived back home in the US.

We met in a flat – not his – on Tsvetnoy Boulevard, near the city centre. A minute’s walk to the left of the flat there is a Starbucks and to the right a Krispy Kreme. Snowden, who loves fast food, said one of the things Americans did not realise about Russia was that almost all the things you could get in the US were available there, apart from, he added wistfully, a Taco Bell.

Throughout history, exile meant being cut off from society, “a punishment worse than death”. But exile did not mean that any more, he said. He could communicate with students in New York via video and three hours later do a similar event in Germany.

Describing himself as “an indoor cat by choice”, he is happiest sitting at his computer late into the night, communicating with campaigners and supporters. The time difference with the US has made that a necessity. The night before we met he had only gone to bed at 6am. His normal pattern is to sleep until late in the morning.

In Permanent Record, he describes how he and Mills met when he was 22 on an internet site, Hot or Not, on which pictures were posted and rated. He gave her a 10 out of 10. She gave him an eight.

Seven years later, as he prepared to fly to Hong Kong, he said he did not tell her about his plans to turn whistleblower as this would have made her an accessory. He feels bad she did not know where he had gone.

One of the surprises in Permanent Record is the inclusion of extracts from her diary. These are blunt and raw, recording how “pissed” she was at his sudden disappearance, even wondering whether he was having an affair.

When the police and FBI were first looking for him, one police officer was suspicious of her. She wrote: “He was looking at me like I killed Ed. He was looking around the house for his body.”

When she turned up on Snowden’s doorstep in Moscow, he was braced for a slap but instead she told him she loved him and supported his decision to turn whistleblower.

You have to be ready to stand for something if you want it to change.

In the memoirs, he writes about his childhood and teenage obsession with computers and games, such as Legend of Zelda and Super Mario Bros. As a teenager, he hacked into a nuclear facility and reported its vulnerabilities to the authorities. An official from the Los Alamos nuclear lab, where the atom bomb was created, phoned his mother to thank him.

Permanent Record offers one of the most detailed accounts of what it is like to work inside an intelligence agency in the 21st century. “There are no James Bonds.” He discloses that the NSA increasingly used contractors – he was one for much of the time – rather than employ permanent staff.

At a training school for spies, tutors nicknamed him “the Count”, which he is quick to say sounds exotic but was actually because his mannerisms reminded tutors of a Sesame Street character.

There was no pivotal moment when he decided to turn whistleblower. He attended, by chance, a conference on the scale of Chinese surveillance of its own citizens. That created a nagging thought that if China was doing it then so too might the US. He searched and found confirmation.

The 2016 Oliver Stone movie, Snowden, portrayed him as sneaking the documents out of the NSA by hiding an SD card, about the size of a small stamp, on a Rubik’s Cube. Snowden neither confirms or denies it, knowing one day he may yet face prosecution. “A Rubik’s Cube can be very useful and functions as a distraction device and also functions as a concealment device.”

He recalled how his plans almost came unstuck near the end. He had secretly hoarded documents on an abandoned computer, and was moving it. “So I got stopped in the hallway as I’m taking this old machine back and a supervisor says: ‘What are you doing with this machine?’ And I look at him frankly and I say: ‘Stealing secrets.’” They both laughed. But that was exactly what he was doing.

• Permanent Record is published by Macmillan (£20). To order a copy go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99.