A space rock several hundred metres across is heading towards our planet and the last-ditch attempt to avert a disaster – an untested mission to deflect it – fails. This fictional scene of films and novels could well be a reality one day. But what can space agencies do to ensure it works?