PLGA-based polymers include pendant nucleophiles protected with photocleavable protecting groups. Upon deprotection, the polymers degrade rapidly via intramolecular cyclization into small molecules. The polymer may be formulated as a nanoparticle, with an encapsulated payload, which may be an imaging agent, a bioactive agent or a pharmaceutical agent.