Photosensitizers, which harness light energy to upgrade weak reductants to strong reductants, are pivotal components of the natural and artificial photosynthesis machineries. However, it has proved difficult to enhance and expand their functions through genetic engineering. Here we report a genetically encoded, 27 kDa photosensitizer protein (PSP), which facilitates the rational design of miniature photocatalytic CO2-reducing enzymes. Visible light drives PSP efficiently into a long-lived triplet excited state (PSP*), which reacts rapidly with reduced nicotinamide adenine dinucleotide to generate a super-reducing radical (PSP•), which is strong enough to reduce many CO2-reducing catalysts. We determined the three-dimensional structure of PSP•at 1.8 Å resolution by X-ray crystallography. Genetic engineering enabled the site-specific attachment of a nickel–terpyridine complex and the modular optimization of the photochemical properties of PSP, the chromophore/catalytic centre distance and the catalytic centre microenvironment, which culminated in a miniature photocatalytic CO2-reducing enzyme that has a CO2/CO conversion quantum efficiency of 2.6%.