A legal analysis of human and electronic agents