I think the key may be to train A.I. in the best understanding we have of ethical philosophy, morality, and the meaningfulness of human existence and biological nature itself--the uniqueness and beauty of life. Is it possible for a machine of such advanced artificial intelligence to gain an understanding of these things since they are in some sense subjective? I expect that's one of the things that will have to be grappled with as the technology advances and improves.