Ai Stay in Area?

set a bool in blackboard bisinfence .then once its in fence make it true and on your behavior tree set a behavior that bool was true then get random point from navmesh (random point origin should be center of the fence and radius should be touching walls of the fence) then move to that point wait a second or more and then find another point in that fence