Elon Musk’s AI chatbot Grok will be blocked from editing photos to portray real people in revealing clothing in places where that is illegal, X said late Wednesday.

The announcement came amid a global backlash over sexualized images of women and children that had been generated using Grok, including through a feature billed as “spicy mode.”

California, the U.S.’s most populous state, announced on Wednesday an investigation into the proliferation of nonconsensual sexually explicit material produced using Grok, which the state said was harassing women and girls. In early coverage of the issue, media queries about the problem drew only the response on X, “legacy media lies.”

In a statement posted on X, xAI said it had implemented technological measures to prevent the Grok account from allowing image editing of real people in revealing clothing such as bikinis, underwear and other revealing attire. The company said the rule would apply to all users, including paid subscribers.

xAI also said it limited image creation or editing to paid subscribers only “to ensure that individuals who attempt to abuse the Grok account to violate the law or our policies can be held accountable.”

The Associated Press reported that the image editing tool was still available to free users on X using the “Edit image” button, and also on the standalone Grok website and app. AP said the tool was also able to generate images of people in bikinis on a free account based in California.

Internationally, Malaysia and Indonesia took legal action and blocked access to Grok. Authorities in the Philippines said they were working to do the same, possibly within the week, while the U.K. and European Union were investigating potential violations of online safety laws.

France and India issued warnings, and Brazil called for an investigation into what it described as misuse. The British government welcomed the change, while Ofcom said it would carry on with its investigation.

Technology Secretary Liz Kendall said, “I shall not rest until all social media platforms meet their legal duties and provide a service that is safe and age-appropriate to all users,” and California Attorney General Rob Bonta urged xAI to ensure there was no further harassment of women and girls from Grok’s editing functions.

Bonta said, “We have zero tolerance for the AI-based creation and dissemination of nonconsensual intimate images or of child sexual abuse material,” and noted that California has passed laws to shield minors from AI-generated sexual imagery of children. He also cited a requirement for AI chatbot platforms to remind users they aren’t interacting with a human.

Democratic Gov. Gavin Newsom vetoed a law last year that would have restricted children’s access to AI chatbots.