Hey,
your problem is quite similar to what I have seen earlier here: https://answers.unrealengine.com/questions/177899/two-player-top-down-stop-players-running-off-scree.html
As IanBreeg explained, you’ll need some vector math. There currently isn’t any node that can check what the player can see, so you’ll have to do it manually. You’ll effectively create a set of coordinates that make up the boundaries of what the player can see. You can then use those to check whether the AI is within those boundaries.
I can try and go into a bit more detail in a bit. Just gotta head home first.