Objective To achieve a comprehensive understanding of patients' adherence to medication following acute coronary syndrome (ACS), we assessed the possible moderating role played by attachment orientation on the effects of attitudes, subjective norms, and perceived behavioral control (PBC), as derived from the Theory of Planned Behavior (TPB; Ajzen, 1991), on intention and reported adherence. Method A prospective longitudinal design was employed. During hospitalization, ACS male patients (N = 106) completed a set of self‐report questionnaires including sociodemographic variables, attachment orientation, and measures of TPB constructs. Six months post‐discharge, 90 participants completed a questionnaire measuring adherence to medication. Results Attachment orientations moderated some of the predictions of the TPB model. PBC predicted intention and reported adherence, but these associations were found to be significant only among individuals with lower, as opposed to higher, attachment anxiety. The association between attitudes and intention was stronger among individuals with higher, as opposed to lower, attachment anxiety. Only among individuals with higher attachment avoidance, subjective norms were negatively associated with intention to take medication. Conclusions Cognitive variables appear to explain both adherence intention and behavior, but differently, depending on individuals' attachment orientations. Integrating personality and cognitive models may prove effective in understanding patients' health behaviors.