T cells encounter their cognate antigens in specialized compartments of secondary lymphoid organs (SLOs). There, dendritic cells (DCs) present self and non-self antigens to T cells, and promote immunity or tolerance depending on the availability of danger signals. Resident stromal cells orchestrate the interaction between T cells and DCs by recruiting them to T cell zones and guiding their migration within SLOs. Recent studies have shown that SLO-resident stromal cells also have a crucial role in tolerance induction in the periphery. In this Review, we discuss the roles of SLO-resident DCs and stromal cells in shaping T cell responses.