In Tennessee, an eighth-grade girl triggered her school's surveillance software after she made an offensive joke while chatting online with her classmates.

She ended up spending a night in jail for it.

Thousands of U.S. school districts are increasingly monitoring everything students write on school accounts and devices.

They're using software like Gaggle and Lightspeed Alert to track kids’ online activities, looking for signs they might hurt themselves or others.

With the help of artificial intelligence, the technology can dip into online conversations and immediately notify school officials and law enforcement.

Educators say the technology has saved lives, but critics warn it can criminalize children for careless words.

Gaggle alerted more than 1,200 incidents to the Lawrence, Kansas, school district in a 10-month period, but almost two-thirds of those alerts were deemed nonissues by school officials.

Information that could allow schools to assess the software’s effectiveness, like the rate of false alerts, is unavailable to the public unless schools track the data themselves.