Political interventions about social media are like films based on video games: they don't have a very good track record. Later today Theresa May will test that theory with a speech about how we are all horrible to one another online. There is little reason to believe it'll be any different.

Speaking at the centenary of women winning the right to vote, the prime minister will warn that politics is being coarsened by "bitterness and aggression" and demand new transparency standards for social media firms, presumably in a new 'social media code of practice' she plans to introduce.

The problem with the prime minister's ideas are not that they are unworkable, although they are, nor that they are insufficiently thought through, although they are that as well. It is that she herself has been responsible for no small portion of the degraded political debate in this country. She didn't harass women online, or go through their Twitter archive to find things to abuse them with. But she actively stoked the tribalism and malice at the heart of the online culture she claims to disdain.

It began with her first conference speech after the referendum. It was a speech which defined her approach to governance. "If you believe you are a citizen of the world, you are a citizen of nowhere," she said. "You don't understand what citizenship means."

Her supporters – there are still some left – say this was not meant to categorise all Remainers as potential traitors. Maybe, maybe not. But even as an attack on those who consider themselves citizens of the world, it was despicable.

In truth, it was a bigger point than all that. It was an attack on anyone with a mixed identity, who could hold two ideas in their head at the same time. It was an attack on the supposedly rootless cosmopolitans, or the liberal elitists, or whatever other bogeyman she and her pound-shop Rasputin, Nick Timothy, or her pound-shop Yoda, David Goodhart, had dreamed up. It symbolised the great Ukipisation of No.10, the rejection of moderate government in the name of a right-wing identity politics in which the imagined victimhood of the dominant group is relentlessly promoted.

That attitude was then weaponised into a general day-to-day political struggle. May didn’t raise a peep when the press demanded she "crush the saboteurs", or when they branded judges "enemies of the people", or when the governor of the Bank of England was called an "enemy of Brexit".

Instead, she thought this method of political communication was so effective it could win her a stronger majority. When she announced the snap general election, she targeted Labour, the Lib Dems and the Lords in turn.

"There should be unity here in Westminster, but instead there is division. I am not prepared to let them endanger the security of millions of working people across the country. Because what they are doing jeopardises the work we must do to prepare for Brexit at home and it weakens the government's negotiating position in Europe."

The message was clear. The opposition was not supposed to oppose. It was conspiring to undermine the national interest and the will of the people. In a tense moment of national division, May aggressively pursued the most reactionary element of one side of the debate. Then she encouraged the worst kind of paranoid accusations about the other side, framed around innuendo about national betrayal. It was one of the most irresponsible starts to a general election the country had ever seen.

She followed through. Halfway through the campaign she accused the EU of leaking details to the press in a manner that was "deliberately timed to affect the result" of the election. Some EU counterparts "do not want Britain to prosper", she added menacingly.

Europe had the good judgement to largely ignore her. But it was a telling moment. Her reaction to political embarrassment was to invent nonsense stories about foreign leaders trying to subvert British democracy. She treated long-time allies of the UK as adversaries.

The prime minister's rhetoric was about enemies everywhere – plotting against Britain abroad, undermining her at home. These enemies were implicitly made up of the 'citizens of nowhere', those massed ranks of 'other' who ultimately did not have loyalty to this country.

The election failed and a chastened May has not since had the courage to attempt that level of political rhetoric again. But it is not because she has changed. It is because she cannot. Had she won that election with the majority we expected, there'd have been much more where that came from.

Instead, it continues from other parts of the Brexit lobby. Last week, Jacob Rees-Mogg accused officials in the Treasury of inventing economic forecast models to secure their desired outcome. Essentially, he was accusing civil servants of trying to undermine the policy of the elected government. That accusation was given additional weight by Brexit minister Steve Baker. And then it was pointedly allowed to stand by Downing Street, which said it had "no reason to doubt Mr Baker's account of events". They were hanging civil servants out to dry.

These sorts of shenanigans may seem far removed from abuse and nastiness on social media, but they have the same social and psychological underpinnings: the strict policing of tribal allegiance, the insistence that your opponent has the worst possible motives at all times, and the accusation of treason and betrayal for disagreement.

These are the core emotional components of social media hate mobs and they remain central to how May has gone about the business of government. For her to now portray herself as the answer suggests a staggering absence of self-awareness.

Ian Dunt is editor of Politics.co.uk and the author of Brexit: What The Hell Happens Now?

The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.