Methods, systems and computer program products for protection of content repositories using dynamic watermarking are provided. Aspects include receiving a request for a code stored in a content repository from a user and identifying a plurality of candidate locations in the code to insert watermarks. Aspects also include generating one or more watermarks and inserting the one or more watermarks in a subset of the plurality of candidate locations in the code. Aspects further include providing the code, including the one or more watermarks, to the user.