We report the genetic incorporation of caged cysteine and caged homocysteine into proteins in bacterial and mammalian cells. The genetic code of these cells was expanded with an engineered pyrrolysine tRNA/tRNA synthetase pair that accepts both light-activatable amino acids as substrates. Incorporation was validated by reporter assays, western blots, and mass spectrometry, and differences in incorporation efficiency were explained by molecular modeling of synthetase-amino acid interactions. As a proof-of-principle application, the genetic replacement of an active-site cysteine residue with a caged cysteine residue in Renilla luciferase led to a complete loss of enzyme activity; however, upon brief exposure to UV light, a >150-fold increase in enzymatic activity was observed, thus showcasing the applicability of the caged cysteine in live human cells. A simultaneously conducted genetic replacement with homocysteine yielded an enzyme with greatly reduced activity, thereby demonstrating the precise probing of a protein active site. These discoveries provide a new tool for the optochemical control of protein function in mammalian cells and expand the set of genetically encoded unnatural amino acids.