U.S. Cyber Command and the National Security Agency have taken recent actions to ensure that foreign actors do not interfere in the 2020 election, including an operation in the past two weeks against Iran, U.S. officials said.

The move against Iranian hackers working for the Islamic Revolutionary Guard Corps came shortly after they launched an operation two weeks ago posing as a far-right group to send threatening emails to American voters and also posted a video aimed at driving down confidence in the voting process, said the officials, who spoke on the condition of anonymity because of the operation’s sensitivity.

Gen. Paul Nakasone, who leads both the NSA and the military’s cyber command, did not address any specific operation Tuesday but said in an interview with reporters that he was “very confident in actions” taken against adversaries “over the past several weeks and the past several months to make sure that they’re not going to interfere in our elections.”

Nakasone said the NSA had been watching the Iranians for a while and was not caught off guard by their gambit. “We had a very, very good bead on what a number of actors were trying to do,” he said. “We provided early warning and followed [them very closely]. We weren’t surprised by their actions.”

Director of National Intelligence John Ratcliffe held a news conference within 27 hours of the emails being sent and blamed Iran for the operation — the fastest such public attribution in U.S. history.

That news conference and Nakasone’s on-the-record interview Tuesday, along with periodic briefings given by senior Department of Homeland Security officials on Election Day, reflect a determination by the government to be as transparent with the public as possible about how it is securing the election and the threats it is seeing, officials said.

The idea, officials said, is that such transparency will both educate voters and give them confidence in the election’s integrity — a top priority in a year rife with political dissension and four years after Russia interfered in the 2016 U.S. election.

Nakasone stressed that the agencies’ work began after the 2018 midterms and will continue for weeks after Election Day, until the votes are certified. “This is just the start,” he said in the call with reporters Tuesday. “We’ll be ready for the days to come.”

Nakasone noted that the level of foreign targeting of the U.S. election was lower than that of two years ago. “I just don’t see the levels that we had seen” in 2018, he said. There also are more foreign actors with the capability and intent to influence U.S. elections, “so we have broadened our partnerships and our operations.”

Another major difference from the midterms, he said, is the degree of coordination among U.S. agencies and between those agencies and social media companies, private-sector firms, academia, the National Guard and foreign partners. All of that, he said, has made the elections more secure against foreign interference.

Nakasone said the NSA and Cybercom were on the lookout for signs that Russia, in particular, was seeking to reprise a play from 2016, when it hacked and leaked Democratic emails, disrupting the party’s convention and undermining its nominee, Hillary Clinton.

“We have obviously looked to impede what they’re trying to do,” he said.

Nakasone said he does not necessarily view military cyber operations as a deterrent.

“I look at it more as, are we imposing a degree of cost that’s making it more difficult [for foreign adversaries] to do their operations? And I’m seeing that,” he said. “I think that’s an important piece — that we’ve got to look at this in the spectrum of broader competition” between great powers.

Nakasone said a close or contested vote could provide an opportunity for mischief, but he declined to say which country would seek to exploit any post-election discord.

“There’s a number of adversaries that could take advantage of any type of disputed vote or any type of call in terms of who may be declared a victor in a state,” he said.

It doesn’t matter who it is, he added. “We’re going to take action,” he said, “against anyone that threatens our democratic processes.”