Downing Street attempted to withhold sensitive intelligence from Boris Johnson when he became foreign secretary, the BBC has learned.
It is understood Theresa May and some in the intelligence community had worries about Mr Johnson's ability to keep information confidential.
Sources close to Mr Johnson said he had access to everything he needed to see. Asked whether information had ever been held back from him, the Tory leadership frontrunner said this was "not true".
Pressed about the matter at a Conservative leadership hustings in Darlington, Mr Johnson said he would not comment further on national security issues but he was "extremely dubious about the provenance" of the reports.
His leadership rival and current Foreign Secretary Jeremy Hunt also refused to comment, telling the hustings: "We have the finest intelligence services in the world in this country, but that does depend on some discretion by the foreign secretary."
A Number 10 spokesperson said it did not comment on intelligence matters, but that Mrs May trusted Mr Johnson in the role.
They said: "It's a matter of fact it was the PM's own decision to appoint Boris Johnson as foreign secretary, in full knowledge of all the responsibilities that that job involves."
On 20 October 2016, Mr Johnson paid his first visit as foreign secretary to MI6's headquarters at Vauxhall Cross in London.
After he was shown around by Alex Younger, the chief of MI6, Mr Johnson addressed staff and held an informal question and answer session.
"I was delighted to welcome the foreign secretary to our Vauxhall Cross headquarters so he could see first-hand the kind of work that MI6 does," the chief, known as "C", said at the time.
Mr Johnson was effusive in his praise.
"Even from my relatively short period as foreign secretary I can testify to how vital the work they do is," he said.
But behind the scenes a row had been taking place about whether Mr Johnson would have access to all the intelligence produced by the UK's spies, according to a number of sources, who spoke anonymously because of the sensitivity of the subject.
The prime minister has overall responsibility for intelligence and security matters, but day-to-day ministerial responsibility and accountability for MI6 and GCHQ sit with the foreign secretary.
However, Number 10 did not want Mr Johnson to be shown a category of sensitive secret intelligence after he was appointed in July 2016, according to multiple sources with direct knowledge of events, none of whom is involved in the leadership campaign or politics.
One person said Mr Johnson was aware of the decision at the time and was "very unhappy".
One individual aware of events at the time attributed the attempt primarily to "control freakery" by Number 10, rather than a lack of trust in Mr Johnson's ability to keep secrets.
Others have told the BBC it was a "combination of everyone's faults", citing nervousness over Mr Johnson's lack of discipline and hostility between him and Mrs May.
The move may also have reflected an institutional shift in which Number 10 has increasingly taken central control of national security, including intelligence.
The prime minister and security officials around her have the ability to designate who is allowed to read certain parts of the most classified intelligence.
Lists of who receives intelligence are occasionally "pruned" to ensure security is maintained by limiting the numbers with access.
But one individual with knowledge of events says that while they were aware of junior Foreign Office ministers previously not being shown certain specific streams of intelligence, it would be "unprecedented" if this was to apply to the foreign secretary.
It is not clear if Mr Hunt, on being appointed foreign secretary in July 2018, was provided complete access and a Foreign Office spokesperson said it did not comment on intelligence matters.
Senior intelligence officials were concerned by the decision at the time, the BBC understands.
One source says they took legal advice as to whether they could sustain a position in which the foreign secretary was responsible for operations for which he was not shown the intelligence "product".
This is because the foreign secretary signs authorisations for intelligence-gathering operations. They do this by judging the proportionality of an operation based on balancing the risks and rewards.
But this, it was feared, would be hard to do without having access to the intelligence that was produced.
In the end a compromise was agreed in which Mr Johnson would technically have the right to see intelligence although it is not clear if he was shown all intelligence as a matter of course, one source said.