OCD has been conceptualized as a disorder arising from dysfunctional beliefs, such as overestimating threats or pathological doubts. Yet, how these beliefs lead to compulsions and obsessions remains unclear. Here, we develop a computational model to examine the specific beliefs that trigger and sustain compulsive behavior in a simple symptom-provoking scenario. Our results demonstrate that a single belief disturbance – a lack of confidence in the effectiveness of one’s preventive (harm-avoiding) actions – can trigger and maintain compulsions and is directly linked to compulsion severity. This distrust can further explain a number of seemingly unrelated phenomena in OCD, including the role of not-just-right feelings, the self-perpetuating nature of compulsions, the link to intolerance to uncertainty, perfectionism, and overestimation of threat, and deficits in reversal and state learning. Our simulations shed new light on which underlying beliefs drive compulsive behavior and highlight the important role of perceived ability to exert control for OCD.