The UK needs a “whole of society effort” to tackle threats from other countries, an MI5 agent has said.

Director K, a mother who is in her forties, presides over “hostile states counter-intelligence” and oversees the country’s response to the threat of cyber attacks.

She told of the “diverse” threats which could impact “every individual in the UK”, including ransomware attacks, state-backed cyber hackers and electoral interference.

Director K told the Daily Telegraph: “One of the reasons nobody in the media has ever previously interviewed a Director K is we do our work in secret.

“Necessarily – it’s really sensitive work. But one of the reasons I am talking to you now is we need a whole of society effort. It is not a spy film thing.

“This affects everybody. In order to help people understand that we [MI5] need to break open a bit more about what we can see and encourage people to think individually about what they can do.”

She said academia and industry need to understand the threat of “economic espionage” and that MI5 can help them to work out what to do about it.

Director K said she hoped her children would have great opportunities ahead in a tech-confident UK economy, adding: “Then I look at how some hostile states are stealing our IP [intellectual property] for their own advantage and I hope that collectively we can protect that. We need to protect our innovation and our future.”

She also warned companies against selling stakes to certain firms based in hostile foreign states, with MI5 advising against certain deals.

Director K said it was about finding balance and “managing” rather than stopping it because the UK needs investment.

She added: “Where there is a national security threat from foreign investment, that is where we focus our interest. MI5 is able to focus on the harder end of the threat. MI5 should not be – and isn’t – the economic policeman of the UK.”