Big social media companies made a case against new legislative mandates by emphasizing their voluntary efforts to root out terrorism-related material and other objectionable content on their sites during a Senate hearing Wednesday.

But senators from both parties warned representatives of Facebook, YouTube and Twitter of legislative action even as Senate Commerce, Science and Transportation Chairman John Thune, R-S.D., said he was focused on oversight rather than legislation, which could further open the companies to lawsuits. The committee approved a bill that would allow online businesses to be sued and prosecuted for sex trafficking content, but Thune indicated he wasn’t ready to do the same over terrorism content.

The social media companies allow extremist groups “to recruit and to radicalize folks that will commit violent acts against Americans,” Thune said. “We just want to make sure we are staying on top of that issue.”

The committee bill would narrow a liability shield in the 1996 telecommunications law for third-party, sex-trafficking material published by online businesses.

Panel members praised efforts by the companies in using screening technology such as artificial intelligence to remove or block recruitment videos that show beheadings and other terrorist acts.

Monika Bickert, head of product policy and counterterrorism for Facebook, said social media companies shared the same interests as government in trying to fight terrorism and ensuring transparency, and she called for a “constructive dialogue” with lawmakers.

“We will continue to partner with appropriate authorities to counteract these threats,” Bickert said. The Internet Association, a trade group representing digital companies including Facebook and Google, has supported the sex trafficking bill, but online businesses have signaled a desire to block additional legislative requirements.

Sen. Ted Cruz, R-Texas, questioned whether censorship could go too far and root out not just terrorism but political views. He said he was weighing a proposal to curb the liability shield under the 1996 law in cases where material is wrongly censored based on political views.

“That is certainly a policy option that should be considered,” Cruz said.

Cruz cited Twitter’s decision last fall to prevent the campaign of Rep. Marsha Blackburn, R-Tenn., who is running to succeed retiring Sen. Bob Corker, R-Tenn., from paying to promote a political ad about her efforts to cut off funding to Planned Parenthood and about efforts that “stopped the sale of baby body parts.”

Fetal tissue sales after abortions were discussed by abortion providers in a clandestine video in 2015, but Planned Parenthood has denied any involvement in such sales.

Carlos Monje Jr., Twitter’s director of public policy and philanthropy, acknowledged that the company had made errors in dealing with Blackburn’s campaign video and would take care in handling similar cases in the future. He said the company did not restrict Blackburn’s own tweets, and said that a higher standard of review was used when dealing with advertising.

Cruz also raised concerns about a lawsuit filed by PragerU, a conservative educational website, against YouTube, alleging that the social media operator was censoring videos dealing with issues such as abortion and Islam based on political content. YouTube is a subsidiary of Google.

Juniper Downs, global head of public policy and government relations for YouTube, declined to comment on the handling of PragerU videos, saying it was under litigation.

Sen. Richard Blumenthal, D-Conn., tried to push his own draft bill that would require social media companies to disclose data about the sponsors of issue ads.

“I am working on legislation that would require disclosure of the groups sponsoring not just political ads, but also message ads, non-candidate ads,” Blumenthal said.

Clint Watts, a former FBI agent and senior fellow at the Center for Cyber and Homeland Security at George Washington University, voiced support for such legislation as a tool to ensure transparency and to resist foreign interference in elections and policy debates. “Users should know where ads come from,” Watts said in an interview.

Downs and Bickert took a cool stance toward disclosure mandates, saying that issue advertising was a complicated topic that companies were continuing to examine.

Thune stopped short of opposing the idea of requiring disclosure of sponsors of issue advertising online, but said such legislation would be outside his panel’s jurisdiction because it deals with campaign finance issues that fall under the purview of the Rules Committee.

“That’s more political activity. I guess it’s not maybe as much under our committee’s jurisdiction,” Thune said.

Another bipartisan proposal by Sen. Amy Klobuchar, D-Minn., to require disclosure of data about buyers of political campaign advertising on social media has been opposed by Senate Majority Leader Mitch McConnell, R-Ky., and has been stalled in the Rules Committee.