LOCKPORT, N.Y. — I have a 16-year-old daughter, and like every parent in the United States today, I worry about her safety when she’s in school. But here in Western New York’s Lockport City School District, those fears have led to a wasteful and dangerous experiment.

This week the district’s eight public schools began testing a system called Aegis, which includes facial recognition technology , that could eventually be used to track and map student movements in our schools. How that happened is a cautionary tale for other schools across the country.

In 2015, in the wake of Sandy Hook and other high-profile school shootings, our district was approached by Tony Olivo, a security consultant , who offered to do a free threat assessment of our schools. Later, he encouraged the school district to purchase and install a high-tech facial-recognition camera system developed by SN Technologies, a Canadian company whose sole surveillance experience was in the casino industry. But the software cost a fortune — $1.4 million for a district of a little over 4,400 students and an annual budget of just over $100 million.

Mr. Olivo identified a funding source the district could use to make the purchase — using money Lockport was set to receive for technology education under a 2014 Smart Schools Bond Act . Far from being an independent expert, however, he also stood to benefit financially from the deal. A proposed licensing agreement the school district was forced to disclose showed that Mr. Olivo’s company, CSI Risk Management, was negotiating a payment of $95,450 annually for five years. Neither he nor the school district would disclose what he was eventually paid.