I guess in hindsight you made it decently clear to work in the animation blueprint instead of the ai controller blueprint, but I missed that and the result was I set it up in the ai controller on beginplay to cast our pawn to the correct blueprint, and from there find the animation blueprint attached and assign it to a variable.
After this is done whenever the ai detects or loses the player the ai controller sets the animation blueprint variable to true or false accordingly, right after setting or clearing the blackboard keys.