Social media provide opportunities to consume and share political news in echo chambers, but also to communicate with members of political outgroups. Exposure to political outgroups is often portrayed as the normatively desirable option, although empirically it has mixed effects. With an experimental study, we find that participants who regularly interact with political outgroups on social media share more politically moderate news articles when we assign them to an audience of mostly outgroup versus ingroup members. On the other hand, those who are accustomed to an online echo chamber subsequently polarize when faced with an outgroup audience. Our study holds implications for how a person’s online social setting can shape downstream political interactions, and, more broadly, our findings highlight the importance of incorporating pretreatment measures to understand how online environments influence political behavior.