In the twilight hours of this year’s legislative session, the New York state Legislature passed a bill that aims to prohibit surveillance pricing.

The One Fair Price Act, which passed both chambers in Albany, would ban surveillance pricing, which would keep companies from using artificial intelligence and algorithmic tools to analyze everything from your browsing and shopping histories, your location, demographics and even your mouse movements on a webpage to determine how much you’re willing to pay for a product.

It’s different from “dynamic pricing” recognized as surge pricing practices.

The state attorney general would be tasked with enforcing the legislation, and Attorney General Letitia James has been pushing the bill hard in recent months.

“This is a big victory in our fight to ban surveillance pricing and help make life more affordable in New York,” James wrote on Facebook Friday.

Gov. Kathy Hochul would need to sign the bill for it to become law.

Coupled with the One Fair Price Act, which has not crossed the finish line, is the Protecting Consumers and Jobs from Discriminatory Pricing Act, which would prevent the use of electronic shelf labels and surveillance pricing in pharmacies and grocery stores. That measure passed the state Senate but has yet to pass the Assembly.

Critics, including the Business Council of New York, believe these bills would hurt customers from receiving discounts like targeted coupons.

“It’s important for the public to understand that these discounts are not disappearing because businesses chose to end them, but because the Legislature is banning them,” the council said in a statement.