It's the nightmare scenario that has already played out in American schools from Littleton, Colo., to Parkland, Fla., and now terrifies every educator: An intruder makes it onto school property with a loaded firearm.

But this time it's different. As soon as the school security camera captures an image of the gunman, artificial intelligence, or AI, software picks up the presence of the weapon and sends an instant alert to the smartphones of school administrators and police. Within a few seconds, school leaders can confront the intruder through a loudspeaker and order a lockdown.

When that scenario played out this month at Archbishop Wood High School in Warminster, it was only a demonstration – a test of the school's new object-recognition software, aimed at offering educators hope that AI-driven technology is a way to stop the next deadly school shooting before it starts.

The Bucks County Catholic high school this fall became the first in the nation to connect its security cameras to a server with the AI software developed by startup Athena Security. The company was co-founded by a Cheltenham native, Chris Ciabarra, whose mother taught chemistry at Wood for nearly 50 years.

"I'd rather have it and not need it than need it and not have it," said Gary Zimmaro, president of the nearly 900-student high school, explaining why Wood eagerly signed up to become the pioneering user of the detection system. He noted that the high school has never had a shooting incident and has always been safety-conscious, with 30 security cameras and required access swipes.

A high-tech solution like the Athena system typically runs $100 per month for each camera — Wood officials wouldn't say how much they paid as a test client — and has yet to prove its effectiveness in a real-life threat.

But the interest in such a futuristic solution shows the urgency school leaders are placing on innovative security measures in the wake of February's assault on Marjory Stoneman Douglas High School in Parkland, which claimed 17 lives and was one of roughly 200 school shooting incidents since 1999's Columbine High School massacre in Littleton.

The most frequent responses – active-shooter drills and Stop the Bleed programs – tend to be reactive rather than proactive, which is a selling point for the AI system touted by Athena.

"Why would you want humans looking at TV screens all day?" said Ciabarra in explaining why he and partner Lisa Falzone, who also worked with him on a Silicon Valley payment-system startup called Revel Systems, have such high hopes for the AI solution. "If they get tired or go to the bathroom, they miss the problem."

With the Wood installation, Athena, based in Austin, Texas, has planted a flag amid a growing number of rivals like SN Technologies – which recently sold its AI-driven system to a school system in western New York state for $3.3 million – seeking to profit in the push for more effective security measures.

The 42-year-old Ciabarra experienced the typical ups and downs of a high-tech venture with Revel, which had raised $130 million for its point-of-sale software; he and Falzone had just sold the firm to a venture-capital outfit when news broke of 2017's Las Vegas shooting that took 58 lives.

"With all the school shootings we're seeing, we thought, how can we use technology to stop all these crimes?" Ciabarra said. The Athena founders were aware, he said, of recent advances in facial- and object-recognition software through technology like IBM's Watson, but saw a need for a niche product targeting potential shootings.

School and company officials said the system installed at Wood has been fed thousands of images of various weapons and has a 99 percent success rate in demonstrations like the one this month attended by parents and educators from other local schools.

Zimmaro noted that the smartphone app sends the live video along with an alert so school officials can determine whether there's an actual threat before confirming it with Warminster Township police, who are also plugged into the system.

Ciabarra said he believes a feature that would allow a school staffer to speak into his or her phone and address an apparent intruder through a speaker has the potential to defuse some potential incidents.  "That way you can try to talk them down," he said.

The new security system is running in just two locations – the other is an ice cream shop in Northern California – but the start-up has more sales in the pipeline. Already, the firm is working on expanding the system's capabilities — including lowering the cost of radar technology aimed at detecting concealed weapons under clothes or even through walls.

"You can also do fight detection," Ciabarra said. "We're working on knives. Basically, our customers are coming to us with different requests."

At Wood, officials said there are plans to expand the network of security cameras to more than 50 locations on its 32-acre campus. Officials at other Catholic schools that attended the meeting are interested in the system, Ciabarra said.

"I hope we never have to use it," Zimmaro said of the weapons alerts. "We haven't had threats at Archbishop Wood, and we hope we never do."