A team engineered a green-light-activatable form of penicillin, enabling spatial and temporal control of antibiotic activity to precisely target infections while reducing systemic exposure and environmental antibiotic resistance development. This innovation utilizes a coumarin-based photolabile protecting group that cages penicillin's active site until triggered by clinically relevant green light. Experimental validation confirmed selective bacterial inhibition upon illumination, signaling a promising approach to overcoming antimicrobial resistance challenges.