Creating sexual images of a person without their consent — including through the use of artificial intelligence, will become a criminal offence in the United Kingdom this week, the government has announced.

Science and Technology Secretary Liz Kendall confirmed the move on Monday, following public outrage over the misuse of Elon Musk’s AI chatbot, Grok, on the social media platform X.

The controversy erupted after users were found prompting the AI tool to generate altered images that digitally removed clothing from photographs of individuals, with women and children among those targeted. Two UK cabinet ministers were reportedly affected, alongside other high-profile figures.

In response, X restricted access to Grok’s image-generation features, limiting them to verified users whose real identities are linked to their accounts. However, criticism intensified after Musk appeared to downplay the issue, framing restrictions as a threat to free speech.

Addressing Parliament on Monday, Kendall said the new offence would be enacted under the Data (Use and Access) Act, passed last year. The law will make it illegal to create sexualised images of a person without their consent, regardless of whether AI tools are used.

She added that so-called “nudification” apps are also set to be outlawed under the forthcoming Crime and Policing Bill, which aims to stop companies from supplying tools used to create non-consensual images.

“This legislation will tackle the problem at its source,” Kendall said, though she did not specify the exact date the offence would take effect.

Prime Minister Sir Keir Starmer warned that X could lose its ability to self-regulate if it fails to control misuse of its platform.

“If you profit from harm and abuse, you lose the right to self-regulate,” Starmer told Labour MPs.

Meanwhile, media regulator Ofcom has launched an investigation into whether X breached UK law by failing to protect users from illegal content.

In a statement, Ofcom said reports of Grok being used to generate sexualised images of individuals — including children — were “deeply concerning” and could constitute serious criminal offences.