The case of teenager Cameron Dambrosio might serve as an object lesson to young people everywhere about minding what you say online unless you are prepared to be arrested for terrorism.

The Methuen, Mass., high school student was arrested last week after posting online videos that show him rapping an original song that police say contained “disturbing verbiage” and reportedly mentioned the White House and the Boston Marathon bombing. He is charged with communicating terrorist threats, a state felony, and faces a potential 20 years in prison. Bail is set at $1 million.

Whether the arrest proves to be a victory in America's fight against domestic terrorism or whether Cameron made an unfortunate artistic choice in the aftermath of the Boston bombing will become clear as the wheels of justice advance. What is apparent now, however, is that law enforcement agencies are tightening their focus on the social media behavior of US teenagers – not just because young people often fit the profile of those who are vulnerable to radicalization, but also because the public appears to be more accepting of monitoring and surveillance aimed at preventing attacks, even at the risk of government overreach.

“When I was young, calling a bomb threat to your high school because you didn’t want to go to school that day was treated with a slap on the wrist. Try that nowadays and you’re going to prison, no question about it. They are taking it more seriously now,” says Rob D'Ovidio, a criminal justice professor at Drexel University in Philadelphia who specializes in high-tech crime.

Teenagers are generally blissfully unaware that law enforcement agencies are creating cyber units to track and investigate developing ways that criminals, or would-be criminals, research, socialize, and plot nefarious actions, from child molestation to domestic terrorism. The Boston Marathon bombing suspects, Dzhokhar Tsarnaev and Tamerlan Tsarnaev, fit this profile: One maintained a YouTube page and the other a Twitter feed, where both promoted the teachings of a radical Muslim cleric, alongside innocuous postings about music and sports. For law enforcement officials, filtering what does and does not constitute a threat is a delicate balancing act that, since the April 15 bombing, may be tilting to the side of additional caution.

“The danger of this in light of the tragedy in Boston is that law enforcement is being so risk-averse they are in danger of crossing that line and going after what courts would ultimately deem as free speech,” Mr. D'Ovidio says.

Three people were killed and at least 260 injured in the two bomb blasts near the Boston Marathon finish line on April 15. Since then, questions have been raised about how authorities missed signals, especially after alerts from Russian intelligence, that one of the bombing suspects had become radicalized. Tamerlan Tsarnaev, killed after a gunfight with police, had been under surveillance by Russia when he traveled there for six months in 2012, besides his activity on social media.

“The bottom line is that the public wants to know, after the fact, why [an attack] was not stopped.… Most Americans are prepared to maintain a sophisticated watch on this without [government] overreach, but most Americans also feel if these things can be stopped before they begin, they want to see that happen,” says Michael Greenberger, a law professor at the University of Maryland Center for Health and Homeland Security.

Some authorities say that zooming in on unusual behavior online fits squarely with how police have conducted random searches on the street.

“The greatest mystery in life is the human mind. We don’t know what other people do until it becomes known. Our job is to figure it out, but we need indicators to know something’s not right,” says Sgt. Ed Mullins of the New York Police Department, who is also president of the Sergeants Benevolent Association, the city’s second-largest police union.

Using a zero tolerance approach to track domestic terrorists online is the only reasonable way to analyze online threats these days, especially after the Boston Marathon bombing and news that the suspects had subsequently planned to target Times Square in Manhattan, Mullins says. The way law enforcement agencies approach online activity that appears sinister is this: “If you’re not a terrorist, if you’re not a threat, prove it,” he says.

“This is the price you pay to live in free society right now. It’s just the way it is,” Mullins adds.

That method can result in arrests of teenagers whose online activity may be more aptly characterized as stupid pranks.

In February, Jessica Winslow and Ti'jeanae Harris, two high school girls in Rapids Parish, La., were arrested and charged with 10 counts of terrorism each after they allegedly e-mailed threats to students and faculty “to see if they could get away with it,” detectives told a local television news station. “We take every threat in our schools as a credible threat, and I am happy to say we have made these arrests,” Sheriff William Earl Hilton told reporters.

In January, Alex David Rosario, a high school student in Armada Village, Mich., was charged with domestic terrorism after he allegedly threatened to shoot fellow employees at the Subway shop where he worked. He told police it was a joke. “We feel threatening to kill somebody is not a joke. It doesn’t appear the prosecutor takes it as a joke either and the judge certainly doesn’t,” said Armada Police Chief Howard Smith.

Then there is the case of Abdella Ahmad Tounisi, a Chicago-area teenager arrested in April on terrorism charges related to communicating with a website set up by the FBI that he thought was a Syrian militant group linked to Al Qaeda.

Militant and hate groups are known to use the Internet to lure teenagers “to gain their sympathy” through video games, music, or rhetoric that plays to themes of alienation, D'Ovidio says. Connecting with terrorists would have been impossible in the past, but today, as is alleged in the Tounisi case, anyone with a grudge or curiosity, or both, and an Internet connection can open that dialogue. Foolishly, the teens perceive that they are operating anonymously and within a safe environment, D'Ovidio says.

“We know these groups are catering and looking for these individuals," he says. "They create the right environment for experimentation for kids who may have a proclivity of being disgruntled toward the US government.”

Easy access to online media, plus the urge to rebel, is a combustible mix that should make parents vigilant, cautions Stephen Balkam, chief executive officer of the Family Online Safety Institute, a nonprofit advocacy group in Washington that wants teenagers to be better informed about the outcomes of what they post, tweet, or upload online.

“Every generation of teenagers has figured out a way of rebelling against their parents, or giving it back to ‘the man.’ What I think is unprecedented is the very ‘man’ and the system they want to rebel against can track them and find their digital footprints online,” Mr. Balkam says. “In a sense, it’s good that we can catch kids who are getting radicalized sooner than later, but by the same token, it’s a challenge for kids to grow and develop, which is their job as a teenager, if they are being scrutinized too much.”