The home secretary, Amber Rudd, risks radicalising impressionable minds if she pursues her plan to impose 15-year prison sentences on people who view terrorist content online, a former head of counter-terrorism at the Foreign Office has warned.

Britain’s overpopulated prisons have proved a “breeding ground for terror”, according to Sir Ivor Roberts, who also suggested that the proposal would be ruinously expensive for the Treasury.

Writing on guardian.com, the former official said it would cost £600,000 per inmate given the full sentence, and that the government should be focusing its efforts on forcing online hosts, such as Facebook and Twitter, to remove dangerous content.

“Our prisons are brimful and can be a breeding ground for terror, which few would dispute,” Roberts wrote. “In fact, jailing impressionable but unconverted viewers of terrorist content could hasten their radicalisation by introducing them in a confined environment to more committed, and potentially persuasive, extremists.”

Following the UK terror attacks, Rudd has proposed expanding the existing counter-terrorism offence of possessing information likely to be useful to a terrorist to include material that is viewed repeatedly or streamed online. Currently, the power applies only to online material that has been downloaded and stored on the offender’s computer, or is printed.

However, with two-thirds of prisons overcrowded, plus a penal system plagued by “budget cuts and understaffing”, there are grave risks to the home secretary’s proposal, Roberts said. A taskforce was created in April this year to address the challenge of radicalisation in prisons.

The former ambassador to Ireland, Italy and Yugoslavia, who now sits on the advisory board of the Counter Extremism Project (CEP), a thinktank, said ministers should force tech companies to fulfil their responsibilities.

If tech companies can detect who is viewing this content … we should first and foremost focus on removing it

A YouTube search carried out by CEP in late August delivered more than 70,000 results for the well-known Isis propagandist Anwar al-Awlaki, “including his most incendiary lectures urging Muslims to embrace violence”.

A Home Office analysis shows that since 1 September 2016, Isis supporters have published almost 67,000 tweets in English, promoting online links to their propaganda on a range of platforms. English speakers are second only to Arabic speakers as the most important audience for supporters of Isis.

Roberts said: “Options must be assessed, and the risk of incarceration may well deter some from seeking terrorist content online. But the starting point should be to prevent access to such material in the first place.

“If tech companies and other platforms – or even the state – can detect who is viewing this content, then surely, we should first and foremost focus on removing it. A second step would be to require Facebook, Google, Microsoft and Twitter, as well as smaller online platforms, to employ technology and human monitors in sufficient numbers to quickly remove illegal content.”

He added: “Before jailing individuals, who can all too easily find and view terrorist content online at present, we should compel tech companies to implement strong, targeted and transparent policies for removing extremist and terrorist content so that people such as Awlaki cannot continue to stoke hatred and violence, even in death.”