We experimentally examine how real group identity of parties (a principal and an agent) facing a moral hazard problem may attenuate the problem and thereby implement the efficient outcome. We find that, the frequency of the efficient outcome is significantly higher when both parties share the same identity than when they do not. However, when we induce a substantially weaker form of identity or increase an outside-option payoff offered to the principal, the frequency of the efficient outcome diminishes considerably, even when the parties’ identities align perfectly. Our results have important implications for the design of nonpecuniary contract enforcement devices.