THE LAST TIME the Pentagon directed all of its bases to raise their threat level, the danger came from an unlikely source: social media. That’s where accounts connected to ISIS posted the names and home addresses of US military personnel and encouraged terrorists to attack them. Military bases around the country began the methodical process of implementing stricter security. After countless meetings and thousands of checklists, the bases were ready.

But in times of crisis, seconds matter. The same connectivity that allows overseas extremists to make personal threats with the click of a button could also enable quicker, stronger, and more comprehensive security responses at the nation’s military installations. Put simply, a base that employs smart technologies is safer.

Of course, the promises of innovative technologies can sometimes be oversold or just plain wrong. But smart technologies are proven and offer significant advantages for military installations. The smart military base is overdue.

A smart base employs technologies—artificial intelligence, the Internet of Things, machine automation and robotics, and data analysis, to name a few—to improve the quality and speed of its functions and services. Taken together, they collect and process large amounts of data that enable more economical operations and help military staffers make better decisions.

If a terrorist followed through on those threats to military staffers, a smart military base’s networked cameras and license plate recognition sensors would single out new visitors and direct them to entry gates with tighter security. In the worst-case scenario, a smart base could isolate the sound of gunfire and communicate its location to emergency responders on-base. An alert could be sent to everyone’s smart phones notifying them of an active-shooter and indicating which areas to avoid. Base officials could immediately lock down schools, daycare centers, and hospitals. And the data trail enables easier intelligence collection and prosecution.

Applying smart technologies to military bases is more than hypothetical. Army and Navy bases in Georgia recently opened smart energy solar plants that allow them to operate independent of the local power grid, a critical capability in an emergency. Fort Bragg is experimenting with driverless vehicles to transport wounded soldiers across base to rehab appointments.

Smart cities provide the model for smart military bases, since bases share many of the same characteristics as cities. In the past 10 years urban planners have emphasized technologies like sensors, data analysis, and smartphone apps, to catalyze cities’ advancement.

Columbus, Ohio recently won a $50 million grant from the US Department of Transportation to improve its transit infrastructure; in its proposal to the government, Columbus described how improving its traffic patterns and transportation could reduce infant mortality rates and improve access to health care for all. Other cities are also leveraging the Internet of Things to harness massive amounts of real-time data about traffic, crime, weather, energy consumption, and more to improve governance and quality of life.

Back to the military: The Department of Defense oversees hundreds of thousands of buildings across more than 5,000 locations on more than 30 million acres of land. The Government Accountability Office reports that DoD installations have a replacement value of $880 billion. So tremendous efficiencies can be realized from using technology to help monitor and manage power, water, and construction costs associated with such large holdings. For example, the Army’s smart energy program has reduced costs by nearly $150 million. Leasing unused base real estate returns money to taxpayers while also serving the community around the base, as the military has seen with the geothermal power plant at a Navy weapons station in California that contributes nearly 1.5 million megawatts-hours of electricity to the grid each year. And with the Trump administration looking to end sequestration and increase spending, now is the time to ensure deliberate and sustained investment in military installations are prioritized.

Beyond security and savings, technology can improve life on the base; sensors that can distinguish base workers and residents from transient personnel and visitors can help manage congestion during morning rush hour or large public events like airshows. Additive manufacturing technology, like the Navy’s Print the Fleet project, allows bases to use 3-D printing for quicker and cost-effective repair and replacement parts that can be produced on site. Sensors in garbage cans and on the shelves of the base grocery stores can help waste management personnel manage collections and automate commissary inventory requests. Innovative construction and urban planning technologies can help bases design mixed-use areas as well as avoid millions of dollars in environmental impact costs through the identification of sites that can be repurposed.

While technology can make military bases more efficient, smart devices do carry risk. Hackers have infected smart devices with viruses; they’ve taken over hotel lock systems with ransomware, and they’ve deployed IoT devices in massive distributed denial of service attacks. So introducing large numbers of wireless sensors and connecting them to the most vital parts of a military installation can seem counterintuitive, especially to military commanders who necessarily prioritize security over convenience and cost savings.

But security vulnerabilities are easily reduced by changing default passwords and encrypting data streams. Military bases, of course, will need more than good password practices. They’ll need to rigorously test devices before they can be put to use. But that shouldn’t be a barrier to adoption. Updating aging base installations with smart technologies to better protect and serve military members and their families is more than worth it.

In 1912, famed Italian electrical engineer Guglielmo Marconi declared, “The coming of the wireless era will make war impossible, because it will make war ridiculous.” Today, it’s clear his wires were crossed. Conflict remains very real, and military bases must keep pace with an interconnected world. The Trump administration’s defense strategy calls for increased infrastructure investment, and military installations must be high on the priority list. The smart military base can provide the security, resiliency, workability, and livability required to meet today’s threats and better serve its personnel and their families.