The word that could best replace "agents" without changing the meaning of the sentence is "saboteurs."
So the revised sentence would be:
"Enemy saboteurs hacked into the electrical grid and caused the power outage."
This maintains the idea of individuals or groups responsible for the sabotage.