Isaac Asimov's "Three Laws of Robotics" A robot may not injure a human being or, through inaction, allow a human being to come to harm. A robot must obey orders given it by human beings except where such orders would conflict with the First Law--- This would apply to AI as well. Wouldn't be bad for Human beings either. but we are not hard coded with this.
RE: If We're in a Simulation, Could Studying Morality and A.I. Improve Your Life?