Two years ago, Rob Silvers arrived at a nondescript federal building in the Virginia suburbs of Washington on election day, afraid America was about to be hit by a catastrophic cyberattack.

An alleged Russian operation to hack Democratic emails and peddle divisive disinformation was months in the making; election systems across the country had been probed by suspected Russian hackers; and one state—Illinois—had seen its voter registration database breached.

“There...