For two graphs F, H and a positive integer n, the function \(f_{F,H}(n)\) denotes the largest m such that every H-free graph on n vertices contains an F-free induced subgraph on m vertices. This function has been extensively studied in the last 60 years when F and H are cliques and became known as the Erdős–Rogers function. Recently, Balogh, Chen and Luo, and Mubayi and Verstraëte initiated the systematic study of this function in the case where F is a general graph. Answering, in a strong form, a question of Mubayi and Verstraëte, we prove that for every positive integer r and every \(K_{r-1}\) -free graph F, there exists some \(\varepsilon _F>0\) such that \(f_{F,K_r}(n)=O(n^{1/2-\varepsilon _F})\) . This result is tight in two ways. Firstly, it is no longer true if F contains \(K_{r-1}\) as a subgraph. Secondly, we show that for all \(r\ge 4\) and \(\varepsilon >0\) , there exists a \(K_{r-1}\) -free graph F for which \(f_{F,K_r}(n)=\Omega (n^{1/2-\varepsilon })\) . Along the way of proving this, we show in particular that for every graph F with minimum degree t, we have \(f_{F,K_4}(n)=\Omega (n^{1/2-6/\sqrt{t}})\) . This answers (in a strong form) another question of Mubayi and Verstraëte. Finally, we prove that there exist absolute constants \(0<c<C\) such that for each \(r\ge 4\) , if F is a bipartite graph with sufficiently large minimum degree, then \(\Omega (n^{\frac{c}{\log r}})\le f_{F,K_r}(n)\le O(n^{\frac{C}{\log r}})\) . This shows that for graphs F with large minimum degree, the behaviour of \(f_{F,K_r}(n)\) is drastically different from that of the corresponding off-diagonal Ramsey number \(f_{K_2,K_r}(n)\) .