In his first major encyclical Pope Leo called on global leaders to ensure that artificial intelligence remains a tool to serve human dignity and not undermine it.