While in prison, incarcerated persons can be subjected to qualitatively different conditions of confinement ranging from minimum to maximum security settings. In this study, we use data on 17,542 incarcerated men to assess whether the relationship between visitation and recidivism varies across the types of settings (i.e. minimum, medium, close, and maximum custody units) in which individuals are housed and receive their visits. We find that the relationship between prison visitation and rearrest varies across conditions of confinement, and that this association is highly attenuated for individuals confined in close and maximum security units. We also find that these patterns are robust to alternate various measures of recidivism (reconviction and return to prison) and visitation (frequency and timing). These results raise questions about the nature and effectiveness of visitation in highly restrictive settings, and suggest that an ecological framework should be applied to future studies of prison visitation and recidivism.