LOWELL — The Lowell police and school departments are poised to purchase a powerful new online tool that would monitor all public posts made within the city limits on popular social-media sites.

The program would allow officers and school administrators to identify potentially harmful situations, including bomb threats, online bullying and suicide notes, police Superintendent William Taylor said.

But civil-liberties groups warn that such tools open the door for abuses of power when used incorrectly.

“People should be able to criticize government in a free society without some cop somewhere writing down everything they say,” said Kade Crockford, director of the American Civil Liberties Union of Massachusetts’ Technology for Liberty Project. “The way to solve crimes is to go after people who are suspected of specific criminal acts, not spying on the general public.”

Taylor dismissed concerns that police will use the monitoring program — if it is purchased — to spy on Lowell residents or punish them for what they post.

“Any police agency is there and has the responsibility to protect people’s right to free speech,” he said.

On Jan. 15, police and school officials sat in on a demonstration by Social Sentinel, a Vermont company that sells monitoring software. The Police Department declined The Sun’s request to observe the demonstration because the test included information relevant to ongoing investigations.

Chicago-based Geofeedia will walk officials through its competing product soon, Taylor said, and he is confident the police and school departments will eventually subscribe to one of the programs.

The city is not required to disclose the proposed costs of the two programs or any future bidders until a single supplier is chosen.

But if only the School Department purchased Social Sentinel, it would cost $17,000 for the first year and $15,000 for subsequent years, according to documents obtained by The Sun. The company bases its prices on the population size within the monitored geographical area.

Social Sentinel’s tool notifies users when somebody within a designated geographical area posts a word or phrase that pings one of the company’s preset filters, such as “general violence” or “suicide and depression,” Social Sentinel President and CEO Gary Margolis said.

Those filters can contain more than a thousand keywords. Some of them may be obvious, such as “gun” or “bomb,” but the program also allows subscribers to add their own localized search terms, like a gang name, slang term or street name.

Users can choose to receive a report of the previous day’s activity or receive notices in real time.

Geofeedia operates similarly, but offers the additional ability to archive all past posts and store them in a “cloud.”

The program uses the archived databases to identify “influential posters” and posting trends, according to the company’s website. The program can also track the location of posters and map their movements.

Both programs track posts on Facebook, Twitter, Instagram, YouTube, Flickr and Google+. Social Sentinel also monitors Tumblr, Vimeo and Meetup.

“If we had somebody look at this all day, obviously, it would be impossible to get your arm around it,” Lowell police Captain Thomas Kennedy said, adding that Social Sentinel “can kind of tailor the monitoring to our specific needs, for example, if we were looking for something to do with suicide or guns.”

Increasingly, communities communicate through social media — often in ways they wouldn’t out loud — and spontaneous events, such as protests, are planned online, said Margolis, a former police chief. As residents move online, law enforcement must follow, he said.

But the criminality of online speech can be hard to navigate.

An ongoing case in the Bushwick neighborhood of New York City illustrates the complications of cyberpolicing.

On Jan. 18, New York City police arrested 17-year-old Osiris Aristy on a score of charges based on a series of Facebook posts he made.

Several of the posts contained emojis, or characterizations, of guns pointed at emojis of police officers. Another post, containing a photo of Aristy with a revolver and ammunition, was captioned “feel like katxhin a body right now.”

Police charged Aristy with making terrorist threats, and obtained a warrant to search his home, where officers found a revolver and several bags of marijuana.

But a grand jury assigned to the case decided the posts did not constitute evidence that Aristy intended to commit a specific and imminent violent act — the legal standard for prosecuting violent speech — and the terrorism charge was dropped.

Now the other charges against Aristy are in jeopardy, too.

“We’re going to challenge the search warrant,” said Fred Pratt, Aristy’s attorney. “To get a search warrant, you need very fresh and specific information.”

With the initial charge dropped, Pratt intends to argue that a picture of Aristy holding a gun does not constitute probable cause that the weapon was illegal or was in his home.

Closer to home, Chicopee police in December charged Charles DiRosa, 27, of Chicopee, with threatening to commit a crime for posting “Put Wings on Pigs” on Facebook. The phrase is a reference to a post made by Ismaaiyl Brinsley shortly before he shot and killed two New York City police officers on Dec. 20 before killing himself.

Taylor said the Police Department, if and when it does acquire a monitoring tool, will use it in a preventative fashion, and not to police online speech.

School administrators have not yet met to discuss the Social Sentinel demonstration, Deputy Superintendent of Schools Jay Lang said.

The worry for Crockford, the ACLU lawyer, is that even if authorities begin responsibly and with the best of intentions, a catastrophic event or change in leadership can alter the way monitoring tools are used.

“The problem is that a lot of it happens in secret at police departments,” she said.

But Social Sentinel is like truncheons and wiretaps, Margolis said. It is only as good as the people who control it. But like those older technologies, social-media monitoring is necessary for authorities to keep up with the communities they police, he added.

“Everything becomes: Do you have the right people, in the right jobs, with the right professional standards, doing the right things?” Margolis said.