Educators find themselves needing to balance students’ free speech rights against the dangers children can get into at school and sometimes with the law because of what they say in posts on Facebook, Twitter and Tumblr. Courts have started to weigh in.

In September, a federal appeals court in Nevada, for instance, sided with school officials who suspended a high school sophomore for threatening, through messages on Myspace, to shoot classmates. In 2011, an Indiana court ruled that school officials had violated the Constitution when they disciplined students for posting pictures on Facebook of themselves at a slumber party, posing with rainbow-colored lollipops shaped like phalluses.

“It is a concern and in some cases, a major problem for school districts,” said Daniel A. Domenech, executive director of the American Association of School Administrators, which represents public school superintendents.

Surveillance of students’ online speech, he said, can be cumbersome and confusing. “Is this something that a student has the right to do, or is this something that flies against the rules and regulations of a district?”

Interviews with educators suggest that surveillance of students off campus is still mostly done the old-fashioned way, by relying on students to report trouble or following students on social networks. Tracking students on social media comes with its own risks: One principal in Missouri resigned last year after accusations that she had snooped on students using a fake Facebook account. “It was our children she was monitoring,” said one Twitter user who identified herself as Judy Rayford, after the news broke last year, without, she added, “authorization” from children or parents.