Food addiction is linked to obesity and eating disorders and is characterized by a loss of behavioral control and compulsive food intake. Here, using a food addiction mouse model, we report that the lack of cannabinoid type-1 receptor in dorsal telencephalic glutamatergic neurons prevents the development of food addiction-like behavior, which is associated with enhanced synaptic excitatory transmission in the medial prefrontal cortex (mPFC) and in the nucleus accumbens (NAc). In contrast, chemogenetic inhibition of neuronal activity in the mPFC-NAc pathway induces compulsive food seeking. Transcriptomic analysis and genetic manipulation identified that increased dopamine D2 receptor expression in the mPFC-NAc pathway promotes the addiction-like phenotype. Our study unravels a new neurobiological mechanism underlying resilience and vulnerability to the development of food addiction, which could pave the way towards novel and efficient interventions for this disorder.