This paper studies the effect of social closure on crime and tax evasion rates using disaggregated data for Italian municipalities. It measures the degree of social openness of a community by the diversity of its surname distribution, which reflects the history of migration and inbreeding. It shows that, all else equal, communities with a history of social closure have lower crime rates and higher tax evasion rates than more open communities. The effect of social closure is likely to be causal, it is relevant in magnitude, statistically significant, and robust to changes in the set of included controls, in the specific measures of dependent and independent variables, in the specification of the regression equation, and in the possible sample splits. Our findings are consistent with the idea that social closure strengthens social sancions and social control, thus leading to more cooperative outcomes in local interactions, but it reduces cooperation on a larger scale.