The Pennsylvania Senate passed a bill Tuesday that would require artificial intelligence chatbots to disclose that they are not human and include safeguards against suicide-encouraging messaging.

Sen. Tracy Pennycuick of Lower Salford Township, Montgomery County, said artificial intelligence is creating both opportunities and risks. She said there have been a growing number of cases in which children have turned to AI chatbots for emotional support and a sense of connection, and that the messaging can seem very real.

Pennycuick and Sen. Nick Miller of Allentown, the majority and minority chairs of the Senate Communications and Technology Committee, described the bill as a common-sense step for protection.

The bill passed the Senate by a 49-1 vote. Sen. Doug Mastriano of Franklin County cast the only no vote. The measure now goes to the Pennsylvania House for consideration.

The vote came a little more than three months after President Donald Trump’s Dec. 11 executive order that opened the possibility of federal lawsuits against states that create artificial intelligence laws that conflict with federal policy. The order exempted child-protection state laws.

Sen. Lisa Boscola of Northampton County, a member of the Senate Communications and Technology Committee, said state lawmakers are continuing to work on artificial intelligence legislation regardless of federal positions.

“We are just trying to listen to our constituents,” Boscola said. “We cannot wait for Congress. They have no ability to act sometimes.”

Sen. Devlin Robinson of Allegheny County, lead sponsor of a separate bill to ban cell phone use by students during the school day, said of the federal position on artificial intelligence, “I don’t worry about that whenever I go to vote.”

Under the bill, when a chatbot operator knows the user is a child, the operator would be required to provide notices at least every three hours reminding the user to take a break and that the AI companion is artificially generated and not human.

The bill also would require measures to prevent the AI companion from producing visual material of sexually explicit conduct or directly instructing a minor to engage in sexually explicit conduct.

The Pennsylvania Attorney General’s Office would enforce the law, with fines of up to $10,000 per violation.