Limit character movement based on distance

I shoot an arrow on which a rope is attached, then I can attach the other end of the rope(which is attached to the character) somewhere else. At the moment the rope will be able to stretch endlessly but I want to limit that to the original rest length of the rope. I’m doing that based on the distance between the character and the arrow attachment of the rope. Now I only need to know how to constrain the movement of the character to that length, so he can’t go beyond the length of the rope.

Now the character should still be able to move but not further away from the arrow attachment than for example 1000 units (if the rope is 1000 units long).

Anyone an idea that is more or less elegant?