A friend of mine at university had a rule: he didn’t want anything to appear online that might ruin a future political career. On nights out, when photos were being taken, he’d quietly move out of the picture. While we were all wittering away to each other on social media, he kept schtum. Strange, I remember thinking. Why so paranoid?

I thought of my friend when Toby Young started making headlines. After Toby was appointed one of the 14 non-executive members of the Office for Students, he discovered to his cost that his past — preserved as it is online — could be dredged up by those who wanted to sabotage his advancement. The campaign against him worked. The Twitter-storm gathered such strength that it sucked in newspapers and politicians. His old tweets ended up being debated in parliament. The Prime Minister was asked about sentences from articles Toby had written 17 years ago. After eight days of outrage, he resigned.

Just two weeks ago, the fate of Toby Young would have been of interest to Spectator readers, possibly a few free school enthusiasts, but not a great many others. Yet his resignation from an advisory post to an obscure quango led the BBC morning news — ahead of the cabinet reshuffle. It’s baffling: why is everyone, seemingly, talking about a journalist having to leave a minor government body that nobody had heard of?

The answer is that Toby has become just the latest — and perhaps the highest-profile — target of a new phenomenon: the digital inquisition. It is something that anyone wanting to enter public life can — and should — expect. As my university friend knew, if you happen to be ambitious in the internet age, you must be very careful about everything you say or do online.

I need not repeat the litany of Toby’s offending tweets. He said some bad things. He has been deliberately provocative. He deployed what Boris Johnson called his ‘caustic wit’ on occasions where silence would have been wiser. Some will consider him beyond the pale; others will be unable to see what the fuss is about. For now, however, the court of social media has passed judgment, and there is no place harsher or more frenetically outraged.

Sites such as Facebook and Twitter hold vast reserves of information about us, which we have willingly handed over. We have been encouraged to be honest, to share, to joke, often in the name of liberty. Twitter users are scored on how many tweets they have shared with a grateful world. For Labour’s Stella Creasy, it’s 75,700; for Piers Morgan it’s 110,000. For some, using social media is a form of work; for others, an addiction. The rough-and-tumble can be part of the fun: you say something, see how it goes down, or who’ll respond at 1 a.m. Careers have been made on Twitter as well as broken.

In Toby’s case, a selection of tweets and articles, some dating back over a decade, were cobbled together to present him as a sexist bigot. He had left enough explosive material online to blow up his political ambitions. When he tried to delete his tweets, his detractors were ready. They had already saved everything they considered incriminating.

Tweets never grow old or die: words published years ago can be reposted, fresh as the day they were typed. Remarks from one context can be republished in another. Online comments can now define and destroy you. During the Blair era, Alastair Campbell used to say that if you were the story for more than seven days, you had to quit. But in those days newspapers decided how long a scandal lasted: they had readers who would tire easily. In the age of social media, there is all the time in the world. People who feel angry enough about something will spend weeks or months keeping a story alive, if that’s what it takes to scalp the enemy.

Social media companies have tricked us all. They have lured us into thinking we can lower our guard online and talk candidly as if to friends. They have coaxed us into blurring personal and private worlds in the name of free speech. We have been led to think our comments are ephemeral when nothing could be further from the truth. Tweets are dashed off, then forgotten about — only to be discovered years later by anyone with a bone to pick. We live in a confessional age and are encouraged to reveal all our inner thoughts. What’s not encouraged, so much, is to reflect over whether we would be prepared to stand by everything we have said in the future.

When Anthony Scaramucci was appointed Donald Trump’s communications director, he set about deleting any tweets that didn’t align with his new boss’s views. ‘Full transparency: I’m deleting old tweets. Past views evolved & shouldn’t be a distraction. I serve @POTUS agenda & that’s all that matters,’ he wrote. But those who managed to save his deleted tweets were able to show that his comments were anti-gun, pro-gay marriage and concerned about climate change. By way of defence, Scaramucci said that ‘gotcha’ politics is dead. He soon learnt otherwise.

‘Gotcha’ politics has not died. It has evolved. Unedited thoughts have never been easier to publish — or find. For my age group, most of our lives have been captured online. By the time anyone born in the new millennium starts to enter public life, there will be masses of images of them and words by them on the internet.

It’s no surprise that younger people have started to use technology that offers more privacy as the default. Apps such as Snapchat and Telegram use messaging that self-destructs — or at least pretends to. Insta-gram’s ‘story’ feature allows you to publish videos that disappear after 24 hours. If Toby had chosen to use Snapchat to voice his opinions instead of Twitter, he might have avoided losing his job. Then again, far fewer people would have heard his opinions.

Yet even the most tech-savvy youngster will soon discover that it’s hard, sometimes impossible, to leave no trace, to clean up the photos that others took and published online. The word ‘delete’ is often a misnomer. This week Kensington Palace announced that Meghan Markle had closed all her social media accounts. It’s highly unlikely though that there won’t be a record of everything she’s said, somewhere. Mass digitisation means that student newspaper articles from the 1960s are now online and searchable. A BBC editor once arrested because he was part of a hard-left protest group; foul language once used by a Treasury minister — it’s all there if you know what to search for. Or if someone suddenly decides to look.

This digital trail makes it harder for people to grow up or change path. Toby Young has moved from professional provocateur to education reformer, but the internet remembered his past, and made his political reinvention near impossible. One might have dared hope that, in an era when the capacity to snoop is almost limitless, we would learn to be more forgiving of the failings of others. Instead, the mood is ever more nosey and censorious.

One might also hope that the adults in SW1 would not confuse the Twittersphere with the vox populi. But politicians, ever anxious about public opinion, are irresistibly drawn to any indications of what people think. They can’t help trying to find the national mood on social media. Sometimes they take their lead from it, seeking Twitter praise or fearing its censure. This makes Twitter’s relatively small band of loud, regular users the most powerful focus group in the world. Anyone who has spent any time on Twitter will know how frightening that is.

‘Is there anything you ought to tell me?’ Francis Urquhart asks ambitious MPs in the original House of Cards. ‘Anything that, should it come to light, might make me think: “I wish I had known that”?’ That’s a polite way of asking a rude question: is there any dirt? It’s now impossible to answer this question, since no one quite knows which of the hundreds, perhaps thousands of digital ghosts from their past may be summoned.

The advent of social media therefore sets a new bar for anyone wanting to enter public life: the trail you leave online will now be used to judge your character. Is your profile clean enough? If not, forget it. Indiscretions, youthful or otherwise, are now immortal sins. This will delight the bureaucratic class, who find it far easier to beat away outsiders or rebels who aspire to a career in politics. This new state of play will also deter anyone who doesn’t fancy having their life pored over, their reputation trashed.

The internet dream was that the web would create a more open society. It wouldn’t really matter what you said because everyone would feel more liberated. The opposite has happened: increasingly, people are nervous about what they say online for fear of future rebuke. Far from making everyone feel free to speak their minds, the internet has made many of us terrified of self--expression. Toby Young’s tale is an extreme example of something that could happen to anybody.

So my university friend’s paranoia was warranted. Now, if I search for him online, nothing of interest comes up: a few charitable causes he has supported, a glowing LinkedIn profile, a polished Instagram account with not a single photo that could cause trouble — or so he must assume. It is deliberately anodyne: the perfect starting point for a modern political career.

Even the most tech-savvy person will be starting to discover that it's impossible to leave no trace online

Spectator.co.uk/podcast Brendan O’Neill and Dawn Foster on Twitchfork retribution.