T-cell activation is critical for successful immune responses and is controlled at multiple levels. Although many changes of T-cell receptor-associated signalling molecules affect T-cell activation, the transcriptional mechanisms that control this process remain largely unknown. Here we find that T cell-specific deletion of the mediator subunit Med23 leads to hyperactivation of T cells and aged Med23-deficient mice exhibit an autoimmune syndrome. Med23 specifically and consistently promotes the transcription of multiple negative regulators of T-cell activation. In the absence of Med23, the T-cell activation threshold is lower, which results in enhanced antitumour T-cell function. Cumulatively, our data suggest that Med23 contributes to controlling T-cell activation at the transcriptional level and prevents the development of autoimmunity.