Senior UK government officials have investigated what legal action can be taken to stop Dominic Cummings, Boris Johnson’s former chief adviser, from publishing further private information and messages.

But ministers and officials are privately fearful that acting against Cummings could turn him into a “martyr”, or allow him to style himself as “the Edward Snowden of Whitehall”, according to government insiders involved in the discussions.

One senior Downing Street insider said that “this [legal action] is not going to happen”.

Since his acrimonious departure from Downing Street last year, Cummings has published a series of damaging allegations about Johnson’s conduct during the pandemic. The former aide has alleged that the prime minister is unfit for the job.

His decision to publish a series of private WhatsApp messages with the prime minister, including one in which Johnson described the former health secretary Matt Hancock as “totally fucking hopeless”, is unprecedented. Although Downing Street figures initially attacked Cummings for leaking, Number 10 has recently opted not to engage with any allegations.

Four senior Whitehall officials told the Financial Times that the Cabinet Office had examined what action could be taken against Cummings, including whether he had potentially breached his employment contract as a special adviser, the civil service code, General Data Protection Regulation legislation or the Official Secrets Act.

“There were discussions about whether we should write to Cummings to warn him of his legal responsibilities,” one well-placed civil servant said, adding that conversations remained “active”.

Another senior Whitehall official said: “When leaving a government department, everyone gets warned that disclosure of private information would be in breach of law or contract employment.”

The person added: “I don’t think we’re going to tolerate a climate where you can leave government and publish WhatsApps with [the] PM. It sets way too much of a precedent and officials have their eye on it.”

Downing Street declined to comment on personnel matters and the Cabinet Office said “it would be inappropriate to comment on individual staff matters”.

Cummings was approached for comment on whether he had received any communications from the government, if he thought he had broken his employment contract, civil service code or other rules and whether he was in possession of classified information.

The former adviser tweeted the request for comment from the FT but did not respond to the specific questions.

Senior government figures, however, are concerned that targeting Cummings could lead to more revelations. “We could bring the whole force of the state down to bear on him, but where could that lead? There is a strong body of thought that he would like to be in court and could reveal a load more damaging stuff under oath,” one insider said.

Tim Durrant, associate director of the Institute for Government think-tank, said: “As a special adviser, Cummings was subject to a code of conduct which says advisers who leave government must seek permission from the cabinet secretary before publishing any ‘memoirs’ from their time in office.”

One former senior security official said that the Official Secrets Act was the only serious tool the government would have. “The big gun is the Official Secrets Act, where you can end up going to jail. But it mostly fails in court on public interest grounds so it would be unlikely to lead to a conviction while giving him a huge platform.”

The individual added that seeking to challenge Cummings under the civil service code or GDPR would be “like pursuing Al Capone for his tax evasion, it feels slightly ridiculous and it’s not criminal”.

Senior Conservatives are primed for more leaks from Cummings, which have appeared on Twitter and through Substack, where he is charging £10 a month for subscribers to ask him questions. He is thought to have a large tranche of documents and messages from his time in Number 10.

Some senior mandarins believe Cummings is in possession of classified government material, but there is a reluctance to take action against him. One senior Whitehall official called Cummings a “genuine national security risk”, adding: “There’s a risk that we take some sort of action that turns him into a martyr, particularly on the pandemic stuff.”

But a former colleague of Cummings said they did not believe he would publish anything that would endanger national security. “He always operates right to the edge, but he never goes over it. In his mind at least, he will be on legally solid ground, he will have a public interest defence.”

The Conservative party has attempted to reach out to Cummings, with senior figures attempting to broker a truce with the aide earlier this year. But those involved with the discussions said they failed to win him over.

“We asked Dom: what do you want? He responded he wasn’t interested in anything. It seems he is utterly intent on revenge for his ousting,” one party grandee said.