The article considers the advantages and disadvantages of using artificial intelligence (AI) in various areas of human activity. Particular attention was paid to the use of AI in the legal field. Prospects for the use of AI in the legal field were identified. The relevance of research on the legal regulation of the use of AI was proved. The use of AI raises an important problem of the compliance with general principles of ensuring human rights. Emphasis is placed on the need to develop and use a Code of ethics for artificial intelligence and legislation that would prevent its misapplication and minimize possible harmful consequences.