Correction to: Nature Medicine https://doi.org/10.1038/s41591-024-03025-3, 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.