The European Union is set to thrash out an agreement on sweeping rules to regulate artificial intelligence on Wednesday, following months of difficult negotiations in particular on how to monitor generative AI tools like ChatGPT.

The EU is racing to approve the world's first comprehensive AI law after the issue took on greater urgency when the ChatGPT bot burst onto the scene last year and highlighted AI's dizzying advances. ChatGPT wowed with its ability to produce poems and essays within seconds.

AI proponents say the technology will benefit humanity, transforming everything from work to health care, but others worry about the risks it poses to society, fearing it could thrust the world into unprecedented chaos.