The European Union has agreed on legislation to govern the use of artificial intelligence. It says the future legal framework for AI will include tough penalties for companies breaking the rules, but will not stifle development of the industry in Europe.