Dynamic host–pathogen interactions determine whether disease will occur. Pathogen effector proteins are central players in such disease development. On one hand, they improve susceptibility by manipulating host targets; on the other hand, they can trigger immunity after recognition by host immune receptors. A major research direction in the study of molecular plant pathology is to understand effector-host interactions, which has informed the development and breeding of crops with enhanced disease resistance. Recent breakthroughs on experiment- and artificial intelligence-based structure analyses significantly accelerate the development of this research area. Importantly, the detailed molecular insight of effector–host interactions enables precise engineering to mitigate disease. Here, we highlight a recent study by Xiao et al., who describe the structure of an effector-receptor complex that consists of a fungal effector, with polygalacturonase (PG) activity, and a plant-derived polygalacturonase-inhibiting protein (PGIP). PGs weaken the plant cell wall and produce immune-suppressive oligogalacturonides (OGs) as a virulence mechanism; however, PGIPs directly bind to PGs and alter their enzymatic activity. When in a complex with PGIPs, PGs produce OG polymers with longer chains that can trigger immunity. Xiao et al. demonstrate that a PGIP creates a new active site tunnel, together with a PG, which favors the production of long-chain OGs. In this way, the PGIP essentially acts as both a PG receptor and enzymatic manipulator, converting virulence to defense activation. Taking a step forward, the authors used the PG-PGIP complex structure as a guide to generate PGIP variants with enhanced long-chain OG production, likely enabling further improved disease resistance. This study discovered a novel mechanism by which a plant receptor plays a dual role to activate immunity. It also demonstrates how fundamental knowledge, obtained through structural analyses, can be employed to guide the design of proteins with desired functions in agriculture.