Correction to: Nature Medicine, published online 6 June 2024

In the version of the article initially published, the text “Immune-related adverse effects were exclusively associated with pembrolizumab” and, in the following sentence, also referring to adverse effects, “…all related to pembrolizumab” has been removed from the Abstract. In the final paragraph of the Results, “assessed by the treating physicians” has been inserted after “Related adverse effect to pembrolizumab…”. These changes have been made to the HTML and PDF versions of the article.