In order to site-specifically introduce caging groups onto amino acid residues in proteins, we appliy a synthetic biology approach using cells engineered with an expanded genetic code. The cells are grown in the presence of synthesized caged amino acids, e.g., caged lysine or caged tyrosine, and introduce those amino acids exclusively at amber stop codon mutations in the protein of interest. The protein containing the caged amino acid, typically in an active site location, is expressed inside the cells and is inactive until brief exposure to noninvasive UV light removes the caging group and activates protein function. The cellular process placed under optochemical control can then be studied with high spatial and temporal resolution.