The development of germplasm adapted to changing climate is required to ensure food security1,2. Genomic prediction is a powerful tool to evaluate many genotypes but performs poorly in contrasting environmental scenarios3–7 (genotype × environment interaction), in spite of promising results for flowering time8. New avenues are opened by the development of sensor networks for environmental characterization in thousands of fields9,10. We present a new strategy for germplasm evaluation under genotype × environment interaction. Yield was dissected in grain weight and number and genotype × environment interaction in these components was modeled as genotypic sensitivity to environmental drivers. Environments were characterized using genotype-specific indices computed from sensor data in each field and the progression of phenology calibrated for each genotype on a phenotyping platform. A whole-genome regression approach for the genotypic sensitivities led to accurate prediction of yield under genotype × environment interaction in a wide range of environmental scenarios, outperforming a benchmark approach.