The threat of attack, whether by Al-Shabaab, Islamic State or both, hangs over the 2021 elections in Somalia. Prospective electors, delegates and candidates face a difficult choice – take part and hazard the militants’ wrath, or refrain and further undermine the credibility of a vote that already excludes the bulk of Somali society. Eliminating the militant risk is impossible. Yet adjusting security plans to protect voting centres during the vote and in its immediate aftermath, in addition to instituting the right mechanism for resolving electoral disputes, can help shift the balance in favour of participation and limit the damage militants can do. Elections perceived as fair will help cool Somalia’s overheated political climate and create the conditions, under the next government, for security and political reforms that in turn could shrink the space for militants to take advantage of political division.