Surveillance systems in American schools increasingly monitor everything students write on school accounts and devices.

Lesley Mathis knows what her daughter said was wrong. But she never expected the 13-year-old girl would get arrested for it.

The teenage girl made an offensive joke while chatting online with her classmates, triggering the school’s surveillance software.

Before the morning was even over, the Tennessee eighth grader was under arrest. She was interrogated, strip-searched and spent the night in a jail cell, her mother says.

Earlier in the day, her friends had teased the teen about her tanned complexion and called her “Mexican,” even though she’s not. When a friend asked what she was planning for Thursday, she wrote: “on Thursday we kill all the Mexico’s.”

Mathis said the comments were “wrong” and “stupid,” but context showed they were not a threat.

“It made me feel like, is this the America we live in?” Mathis said of her daughter’s arrest. “And it was this stupid, stupid technology that is just going through picking up random words and not looking at context.”

Surveillance systems in American schools increasingly monitor everything students write on school accounts and devices. Thousands of school districts across the country use 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, technology can dip into online conversations and immediately notify both school officials and law enforcement.

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

“It has routinized law enforcement access and presence in students’ lives, including in their home,” said Elizabeth Laird, a director at the Center for Democracy and Technology.

In a country weary of school shootings, several states have taken a harder line on threats to schools. Among them is Tennessee, which passed a 2023 zero-tolerance law requiring any threat of mass violence against a school to be reported immediately to law enforcement.

The 13-year-old girl arrested in August 2023 had been texting with friends on a chat function tied to her school email at Fairview Middle School, which uses Gaggle to monitor students’ accounts. (The Associated Press is withholding the girl’s name to protect her privacy. The school district did not respond to a request for comment.)

Taken to jail, the teen was interrogated and strip-searched, and her parents weren’t allowed to talk to her until the next day, according to a lawsuit they filed against the school system. She didn’t know why her parents weren’t there.

“She told me afterwards, ‘I thought you hated me.’ That kind of haunts you,” said Mathis, the girl’s mother.

A court ordered eight weeks of house arrest, a psychological evaluation and 20 days at an alternative school for the girl.

Gaggle’s CEO, Jeff Patterson, said in an interview that the school system did not use Gaggle the way it is intended. The purpose is to find early warning signs and intervene before problems escalate to law enforcement, he said.

“I wish that was treated as a teachable moment, not a law enforcement moment,” said Patterson.

Students who think they are chatting privately among friends often do not realize they are under constant surveillance, said Shahar Pasch, an education lawyer in Florida.

One teenage girl she represented made a joke about school shootings on a private Snapchat story. Snapchat’s automated detection software picked up the comment, the company alerted the FBI, and the girl was arrested on school grounds within hours.

Alexa Manganiotis, 16, said she was startled by how quickly monitoring software works. West Palm Beach’s Dreyfoos School of the Arts, which she attends, last year piloted Lightspeed Alert, a surveillance program. Interviewing a teacher for her school newspaper, Alexa discovered two students once typed something threatening about that teacher on a school computer, then deleted it. Lightspeed picked it up, and “they were taken away like five minutes later,” Alexa said.

Teenagers face steeper consequences than adults for what they write online, Alexa said.

“If an adult makes a super racist joke that’s threatening on their computer, they can delete it, and they wouldn’t be arrested,” she said.

Amy Bennett, chief of staff for Lightspeed Systems, said that the software helps understaffed schools “be proactive rather than punitive” by identifying early warning signs of bullying, self-harm, violence or abuse.

The technology can also involve law enforcement in responses to mental health crises. In Florida’s Polk County Schools, a district of more than 100,000 students, the school safety program received nearly 500 Gaggle alerts over four years, officers said in public Board of Education meetings. This led to 72 involuntary hospitalization cases under the Baker Act, a state law that allows authorities to require mental health evaluations for people against their will if they pose a risk to themselves or others.