Silk protein fibers produced by silkworms and spiders are renowned for their unparalleled mechanical strength and extensibility arising from their high-β-sheet crystal contents. Here, we report on electron-regulated nanoscale polymorphic transitions in silk proteins revealed by near-field infrared imaging and nano-spectroscopy at resolutions approaching the molecular level. The ability to locally probe nanoscale protein structural transitions combined with nanometer-precision electron-beam lithography allows us to finely control the structure of silk proteins in two and three dimensions. Our work paves the way for unlocking essential nanoscopic protein structures and critical conditions for electron-induced conformational transitions, offering new rules to design protein-based nanoarchitectures.