European Union member states on Tuesday agreed the world’s first major law for regulating artificial intelligence.