Hello I'm looking for a way to limit a unit vector between two vectors.

Imagine an I.A controlled entity that throw objects to the player. At first the entity A simply targets the player at B.
If the resulted vector AB is between the vectors AR and AL, all is fine, there is nothing to do. If the object direction is outside these vectors the final projectile vector will be the nearest of AR and AL.
I have some complicated ideas but I'm sure there is some math functions for that. Sorry if it's obvious for you.