OLYMPIA — Exercises that simulate a hacking attempt. Assistance from the U.S. Department of Homeland Security, with higher-level security clearances for top state officials. A Washington National Guard contingent ramping up to go on alert.

In years past, you might have mistaken these preparations as defense against a foreign invasion.

But in Washington, in 2018, this is what officials are doing to safeguard the state’s elections systems.

Roughly a year after Russia’s interference in the 2016 presidential elections, federal officials announced Russian hackers had targeted the election systems of at least 21 states, including Washington.

In Washington’s case, hackers scanned voter-registration systems looking for weak spots. No breach was made.

But now Washington officials face a landscape of threats as they prepare for the Aug. 7 primary and Nov. 6 General Election — and what will likely be a divisive 2020 presidential election.

The efforts come as states across the nation work to shore up their voter-registration rolls, vote-tabulation systems and election procedures.

Washington is widely considered to have one of the more secure elections systems, in part because its mail-in balloting means the state has a paper record for almost every vote cast. Those ballots can always be recounted, if any question emerges.

Still, national experts agree Washington has some spots that could be compromised by hackers, such as votes returned by email from members in the military, and a voter-registration system run by the state Department of Licensing that recently ran into trouble.

The Washington Secretary of State’s office, which oversees elections, has ramped up its efforts to deal with interference by foreign nations and criminal hackers.

Secretary of State Kim Wyman has teamed up with the U.S. Department of Homeland Security and is pushing for more resources for her office and the counties, which administer elections, to beef up their information-technology capabilities and training.

Federal and state officials say hackers aren’t targeting Washington at this moment, but that could change as this year’s elections approach, as well as the next presidential election.

The threat isn’t just about keeping elections secure, Wyman said. It’s also about keeping voters’ faith in their democracy.

“The frightening thing for me is that there are those that are trying to undermine democracy at its foundation,” said Wyman. “That if they can cast doubt on the outcome of an election, people start to lose confidence in our election system.”

Wyman’s office is expected to soon sign an agreement to allow Washington Air National Guard cybersecurity experts to help with anti-hacking efforts. The arrangement, the first of its kind in Washington, is expected to be finalized this month.

Col. Gent Welsh, commander of the Washington Air National Guard’s 194th Wing, says his people will bring in an added layer of expertise to look at the system before November’s general election.

The units involved come from what Welsh described as “probably nation-leading cyber squadrons” that have worked with the U.S. Department of Defense.

The group will consist of about a dozen people, including guard members who in their day jobs work at Microsoft, Amazon or security companies, he said.

“If you’ve got a military-grade adversary,” said Welsh, “it makes sense to bring in military-grade assets.”