Applying belongingness and attachment theories, we explore the association between employees' perception of psychological contract breach and counterproductive work behaviors, while also considering the mediating effect of workplace ostracism and the moderating role of attachment styles (i.e., attachment anxiety and attachment avoidance). Time‐lagged data from full‐time personnel working in telecommunications and transportation sectors in North America were collected at three different time points with an interval of 3 weeks between each wave. A total of 272 responses from the three measurement points were retained for our analysis. In support of what was hypothesized, our study's findings show that perception of contract breach fueled workplace deviance through the anticipated effect of workplace ostracism. Furthermore, and in line with what we assumed, the mediating effect of workplace ostracism was reinforced by employees' fear of rejection and abandonment in relationships (i.e., attachment anxiety). The role of attachment avoidance, however, was not found to moderate the indirect effect, contrary to our expectations. In conclusion, embedded in belongingness and attachment theorizing, this study offers empirical evidence of how workplace ostracism is a crucial mechanism that helps to explain the indirect effect through which psychological contract breach triggers counterproductive work behaviors. Furthermore, our findings illustrate how this relationship is conditional on attachment anxiety observed in employees.