According to the Sunday Times, Moscow and Beijing have deciphered documents stolen by whistleblower Edward Snowden.
The government source told the BBC the countries “have information” that led to agents being moved but added there was “no evidence” any had been harmed.
Mr Snowden leaked data two years ago. The former CIA contractor, now living in Russia, left the US in 2013 after leaking details of extensive internet and phone surveillance by American intelligence to the media.
His information made international headlines in June 2013 when the Guardian newspaper reported that the US National Security Agency was collecting the telephone records of tens of millions of Americans.
Mr Snowden is believed to have downloaded 1.7 million secret documents before he left the US.
The government source said the information obtained by Russia and China meant that “knowledge of how we operate” had stopped the UK getting “vital information”.
BBC political correspondent Chris Mason said the problem for UK authorities was not only the direct consequence that agents had been moved, but also the opportunity cost of those agents no longer being in locations where they were doing useful work.
Intelligence officials have long warned of what they see as the dangers of the information leaked by Mr Snowden and its potential impact on keeping people in the UK safe – a concern Prime Minister David Cameron has said he shares.
According to the Sunday Times, Western intelligence agencies have been forced to pull agents out of “hostile countries” after “Moscow gained access to more than one million classified files” held by Mr Snowden.
“Senior government sources confirmed that China had also cracked the encrypted documents, which contain details of secret intelligence techniques and information that could allow British and American spies to be identified,” the newspaper added.