Elon Musk’s platform X announced measures to prevent its AI chatbot Grok from undressing images of real people, following global backlash over its generation of sexualised images of women and children.

X said it will “geoblock the ability” of all Grok and X users to create images of people in “bikinis, underwear, and similar attire” in those jurisdictions where such actions are deemed illegal.

“We have implemented technological measures to prevent the Grok account from allowing the editing of images of real people in revealing clothing such as bikinis,” X’s safety team said in a statement.

“This restriction applies to all users, including paid subscribers,” they added.

The statement comes just hours after California’s attorney general launched an investigation into Mr Musk’s xAI – the developer of Grok – over the generation of “non-consensual, sexually explicit material” in recent weeks.

International pressure had been building on xAI to rein in Grok after a feature allowed users to create sexualised deepfakes of women and children.

Indonesia became the first country to block access to Grok entirely, with neighbouring Malaysia following.

India said that X had removed thousands of posts and hundreds of user accounts in response to its complaints.

Britain’s Ofcom media regulator said it was opening a probe into whether X failed to comply with UK law over the sexual images.

France’s commissioner for children Sarah El Hairy said she had referred Grok’s generated images to French prosecutors, the Arcom media regulator and the European Union.