A European cybersecurity pact has been agreed that is intended to make “the tools of the energy transition safe for citizens and secure for providers”.