General Bipin Rawat, India’s army chief, is finishing a visit to Nepal and heads today to an unquiet eastern front, to finalise a joint-defence agreement with Bangladesh. It will address a trio of India’s security concerns. Bangladesh is again becoming a haven for insurgents fighting in India’s north-east; illegal immigrants are changing the ethnic character of Indian border areas; and the country’s secular, tolerant traditions are giving way to Islamist extremism. For Sheikh Hasina, the Bangladeshi prime minister whose choking of political competition has fuelled domestic unrest, engaging India has always been a gamble. Popular anti-India sentiment runs high, and her army has been trained to stand up to India, not co-operate with it. And she is already courting China, Bangladesh’s main supplier of arms, which just coughed up $25bn-worth of loans and submarines. However, lacking democratic legitimacy—the 2014 poll that elected her was a sham—a closer embrace of her main foreign backer may be her only choice.