A digital revolution is sweeping the global energy sector. People frustrated by slow progress on combating climate change are cheering energy’s digitalization—the application of information and communications technologies to this sector. Advances in artificial intelligence and computing power, the falling cost of digital equipment such as sensors, and internet connectivity are transforming the way energy is produced, transported and consumed. Tantalizing signs indicate that digital innovations could help the global economy decarbonize—reduce emissions of greenhouse gases—by promoting cleaner energy sources and reducing wasteful energy use.

Digitalization, however, is a double-edged sword. That is the conclusion of 14 expert authors in a new book, Digital Decarbonization, published on June 25, 2018, by the Council on Foreign Relations. They argue that digital innovations could just as readily increase our use of fossil fuels and raise emissions. They also note that other risks will accompany the advances, including heightened threats of cyberattacks on the power grid and breaches of personal data privacy. Thus, public policies are needed to steer digital technologies toward speeding a clean energy transition while mitigating the risks.

Digital technologies are not inherently clean. For example, oil and gas companies are preparing to apply artificial intelligence to boost production from shale wells. As such techniques are scaled up, fossil fuels could become cheaper, undercutting cleaner energy sources. Similarly, owners of power plants that run on fossil fuels such as coal and natural gas are installing sensors to check plant health and are applying machine learning techniques to better maintain the facilities. This work could help curtail plant outages and prolong lifetimes, increasing long-term emissions.

On the other hand, digitalization could bolster clean energy sources, such as solar and wind power. A big knock against them is that their output is highly volatile, which can strain electricity grids. Once utility companies upgrade the grid with digital sensors and communications networks, they can conduct an orchestra of power generators, batteries and customer appliances to ensure grid stability even as more renewable energy comes online. On top of this, digital innovations such as programmable thermostats that turn down the air conditioning when a home is empty, are making it easier than ever for people and their service providers to save energy. Digital technologies can even reduce the cost of operating complex equipment to capture and store carbon emissions from fossil-fuel plants.

The starkest example of how a digital innovation could cause carbon emissions to soar or plummet is in transportation. Self-driving cars—enabled by digital advances in sensors, computing, machine learning and more—could soon become commonplace. As a result, miles traveled by road vehicles could explode, as commuting becomes productive time for people who do not have to drive the car, as cheap robo-taxis pick up the drycleaning, and as retailers dispatch roving warehouses to provide instant neighborhood delivery. According to a widely cited study, all this driving could cause carbon emissions from vehicles to double in coming decades. Yet the same study finds that emissions could plunge by half, if most self-driving cars turn out to be electric vehicles, plug into a grid powered mostly by clean energy, and make it easier to carpool and get to mass transit. Given these divergent scenarios, the right market incentives are needed to drive this technology toward reducing emissions.

Whether more digitally connected energy systems raise or lower carbon emissions, the threat of cyberattacks will grow. Already, digital strikes on electric grids around the world have shut down power plants and forced blackouts. As customers add billions of internet-connected appliances to the grid, malicious actors will have more opportunities to enter the network or to pilfer personal data. For example, smart electricity meters that frequently measure energy use at a home can help individuals reduce their electric bills, but thieves could also use that data to infer when a home is occupied or empty.

Notwithstanding these risks, firms are pouring money into digitalization. In 2016 the electricity industry invested $47 billion in digital upgrades—more than it spent on new natural-gas power plants. And in the last three years, start-ups commercializing digital innovations in energy have attracted rising levels of venture capital, reversing a sharp investment decline in clean energy technologies.

Policy makers should direct digital innovations so they reduce emissions. For example, countries should put a price on carbon emissions, taxing entities that pollute and creating an incentive to curb emissions. Unlike other proposals, such as mandating solar panels on roofs, a price on carbon does not specify how to reduce emissions, allowing the private sector to find the cheapest and most innovative approaches. Many of those techniques will involve digital technologies. And, just as important, a price on carbon will lessen incentives to use digital innovations to increase, rather than decrease, emissions. In addition, countries should invest in research and development into applications of digital technologies that reduce rather than raise emissions, so that private investments are attracted to the cleaner ones.

Policy makers should also enact regulations that mitigate the risks of cyberattacks and privacy breaches without stifling innovation. For example, they should require electric utilities to fortify the grid against hackers and to anonymize the personal data they collect.

The stakes are high. Countries do not have much choice over whether the digitalization of energy accelerates. But they do have a golden opportunity to guide it toward promoting a sustainable future.