One way to do this is with invisible tile collisions using a specific layer/mask setup. You could have a transparent tile on a tileset with its collision set to a unique layer. Then on the enemy, set its collision mask to detect that layer. After that, you can map out a region with those invisible tiles where you want the enemy to walk, and it’ll act like walls just for that enemy.