The increasing use of artificial intelligence has brought both opportunity and risk to the legal profession.