Learning to Avoid Unintended Consequences