SAJID JAVID belongs to a tribe that is millions-strong in America but vanishingly small in Britain: devotees of the libertarian philosopher-cum-novelist Ayn Rand. Twice a year Mr Javid makes a point of reading the courtroom scene in “The Fountainhead”, in which the hero proclaims that he would rather go to prison than bow down before the will of the crowd. The great theme of Rand’s writings is the ability of heroic individuals to bend the arc of history to their will. Mr Javid will need plenty of the Randian spirit if he is to make a success of his new portfolio.

The home secretary’s immediate task is to contain the panic over the Windrush scandal, in which thousands of Caribbean Britons were misidentified as illegal immigrants. His long-term job is to tackle two festering problems. The first of those is the chronic lack of order in the Home Office. Mr Javid has to “get a grip”, as Tories love to put it. His new department has a justified reputation as the graveyard of government ministers and their agendas. It is a sprawling empire in which thousands of officials administer often contradictory policies that can deprive people of their liberty or their right to stay in the country. The Home Office is currently grappling with the trickiest problem in its recent history: designing a new immigration system for a Brexited Britain, while at the same time dealing with the consequences of Britain’s biggest-ever wave of immigration.

The second festering problem is the public’s lack of faith in Britain’s immigration system. Restoring it will involve striking a delicate balance between compassion and control. Mr Javid needs to reassure those who have been disconcerted by the government’s “hostile environment” policy—not just members of the Windrush generation but also EU nationals and other legal residents—that they have nothing to worry about. But he also needs to reassure the majority of Britons who think that immigration is too high and that illegal migrants represent a serious problem. He got off to a good start, with two feisty appearances in the House of Commons, disowning the noxious phrase “hostile environment”, outlining measures to safeguard Windrush migrants from further injustice and promising them compensation.

These tasks would probably overwhelm even Rand’s hero, Howard Roark. But Mr Javid nevertheless enjoys a couple of important advantages. One is his background. He is the first Muslim to hold one of Britain’s great offices of state. His father arrived in Britain from Pakistan in 1961 with £1 in his pocket and made his living as a bus driver while his mother ran a shop. Mr Javid demonstrated that Labour doesn’t have a monopoly on anger over Windrush by telling the Sunday Telegraph on April 29th (before getting his new job) that “that could be my mum…my dad…my uncle…it could be me.”

His other advantage is his distance from the prime minister. Ms Rudd never really freed herself from her predecessor’s shadow because she took over at the Home Office when Mrs May was in her pomp as prime minister. Mr Javid is taking over at a time when Mrs May is weak—and weak precisely because of policies that she pioneered as home secretary. Mr Javid also has a history of poor relations with his boss. He was one of the most briefed-against ministers when Mrs May was riding high, and one of the most brutal critics of her Downing Street operation after the election debacle. He belongs to a very different Conservative tradition. Mrs May is a 1950s Tory who hankers after a more homogenous Britain. Mr Javid is a 1980s Tory who has a portrait of Margaret Thatcher hanging in his office.

This could be a recipe for a fractious relationship at the heart of government. Mrs May is as proud as she is rigid, and still likes to start her sentences with the phrase: “When I was home secretary”. But it could be a chance to forge a more realistic immigration policy. Mr Javid needs to start by persuading his boss to abandon her fixation with including students in migration figures. He then needs to go on to change the logic of immigration thinking: forget about the arbitrary targets, like reducing net inflows to the tens of thousands, and focus instead on the country’s long-term needs, particularly when it comes to recruiting highly skilled workers, who can boost productivity, and willing hands who can make up labour shortages in the health service, care homes and the building trade. That is what voters tell pollsters they want. Mr Javid’s job is to bring policy in line.

Sajid shrugged

His promotion brings significant problems with it. In his previous job as secretary for local government he spent two years tackling the severe shortage of housing that is putting home ownership beyond the reach of a generation of Britons. His successor, James Brokenshire, will take time to master his brief and get the measure of the vested interests that have run riot in this area. Meanwhile, Mr Javid will significantly shift the balance of power at the top of the government in a Eurosceptic direction, as Ms Rudd’s replacement in the Brexit inner cabinet. Though he supported Remain in the referendum, he did so more to suck up to David Cameron than out of any conviction. He likes the idea of a small-state, light-regulation Britain forging its own Randian future. Brexiteers are crowing about his intervention on May 2nd against Mrs May’s proposed “customs partnership” with the EU.

The Javid package might not sound like an overwhelmingly attractive one. Mrs May is exchanging the likelihood of regression in housing and EU dealmaking for the mere possibility of progress at the Home Office. But she has probably chosen the right man for the urgent job of preventing the Windrush scandal from consuming her government. In fairy tales told by libertarian philosophers, fire-breathing heroes come along and solve humanity’s problems. In Mrs May’s all-too-real world, flawed individuals stagger from crisis to crisis in a desperate attempt to stave off complete disaster.