So...dont do that? Its like complaining that you can shoot certain bosses forever with arrows from a safe location in Souls games. You dont have to do it there and you dont have to do it here either.
This isnt even a defense force type of reply, as Im not enamored with it as most are, but people that break games and then complain about breaking games is always weird to me.
Sometimes the issue is more explicit. I have accidentally stumbled upon the boundaries that enemies roam, at which point they behave oddly, moving back to where they used to be, unsure if they should be attacking you or returning to their position. You can trigger that odd behaviour by accident.
It's not a big issue to fix it in this game, but in the future I think it would make the games seem more polished if AI were consistently threatening. Not to mention, if they intended to add any multiplayer components to the game, then what exists now as an exploit that affects no one but the player themselves, would likely spoil the games difficulty, reward and challenge when played with others.
Also 99% of Souls bosses aren't as exploitable as you describe. You're forced into most arenas and the bosses themselves are pretty relentless in attacking you. If there are any glitches that affect the fight then they need to be deliberately sought out.