The U.S. National Security Agency (NSA) saw Russian hacking and dumping of information on French presidential candidate Emmanuel Macron’s campaign and warned the French government about the activity, the agency’s director and commander of U.S. Cyber Command said May 9.

“If you take a look at the French elections for example…we had become aware of Russian activity. We had talked to our French counterparts prior to the public announcements of the events that were publicly attributed this past weekend and gave them a heads up. ‘Look, we’re watching the Russians, we’re seeing them penetrate some of your infrastructure, here’s what we’ve seen, what can we do to try to assist,” Adm. Michael Rogers, who concurrently leads both Cyber Command and the NSA, said at a Senate Armed Services Committee hearing.

The statement was prompted by Sen. Kirsten Gillibrand (D-N.Y.), who asked what the U.S. role is in helping allies dealing with cyber intrusions into their critical infrastructure and elections process after French and German officials disclosed this kind of activity.

Rogers, who noted the intelligence sharing is occurring on the NSA side, added the agency is doing similar things with British counterparts who also have an upcoming election.

“We’re all trying to figure out how can we try to learn from each other,” he said.

Rogers also confirmed, upon questioning by chairman John McCain (R-Ariz.), that Russian and Chinese activities in the cyber realm against the U.S. and its allies have not slackened. He also did not see any reduction in efforts to commit cyber attacks that attempt to affect elections.

Rogers partially agreed with the conclusion of a February Defense Science Board report that “the unfortunate reality is that for at least the next decade, the offensive cyber capabilities of our most capable adversaries are likely to far exceed the United States’ ability to defend key critical infrastructures.”

Rogers said he agreed more generally that the offensive side in cyber has the advantage over defense.

“Which is why the ideas of deterrence are so important here. How do we shape and change opponents’ behavior.”

He also explained his worst case scenario for cyber attacks. This includes outright destructive activity focused on an aspect of critical infrastructure, data manipulation on a massive scale, and what happens when non-state actors decide cyber is now an attractive method enabling them to try to destroy the status quo. Rogers was particularly concerned with data manipulation because most cyber attacks deal with infiltration and extraction. Changing data, like voter rolls, “that’s a very different kind of challenge of us,” Rogers said.