But just days after Johnson entered Number 10, it was clear that things had taken a completely unpredicted turn.

BuzzFeed News reported at the time: “One of the most crucial developments behind the scenes in the first days of Johnson’s premiership has been the embryonic relationship between Cummings and Mark Sedwill … the two men have got on ‘surprisingly well’ this week, according to those present in their first meetings together. Sedwill has convinced Cummings that he ‘wants to get on board’.”

It’s not just Sedwill’s ability to navigate the conflicting responsibilities built into his job that has drawn concern and criticism from other Whitehall officials. The breadth of his authority extends beyond that of his immediate predecessors because, uniquely, he is not just the Cabinet secretary but also the government’s national security adviser (NSA).

That role was created by David Cameron in 2010 alongside the National Security Council, a Cabinet committee to oversee and assess all matters relating to national security, intelligence, foreign policy, and defence.

When Mark Lyall Grant was briefed out of the NSA job in February 2017, Sedwill was the obvious choice to take over the role. He had a background in diplomacy and defence and had been prime minister Theresa May’s permanent secretary when she was the home secretary.

Following the death of Cabinet secretary Jeremy Heywood a year later, May appointed Sedwill to that position too, on an acting basis at first and later permanently, without a competition.

Critics of Sedwill’s “double hatting” arrangement argue that the roles of Cabinet secretary and NSA, who is secretary to the national security council, need to be separate in order to balance out and work through the cases when politics and national security are at odds, when implementing government policy and national security are in conflict.

As one former official put it to BuzzFeed News: “What happens when there is a clash and the same person is sitting on both sides of the table?” Sedwill has defended the decision to retain both roles by arguing that the national security council, which still exists, and the NSA are recent innovations.

The tension between politics and national security exploded into public view over the debate on Huawei’s role in the development of the UK’s 5G network, when multiple ministers and Conservative MPs opposed the decision to allow the Chinese technology company to operate on critical British infrastructure. Wearing both hats, Sedwill had to both advise the prime minister on the political and economic case for working with Huawei, while at the same time assessing intelligence concerns.

The Huawei episode also provides a striking illustration of Sedwill’s willingness to prove his allegiance to Boris Johnson early on.

The new prime minister wanted to bring former defence secretary Gavin Williamson back into Cabinet. He had been sacked by Theresa May for leaking details of a National Security Council meeting about Huawei, following an investigation led by Sedwill that essentially accused Williamson of disclosing state secrets and then lying about it. Most thought it would be impossible for Johnson to bring Williamson in from the cold and for Sedwill to remain in post.

But in a display of extreme pragmatism, Sedwill did not oppose Johnson welcoming Williamson back into government as education secretary.

A government aide told BuzzFeed News that week: “We now have the most ruthless Cabinet secretary and the most ruthless chief of staff that we’ve had in years. If they can work together, everyone else is fucked.”