General methods for spatiotemporal control of specific endogenous proteins would be broadly useful for probing protein function in living cells. Synthetic protein binders that bind and inhibit endogenous protein targets can be obtained from nanobodies, designed ankyrin repeat proteins (DARPins), and other small protein scaffolds, but generalizable methods to control their binding activity are lacking. Here, we report robust single-chain photoswitchable DARPins (psDARPins) for bidirectional optical control of endogenous proteins. We created topological variants of the DARPin scaffold by computer-aided design so fusion of photodissociable dimeric Dronpa (pdDronpa) results in occlusion of target binding at baseline. Cyan light induces pdDronpa dissociation to expose the binding surface (paratope), while violet light restores pdDronpa dimerization and paratope caging. Since the DARPin redesign leaves the paratope intact, the approach was easily applied to existing DARPins for GFP, ERK, and Ras, as demonstrated by relocalizing GFP-family proteins and inhibiting endogenous ERK and Ras with optical control. Finally, a Ras-targeted psDARPin was used to determine that, following EGF-activation of EGFR, Ras is required for sustained EGFR to ERK signaling. In summary, psDARPins provide a generalizable strategy for precise spatiotemporal dissection of endogenous protein function.