Ben Krakauer, the city’s assistant commissioner for emergency management, had two reactions when he saw the Saturday alert about a ballistic missile heading toward Hawaii.

First, he worried “that this was real,” devastation inbound on the country.

Once it became clear the alert was a mistake, Krakauer, who has worked on the wireless emergency alert program in NYC since it was introduced in 2012, had another fear: that public trust would be eroded in the blaring text-like alerts to your phone.

Who can blame him? The Hawaii alert led to chaos and death threats to the state’s emergency management agency. On Tuesday, there was a similar false alarm issued by the Japanese national broadcaster NHK.

This is the nuclearized-North-Korea and personal-technology-saturated world we live in.

New York has similar technology to send millions of wireless emergency messages to New Yorkers’ phones when action is needed. It is perhaps the most modern and instantaneous form of emergency communication. But Krakauer stresses that there are procedures to prevent the kind of panic that happened in Hawaii, where an employee apparently picked the wrong option when trying to send a test alert.

New York does plenty of testing, too. Once a week, all public warning specialists go through the process, says Krakauer, but they work on a training system that can’t be used to send real messages.

To be safe, training messages include a note that this is a test, just in case something crazy happens.

Emergency Management has used the real wireless alert system eight times: three times during Superstorm Sandy, plus two alerts for blizzard conditions and three during the 2016 Chelsea bombing.

Alerts are requested by the official in charge of responding to the emergency — the police or fire chief, for example, or the mayor’s office. The Emergency Management team puts the information into a 90-character (or fewer) message, and then rechecks it with security pros, who approve it. The mayor doesn’t need to sign off, though in the Chelsea bombing situation, for example, Mayor Bill de Blasio was at the command post and was aware of the messages being crafted, Krakauer said. While a public warning specialist goes through the steps, a supervisor looks over his or her shoulder, checking the procedure on a piece of paper.

It can take less than 10 minutes to transform a request into an alert blaring on millions of phones across the five boroughs.

In one additional failsafe, Krakauer says messages are typed into the system before being sent.

Yet at this moment 130 prescripted messages are prepped elsewhere (but safely separate) in the system, ready to be turned into alerts if necessary. Those messages cover a range of topics, from explosions to hazardous materials to fires to low-flying aircraft, and even messages that can be altered to cover nuclear missiles, Krakauer says.

New Yorkers can sign up for more geo-targeted (and minor) alerts about emergencies and city services via nyc.gov/notify, for example. And a law passed by the City Council late last year requires the establishment of a hit-and-run alert system, with alerts distributed by text message or radio broadcast or the like. Details about how exactly this will be operationalized are still being worked out before March implementation by the NYPD.

For now, expect the future to include more communication in this vein between city government and citizens. Hopefully, without mistakes.