Purpose This paper aims to investigate the relationship between corporate environmental, social and governance (ESG) ratings and leverage manipulation and the moderating effects of internal and external supervision. Design/methodology/approach The authors draw on a sample of Chinese non-financial A-share-listed firms from 2013 to 2020 to explore the effect of ESG ratings on leverage manipulation. Robustness and endogeneity tests confirm the validity of the regression results. Findings ESG ratings inhibit leverage manipulation by improving social reputation, information transparency and financing constraints. This effect is weakened by internal supervision, captured by the ratio of institutional investor ownership, and strengthened by external supervision, captured by the level of marketization. The effect is stronger in non-state-owned firms and firms in non-polluting industries. The governance dimension of ESG exhibits the strongest effect, with comprehensive environmental governance ratings and social governance ratings also suppressing leverage manipulation. Practical implications Firms should strive to cultivate environmental awareness, fulfil their social responsibilities and enhance internal governance, which may help to strengthen the firm’s sustainability orientation, mitigate opportunistic behaviours and ultimately contribute to high-quality firm development. The top managers of firms should exercise self-restraint and take the initiative to reduce leverage manipulation by establishing an appropriate governance structure and sustainable business operation system that incorporate environmental and social governance in addition to general governance. Social implications Policymakers and regulators should formulate unified guidelines with comprehensive criteria to improve the scope and quality of ESG information disclosure and provide specific guidance on ESG practice for firms. Investors should incorporate ESG ratings into their investment decision framework to lower their portfolio risk. Originality/value This study contributes to the literature in four ways. Firstly, to the best of the authors’ knowledge, it is among the first to show that high ESG ratings may mitigate firms’ opportunistic behaviours. Secondly, it identifies the governance factor of leverage manipulation from the perspective of firms’ subjective sustainability orientation. Thirdly, it demonstrates that the relationship between ESG ratings and leverage manipulation varies with the level of internal and external supervision. Finally, it highlights the importance of governance in guaranteeing the other two dimensions’ roles by decomposing overall ESG.